-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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@6: Fix C++ compilation for Mojave and Catalina #45693
Conversation
@jamiesnape: could you please walk us through the rationale for all of the test changes? That would make reviewing this a bit easier. EDIT: OK, I may just be a bit tired... I think I mostly follow the test logic. Anyway, explicitly discussing each change to an old test would be helpful if you find the time. |
@@ -109,6 +109,11 @@ def install | |||
-DLLVM_CREATE_XCODE_TOOLCHAIN=ON | |||
] | |||
|
|||
if MacOS.version >= :mojave | |||
sdk_path = MacOS::CLT.installed? ? "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" : MacOS.sdk_path |
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.
This seems like it should be updated in homebrew/brew itself rather than this formula. What makes llvm@6 need this as a special case vs other formulae?
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.
Not sure many other formulae would need such logic unless they are compilers. We need an explicit SDK path so the compiler that is built by the formula (versus the compiler that is building the formula) knows where to find the SDK in future. But, yes, it would be useful logic (if MacOS::CLT.installed? == False
is truly a supported configuration).
So as far as the tests go, there are different configurations to be tested, depending on the location of the SDK that is being used by the compiler. It can explicitly use the SDK from the command line tools, the SDK from Xcode, or it can use whatever its default SDK is, which depends on whether it was built on a system that had the command line tools installed. There are also different LLVM also bundles various tools. I am testing (And I remove |
My apologies if I'm saying something that's common knowledge, but there's significant value to alignment between homebrew llvm's default search paths and those used by the Apple compiler beyond just Catalina compatibility. Apple doesn't ship clang-tidy, for example, but homebrew does. It can be an exercise in frustration trying to use homebrew's clang-tidy with a compilation database created from Apple clang++ invocations because the compilation database (a list of compile commands with flags) won't include the implicit search paths the Apple clang++ uses. I'm seeing this on my Mac Pro still stuck on High Sierra. Would it be possible to use this opportunity to align the search paths Apple vs homebrew across the board, rather than making a fix specific to Catalina? |
That would need a patch to the source code. |
A discussion on them was already in #45304. The purpose of these PR is also there. It's a very long thread, but I recommend read it if you're interested. |
I think this PR is ready to merge. |
EDIT: That was premature; the bottle was deleted from CI.... 😭 Thanks for your contribution to Homebrew! 🎉 🥇 Without awesome contributors like you, it would be impossible to maintain Homebrew to the high level of quality users have come to expect!!! |
@BrewTestBot test this please! |
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.
LGTM
👀 |
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.
👍
👍 |
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 <formula>
)?Revises tests to be closer to real-world usage and add extra tests to verify some of the bundled tools work.
Relates #45061 and #45304. FYI @imbsky.