Skip to content
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

bazel: set BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 on Darwin #55582

Closed
wants to merge 1 commit into from

Conversation

kalbasit
Copy link
Member

Motivation for this change

This change fixes Bazel on Darwin machines.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@kalbasit
Copy link
Member Author

This did not seem to help with building bazel-watcher on Hydra. I believe this is still a good idea as every Bazel user on Darwin must set this variable manually to get it to work. @Profpatsch what do you think?

@Profpatsch
Copy link
Member

Can you point me to documentation about why that variable is necessary and in which cases it has to be set?

I’ve seen it in rules_haskell but the linked issue is not very enlightening.

@uri-canva
Copy link
Contributor

uri-canva commented Feb 19, 2019

It's not documented as far as I know, but you can see what it does in the source: https://github.com/bazelbuild/bazel/blob/71bc38fe2d165fe523b19d7879096d3fdd2086fc/tools/cpp/cc_configure.bzl#L54.

It switches between macOS specific and unix generic detection of the CPP toolchain.

I'm against setting this in the Bazel wrapper though: if someone installs Bazel via nix in a profile, it should be possible to use it outside of nix, with the Xcode or CLT toolchains.

I'd prefer having this set in buildBazelPackage.

@uri-canva
Copy link
Contributor

#56033

@kalbasit
Copy link
Member Author

closing in favor of #56033. Thanks, @uri-canva for your effort on this!

@kalbasit kalbasit closed this Feb 19, 2019
@kalbasit kalbasit deleted the nixpkgs_fix-bazel-on-darwin branch February 19, 2019 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants