-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add override point for cc_autoconf #7883
Conversation
With this change, here's an example of how you can override a tool: cc_autoconf(
name = "local_config_cc",
overriden_labels = {
"@bazel_tools//tools/osx/crosstool:osx_archs.bzl": "@lyftios//:foo.bzl"
},
)
bind(
name = "cc_toolchain",
actual = "@local_config_cc//:toolchain",
)
register_toolchains(
"@local_config_cc//:all",
) |
I wanted to submit this PR as a discussion for how we could provide easier ways for users to override specific pieces of this setup, without having to override the whole thing. Recently we've discovered some issues in the crosstool that have required us to either find a workaround, wait for the next bazel release, or create our own crosstool. Having this would make it easier to override those specific pieces temporarily, until the next bazel release. |
@hlopko can you review? |
I grew paranoid of changing |
We've had a significant number of issues that required crosstool changes, having to wait for releases after our changes have landed has definitely pushed us to consider creating our own crosstool quite a few times. I think forcing users towards creating their own crosstool should be an antigoal because that will lead to fewer upstream fixes to the crosstool here. There isn't a huge specific rush from our perspective on landing this (although we did just have to upgrade to the 0.25.0rc2 because of this crosstool bug #7830 that hasn't been released yet), but if those changes aren't coming soon I think it would be great to have this interim solution. |
@hlopko any other thoughts? |
@hlopko friendly ping |
@hlopko friendly ping |
This adds `overriden_labels` to the `cc_autoconf` rule. This allows to override specific tools that bazel uses when setting up `local_config_cc`. The benefit there is that if you want to replace pieces of the cc toolchain, without having to create your own crosstool entirely, this allows you to do that. Specifically for the osx toolchain sometimes overriding flags in response to Xcode updates, without having to wait for a bazel release is useful.
d3b4c84
to
0ce3c76
Compare
Hi Keith, sorry for keeping you waiting. I don't think we'll merge this PR before somebody sits down and thinks (and designs, and tests) how We're also in the process of moving |
Actually, I'm sorry but I'll close this PR now. I'll make sure to include you in the future design discussions of |
This adds
overriden_labels
to thecc_autoconf
rule. This allows tooverride specific tools that bazel uses when setting up
local_config_cc
. The benefit there is that if you want to replacepieces of the cc toolchain, without having to create your own crosstool
entirely, this allows you to do that.
Specifically for the osx toolchain sometimes overriding flags in
response to Xcode updates, without having to wait for a bazel release is
useful. If we're ok with this approach this could also be extended to support overrides for other platform's setup.