-
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
Rewrite cc_configure #6926
Comments
It should also include the ability to easily switch between GNU libstdc++ and LLVM libc++. Currently, this requires either:
I think this problem falls into overall theme of this issue, but please let me know if I should open a separate issue to track this. Thanks! |
Some earlier context on libc++ and Linux at #4524 |
@PiotrSikora and @htuch - is passing |
@hlopko you need to pass |
Yup. you're right. All of this is doable with Bazel today. Is this enough for you, or you'd want an ability to switch it more easily than that? |
I wanted to verify that Perhaps
Tests to catch any regressions there would be great.
Personally, I'm fine with adding a few lines to @htuch @jmillikin-stripe Do you guys have any opinion on that? The two of you are a bit more pedantic, when it comes to the build system, than I am. |
|
@hlopko the same build works fine with Bazel 0.22, so I doubt it's something that fundamental. Any chance you could take a look at it? The build instructions are pretty easy. |
@hlopko sorry, it appears that there was a change that broke local builds with libc++ in our build system committed at the time when I was testing 0.23rc1, and after reverting it 0.23rc1 seems to work fine. Sorry for the noise! |
Here's another use case that would be nice to cover so that users can override some pieces of the toolchain, without having to create their own crosstool #7883 |
From email threads:
|
Tested with Bazel CI downstream projects. These fail for unrelated reasons. Both together show that everything is green with my change: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/971 https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/969 This change makes it unnecessary to patch most CppActionConfig features only in Linux for now. The build_interface_libraries feature is still patched. Once Bazel is released with this change: 4eb7683 we can stop patching it. Also a separate change should do the same for Windows and Mac. This also unblocks flipping --incompatible_do_not_split_linking_cmdline #8303, #6926, #7687 RELNOTES:none PiperOrigin-RevId: 248117783
Fixes bazelbuild#8479. To keep this backwards compatible we have to detect xcode early in the Bazel build (even when no C++ is being built). In cases where user knows there is xcode, or when they know it won't be needed, I'm adding environment variable `BAZEL_USE_XCODE_TOOLCHAIN`. When set to `1`, Bazel will not try to detect xcode, it will assume it is there. Makes bazelbuild#6926 a little bit more complicated. RELNOTES: `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode.
Fixes #8479. To keep this backwards compatible we have to detect xcode early in the Bazel build (even when no C++ is being built). In cases where user knows there is xcode, or when they know it won't be needed, I'm adding environment variable `BAZEL_USE_XCODE_TOOLCHAIN`. When set to `1`, Bazel will not try to detect xcode, it will assume it is there. Makes #6926 a little bit more complicated. RELNOTES: `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. Closes #8492. PiperOrigin-RevId: 250518695
Tested with Bazel CI downstream projects. These fail for unrelated reasons. Both together show that everything is green with my change: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/971 https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/969 This change makes it unnecessary to patch most CppActionConfig features only in Linux for now. The build_interface_libraries feature is still patched. Once Bazel is released with this change: bazelbuild@4eb7683 we can stop patching it. Also a separate change should do the same for Windows and Mac. This also unblocks flipping --incompatible_do_not_split_linking_cmdline bazelbuild#8303, bazelbuild#6926, bazelbuild#7687 RELNOTES:none PiperOrigin-RevId: 248117783
Fixes bazelbuild#8479. To keep this backwards compatible we have to detect xcode early in the Bazel build (even when no C++ is being built). In cases where user knows there is xcode, or when they know it won't be needed, I'm adding environment variable `BAZEL_USE_XCODE_TOOLCHAIN`. When set to `1`, Bazel will not try to detect xcode, it will assume it is there. Makes bazelbuild#6926 a little bit more complicated. RELNOTES: `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. Closes bazelbuild#8492. PiperOrigin-RevId: 250518695
Fixes bazelbuild#8479. To keep this backwards compatible we have to detect xcode early in the Bazel build (even when no C++ is being built). In cases where user knows there is xcode, or when they know it won't be needed, I'm adding environment variable `BAZEL_USE_XCODE_TOOLCHAIN`. When set to `1`, Bazel will not try to detect xcode, it will assume it is there. Makes bazelbuild#6926 a little bit more complicated. RELNOTES: `BAZEL_USE_XCODE_TOOLCHAIN=1` tells Bazel not to look for Xcode to decide whether to enable toolchains for Apple rules, but to assume Xcode is available. Can be also used when building on Darwin and no C++ or ObjC is being built, so there is no need to detect Xcode. Closes bazelbuild#8492. PiperOrigin-RevId: 250518695
Also consider environments where multiple compilers may be available and necessary to build different targets. For example, having a dependency on a library that can only be built with gcc, and a different library that can only be built with clang. A way to do this would be to extend cc_configure and/or cc_autoconf.* to take parameters, so one can specify a path for the compiler to use, for example, and the name of the toolchain to create. Those parameters can be filled in by default from environment variables, or detection code, but you can leave the option to call cc_configure() with the correct parameters to use of bazel to simplify the detection and creation of multiple toolchains. See also: #7020 |
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so. |
Current cc_configure is greatly suboptimal:
The text was updated successfully, but these errors were encountered: