Fix #1735: Discover and use clang-10 or clang-9, if present. #1736
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
clang-10 and clang-9 are now available. Discover and use the highest
installed clang on the build system. This is the next
in a long series of clang update PRs. It supersedes pending PR Discover & use clang-9, if present. #1686.
Scala Native appears to build and run test-all without notice using
either clang-10 or clang-9. The only difference is the audible
sizzle of Cool.
I removed the line
("8", "0")
because a year has gone by and shown thatbit of defensive programming to be unneeded. It has served its purpose.
The resultant code will contain less lore and execute slightly quicker.
clang-8 will still be discovered, if it is the highest installed version.
The Discovery code does not, and has not for years, discover
llvm-config of the form llvm-config-N, where N is [3-9]. The current
PR does no worse that prior art. A PR for another day.
This PR adds two clang version to the current discovery mechanism.
That mechanism is now checking quite a load of ancient clang versions.
I believe that the discovery mechanism should be changed to a
"specification" mechanism. That is, require developers to
specify any desired clang version other than the system default "clang".
I did not make this change to minimize churn whilst ScalaNative is
undergoing re-organization.
Documentation:
Testing:
Testing needs to show first safety, then efficacy.
Safety, not breaking when neither clang-10 nor clang-9 is installed,
will be shown by Travis CI.
To show that the code change was effective on a system with both
clang-10 and clang-9 installed, I manually added
'nativeCompileOptions ++= Seq("-v")'to the settings in build.sbt for
the sandbox project and then running that project.
The log file showed clang-10 in use.
I then ran "test-all" using clang-10 and all tests passed.
I manually tested as above on the same system with only clang-9 (and
clang itself) installed. clang-9 was used and all tests passed.