-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
bazel: fix the compilation of .proto on Darwin #63879
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
Conversation
@GrahamcOfBorg build bazel.tests |
@guibou @Profpatsch as you can see in the ofborg result, this works well on Linux but breaks on Darwin. This test replicates the environment that I run Bazel in my proprietary project. I can't see the full error here as it gets snipped, but on my project, I can see this (snipped unrelated args):
The issue is happening at the very last argument I'd love to figure out how to fix this and include this test in nixpkgs to help us determine the C/C++ environment for NixOS/Darwin. |
I just pushed a change enabling @GrahamcOfBorg build bazel.tests
|
89a948b
to
2eb1991
Compare
b3a32c5
to
564a711
Compare
@GrahamcOfBorg build bazel.tests |
564a711
to
ee68277
Compare
@GrahamcOfBorg build bazel.tests |
It turned out to be still broken for the EDIT: I'll merge this one without the java test and file a separate PR to deal with it. |
On Darwin, the last argument to GCC is coming up as an empty string. This is breaking the build of proto_library targets. However, I was not able to reproduce with the example cpp project[0]. This commit patches the cc_wrapper of Bazel that gets installed on Darwin to remove the last argument if it's an empty string. This is not a probem on Linux. [0]: https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage3
57a8d0f
to
a6650e2
Compare
@GrahamcOfBorg build bazel.tests |
Thanks, great work! It does look suspiciously like a bazel bug though, can you open an upstream issue? |
@kalbasit did you open an issue upstream? I don't see anything linked here… |
Motivation for this change
On Darwin, the last argument to GCC is coming up as an empty string. This is breaking the build of proto_library targets. However, I was not able to reproduce with the example cpp project.
This commit patches the cc_wrapper of Bazel that gets installed on
Darwin to remove the last argument if it's an empty string. This is
not a problem on Linux.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)cc @guibou @Profpatsch