-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm: make bottle compatible with Xcode-only installs #79666
Conversation
This patch implements various improvements I found while working on Homebrew#77975. A few are cosmetic, but the primary substantive change is the use of the `C_INCLUDE_DIRS` CMake variable. [1] This adds Homebrew's `include` directory along with Xcode's system header path to Clang's default include search path. The former change aligns our Clang with Apple's, which searches `/usr/local/include` by default. [2] The latter change allows the bottle to be poured in Xcode-only installs so that we no longer need the `pour_bottle?` check. We also add `/Library/Developer/CommandLineTools/usr/include` to the default header search path to align our build with Apple's. [1] https://reviews.llvm.org/D69221 [2] From `/usr/bin/clang -E -xc -v /dev/null`: Apple clang version 12.0.5 (clang-1205.0.22.9) [snip] #include "..." search starts here: #include <...> search starts here: /usr/local/include /Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include /Library/Developer/CommandLineTools/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) End of search list. [snip]
For reference, with our bottled LLVM:
|
|
||
sdk = MacOS.sdk_path_if_needed | ||
args << "-DDEFAULT_SYSROOT=#{sdk}" if sdk | ||
|
||
extra_includes = [HOMEBREW_PREFIX/"include"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping this won't affect the bottle being cellar: :any
, since this is stored in a text file. If it makes the bottle non-relocatable we can drop it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C_INCLUDE_DIRS
should be baked in to clang binaries so it will affect relocatability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_SYSROOT
isn't (at least, not in a way you can find with strings
), so I was maybe a bit hopeful here.
Killing the tests while #79465 is running. |
Sorry to make you wait to test this! I'll wait until you've had a chance to run this before I push any more changes to the LLVM PRs I have open. |
Oh, wait, this might not be a good idea. https://github.com/Homebrew/linuxbrew-core/pull/22742#issuecomment-810641119 Will need to look into this some more. |
I also think C++ stdlib header handling won't read |
Apple's way of handling CLT & Xcode does not lie within LLVM itself - it's with how |
Yup, realising that now. Though, |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?This patch implements various improvements I found while working on #77975.
A few are cosmetic, but the primary substantive change is the use of the
C_INCLUDE_DIRS
CMake variable. [1]This adds Homebrew's
include
directory along with Xcode's systemheader path to Clang's default include search path. The former change
aligns our Clang with Apple's, which searches
/usr/local/include
bydefault. [2] The latter change allows the bottle to be poured in
Xcode-only installs so that we no longer need the
pour_bottle?
check.We also add
/Library/Developer/CommandLineTools/usr/include
to thedefault header search path to align our build with Apple's.
[1] https://reviews.llvm.org/D69221
[2] From
/usr/bin/clang -E -xc -v /dev/null
: