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
buildBazelPackage: autodetect nix toolchain instead of Xcode one on macOS #56033
Conversation
Please build |
@uri-canva does this work for you now for building bazel-watcher on Darwin? @GrahamcOfBorg build bazel-watcher tensorflow bazel-deps |
|
looks like bazel-deps has failed. Can you try it locally if it fails for you for this PR? What about on master? I would try it myself, but I'm currently at a hotel with a very bad connection :(
|
Yeah I noticed, that's broken by the Bazel update on master: https://hydra.nixos.org/job/nixpkgs/trunk/bazel-deps.x86_64-linux, we can't test this PR on that. |
Oh sorry you're right, the failure is actually different, I will have a look. |
Ok, tested it locally, the failure I get is the same on this branch as it is on master, so I think it's ok. We can't verify on hydra because it doesn't have a log. |
@uri-canva Fair enough, we'll let Hydra test it out once we merge it down. Can you please address my comment I left inline and I'll wait for ofborg to test it out on Darwin before I merge. |
f8aa2a4
to
c46e186
Compare
Added comments. |
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.
LGTM
@GrahamcOfBorg build bazel-watcher |
host_linkopts+=( "--host_linkopt=$flag" ) | ||
done | ||
|
||
BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 \ |
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.
Does this work on Linux?
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.
This is a no-op on Linux. See it in the source code here.
|
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.
Given that bazel-deps is both broken for Linux on master and 18.09, I think it's safe to merge this as an incremental improvement. If anyone wants a working Linux build they will have to do it themselves.
@uri-canva While meddling with Tensorflow I noticed that the code that adds flags from environment variables isn't really needed - for example |
Nevermind, I found out this is because Nix hacks are disabled for some packages. Instead of this I propose:
|
The nix hacks disable the environment sanitisation logic in Bazel, which means Bazel will reuse cached results regardless of whether they used environment variables that changed in the meantime or not. That should be ok as long as we never use Bazel to cache outputs within nix, which is a reasonable assumption since we would be using the nix store to cache outputs anyway. |
Motivation for this change
Certain derivations fail to build with sandboxing enabled, depending on how Xcode / CLT are configured and installed. See #55991.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)fixes #55991