-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support Python container example on MacOS #303
Comments
Quick update with my findings so far. By changing the following:
Also I'm not sure the |
I managed to reproduce the same error on a minimal example without rules_nixpkgs so I think this is a more general problem with rules_docker. Taking a step back, I'm not even sure how this is meant to work without a cross-compiler. The execution platform is I dug into the internals of Bazel a bit to build my understanding of how toolchain resolution works and confirm that the lack of a cross-compiler is the problem. The built-in debug info wasn't great so I added some extra print outs:
The above shows that two potential toolchains were checked and they targeted This could potentially be made to work with rules_nixpkgs if we can get Nix to build us an appropriate cross-compiler. |
Indeed, it looks like this requires a cross-compiler. That makes sense, as you describe.
True, I know nixpkgs has cross-compilation capabilities, but, I'm not sure how well MacOS is supported as a target. bazel-zig-cc can cross-compile to MacOS and the Zig compiler is based on LLVM/Clang. Perhaps a nixpkgs clang can be used for this purpose. If not, and if something like Zig is required instead, then this may well be considered out of scope for rules_nixpkgs. |
Is your feature request related to a problem? Please describe.
The Python container example does not currently work if it is built on MacOS.:
The problem seems to be that rules_docker requires a CC toolchain for Python images that fulfills the
run_in_container
constraint. However, simply adding that execution constraint to the Nix provided CC toolchain seems to be insufficient.Describe the solution you'd like
A setup of the Python container example that builds successfully on both a Linux and a MacOS host/exec OS.
The text was updated successfully, but these errors were encountered: