Change LLVM detection on macOS#1123
Conversation
|
Thanks for opening this pull request! The reason why we have been so "strict" about the exact Sometimes things would fail locally but not in CI, and the other way around. So we have been trying to be super intentional in the versions we use so the environment matches as close as possible. That said, I know that this can be annoying and might not be relevant enough for most use cases. This was also in the earlier days of the project, so maybe it's not as relevant anymore and we can relax the constraints a bit so it's easier for people to set up the project. |
|
I understand. Just to be clear, I am using the exact versions the project specifies, I just don't provide them through Homebrew but the equivalent Nix packages instead. |
This PR changes how
clang,clang-tidy, etc., are detected on macOS without requiring any changes for current users.Rationale:
Not everyone uses Homebrew in this way. I personally only use it for application formulae and kegs, and manage my dev dependencies with Nix flakes (which is also what motivated #1120).
Proposed solution:
Use the Homebrew prefix by default on macOS, as it's a sensible choice. Users who install
clangand friends some other way can probably figure out how to override the values as required for their environment (either by exporting environment variables or directly in themakeinvocation).Verification:
I temporarily added the following task to the
Makefile:I ran this before and after making the changes in this PR, the generated output was identical for the Homebrew use case:
Notes:
debug_cctarget could be generally useful, also for Linux users. If you want, I can add it to either this PR or separately.Makefiles to call the variablesCC,CFLAGS, etc. This is primarily because they can be overridden from the environment, and lower-case environment variables look a bit odd. However, I decided not to change this in this PR, as it's not really related to the problem I'm trying to solve here.