-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Remove templating of osx crosstool #7882
Conversation
|
||
Args: | ||
repository_ctx: The repository context. | ||
cc: The default C++ compiler on the local system. |
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.
Can this ever be a cc from a locally built toolchain? For example if I build clang locally and want to use that, it seems that this change prevents me from doing that.
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.
Correct. Also, clang could be installed in /Library/Developer/CommandLineTools
which isn't covered by this new stricter check.
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.
Besides removing some complexity, does this change actually fix a problem? Because the logic exists for a reason and removing it should be traded off for some better value.
|
||
Args: | ||
repository_ctx: The repository context. | ||
cc: The default C++ compiler on the local system. |
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.
Correct. Also, clang could be installed in /Library/Developer/CommandLineTools
which isn't covered by this new stricter check.
Thanks for the feedback. The reason I submitted this was:
If this is the only place clang is installed, I believe this will end up going through the unix setup, which appears to whitelist bazel/tools/cpp/cc_toolchain_config.bzl Lines 1202 to 1203 in 716e19c
(although I'm not sure why this file and https://github.com/bazelbuild/bazel/blob/716e19c77154cec4daa32e33a4310cac07d31a00/tools/cpp/cc_toolchain_config.bzl.tpl exist so maybe this isn't the case) Should we do that instead? |
@aragos any thoughts? |
Added @trybka as I think he's working in the same space and may be submitting a change accomplishing something similar to yours. |
Is it actually reasonable to expect external users to always have Xcode under /Applications? One of the most common complaints we get is when users have it under /Users/Me/Applications. Of course, internally we can mandate that they move it. But can we force the same thing externally? (This is a question for the Bazel folks) @aragos |
I don't have a strong opinion on restricting the directories to |
7dfb131
to
59254f6
Compare
@aragos updated! |
As you can see above this change fails some tests. Please address the failures and then I'll import it. |
Both of these tests are failing because they expected a build failure because of these paths being invalidated. Which I guess means it wasn't checking this codepath https://github.com/keith/bazel/blob/59254f64fba89c822543c347669b538177cd35f8/tools/cpp/cc_toolchain_config.bzl#L1202-L1203 do you have a recommendation for a solution to them? |
This test fails as expected: bazel/src/test/py/bazel/cc_import_test.py Line 244 in 3f7f255
Not sure why this failure is happening, it may be unrelated to your change (or not :): http://go/gh/bazelbuild/bazel/blob/0b03a28701d297c9ffe976c54580ceff32eec1b7/src/test/shell/bazel/cc_integration_test.sh#L106, further investigation/rerun is needed. |
Previously this file was templated so that cxx_builtin_include_directories could be set on each machine. For macOS the only paths you should need here are ones to Xcode, which with this change would be required to live in `/Applications`. This mirrors the behavior of Google's internal crosstool.
59254f6
to
b950db7
Compare
I've opted out of that test, we'll see if the other one fails again |
@hlopko since you added the test that's failing here can you help me understand if this is still an issue with this change? |
@hlopko friendly ping |
This was done in a different way here ac3d06b It's still using the previous include dirs, so if we'd prefer / like what Google uses it could still be a follow up. But given the non-response here I'm going to close anyways. |
Previously this file was templated so that
cxx_builtin_include_directories could be set on each machine. For macOS
the only paths you should need here are ones to Xcode, which with this
change would be required to live in
/Applications
. This mirrors thebehavior of Google's internal crosstool.