Closed motiejus closed 2 years ago
Also seeing this issue on MacOS.
Unfortunately it consistently fails in my experience. The project just will not build when targeting MacOS with Zig. I assume this is because I'm building a large repository with lots of C, rather than just a single library.
Additionally, the proposed workaround in bazel-zig-cc does not work.
(12:53:27) ERROR: /private/var/tmp/_bazel_thomas/b6a3c999aae05297a54a9aa13d7a50c3/external/rules_rust/util/process_wrapper/BUILD.bazel:3:10: Linking external/rules_rust/util/process_wrapper/process_wrapper failed: (Exit 1): c++ failed: error executing command /private/var/tmp/_bazel_thomas/b6a3c999aae05297a54a9aa13d7a50c3/external/zig_sdk/tools/c++ -o bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_rust/util/process_wrapper/process_wrapper ... (remaining 6 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
warning: unsupported linker arg: -S
error: FileNotFound
(12:54:30) ERROR: /private/var/tmp/_bazel_thomas/b6a3c999aae05297a54a9aa13d7a50c3/external/rules_rust/util/process_wrapper/BUILD.bazel:3:10: Linking external/rules_rust/util/process_wrapper/process_wrapper failed: (Exit 1): c++ failed: error executing command /private/var/tmp/_bazel_thomas/b6a3c999aae05297a54a9aa13d7a50c3/external/zig_sdk/tools/c++ -o bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_rust/util/process_wrapper/process_wrapper ... (remaining 6 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
WARNING: flock not found, proceeding unsafely.
If build fails, retry it.
warning: unsupported l
It might be important to note that this build works when targeting Linux with Zig (without flock!), and works with the local cc toolchain on MacOS.
@motiejus I'm trying to investigate it but after doing a clear clone, everything works fine on my end. That said, you don't seem to have committed .envrc
file, so I might not be reproducing it right.
@uhthomas any chance you could provide a clonable repro?
@kubkon I don't think this is a macos issue, I think it's a duplicate of #9836, #9439, #5292. Not 100% sure though. I think the next step is to fix those and then see if this issue still exists.
@motiejus I'm trying to investigate it but after doing a clear clone, everything works fine on my end. That said, you don't seem to have committed
.envrc
file, so I might not be reproducing it right.
Strange: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/.envrc
Though I didn't add cd bazel-zig-cc
to the original instructions; will do so after I publish this response.
@kubkon I don't think this is a macos issue, I think it's a duplicate of #9836, #9439, #5292. Not 100% sure though. I think the next step is to fix those and then see if this issue still exists.
This is not OSX-specific. I keep hitting into this at least once a week on Linux, but OSX has been the easiest to reproduce.
I can reliably reproduce it in our CI environment though (worked 100% of the time so far), but we run a lot of tests there on many different hosts/shards.
I am 99.9% sure this is a duplicate to #9439, thus will close now. @andrewrk thanks for pointing to the other ones.
I get a
FileNotFound
error when compiling a Go project using Bazel on MacOS. Specifically Bazel is interesting, because it invokeszig c++
in parallel.Full execution output when compiling this program:
Execution output:
To reproduce (on macos x86_64, requires direnv to be installed):
Note that it fails only the first time; subsequent executions compile the file successfully, no matter which caches I try to prune (strange, advice appreciated).
I have the full build directory with the artifacts from this build, and can upload any requested files for further inspection.