compilers: prioritise LLVM clang over GCC on macOS #20696
Merged
+14
−5
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.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Prioritise LLVM clang over GCC on macOS. This has a higher chance of succeeding when there is no manual override of cc/cxx as many formulae are linked to libc++.
However, when the formula has a GCC dependency but no LLVM, then try GCC first. This usually means that we want GCC/libstdc++
Ideally, formulae should work by adding
fails_with :clang
and thendepends_on "gcc"
ordepends_on "llvm" => :build
but right now we need to manually forceENV.llvm_clang
(often from gcc dep for gfortran) breaking compiler selection.LLVM Clang is usually our 2nd preference on macOS due to libc++. And 3rd is GCC (since using GCC often causes linkage to libstdc++ or libgomp which can cause issues in dependency trees)
No changes done on Linux side for now.