You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems a WORKSPACE snippet to set up gcc-toolchain is missing from the current documentation. It would be nice to include the WORKSPACE snippet in documentation or the release page so that users can start using gcc-toolchain without troubles by copying the WORKSPACE snippet into their WORKSPACE files.
Based on this repo's WORKSPACE, below is an example of the WORKSPACE snippet and .bazelrc to use gcc-toolchain v0.4.2 to build binaries for x86_64. It would be great to confirm that there is something wrong or redundant with the snippet. I mentioned this because unusual configs, --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 and --incompatible_enable_cc_toolchain_resolution were required to add to .bazelrc so that Bazel can use the C/C++ toolchain managed by gcc-toolchain. If these configs are required indeed, I think it worth noting it in the documentation because these configs not so obvious for non-Bazel experts.
# Required to use the C/C++ toolchain managed by gcc-toolchain
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build --incompatible_enable_cc_toolchain_resolution
# optional, but preferred for performance as per https://github.com/aspect-build/gcc-toolchain/issues/85
build --experimental_reuse_sandbox_directories
The text was updated successfully, but these errors were encountered:
I agree we should be clear about the extra flags required, they are indeed non-obvious. Before finding BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN buried somewhere deep into the source code, I used to set CC=/bin/false to ensure the toolchain resolution was being enforced, but it started to break some IDEs based on other users reporting directly to me (I haven't experienced it myself).
It seems a
WORKSPACE
snippet to set up gcc-toolchain is missing from the current documentation. It would be nice to include theWORKSPACE
snippet in documentation or the release page so that users can start using gcc-toolchain without troubles by copying theWORKSPACE
snippet into theirWORKSPACE
files.Based on this repo's
WORKSPACE
, below is an example of theWORKSPACE
snippet and.bazelrc
to use gcc-toolchain v0.4.2 to build binaries for x86_64. It would be great to confirm that there is something wrong or redundant with the snippet. I mentioned this because unusual configs,--action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
and--incompatible_enable_cc_toolchain_resolution
were required to add to.bazelrc
so that Bazel can use the C/C++ toolchain managed by gcc-toolchain. If these configs are required indeed, I think it worth noting it in the documentation because these configs not so obvious for non-Bazel experts.WORKSPACE
:.bazelrc
:The text was updated successfully, but these errors were encountered: