Skip to content

bazel build //... fails on OSX #226

@johnedmonds

Description

@johnedmonds

Seems to be because xcode removed libstdc++ (and replaced it with libc++) but we still depend on it. Here's the full error message:

bazel build //...
INFO: Analysed 48 targets (110 packages loaded, 1680 targets configured).
INFO: Found 48 targets...
ERROR: /Users/jedmonds/rules_rust/tools/runfiles/BUILD:14:1: error executing shell command: '/bin/bash -c CARGO_MANIFEST_DIR=$(pwd)/tools/runfiles external/rust_darwin_x86_64/bin/rustc "$@" --remap-path-prefix="$(pwd)"=__bazel_redacted_pwd  tools/runfiles/runfiles.rs --crate-name=runfiles_...' failed (Exit 1) bash failed: error executing command /bin/bash -c 'CARGO_MANIFEST_DIR=$(pwd)/tools/runfiles external/rust_darwin_x86_64/bin/rustc "$@" --remap-path-prefix="$(pwd)"=__bazel_redacted_pwd' '' tools/runfiles/runfiles.rs ... (remaining 14 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
error: linking with `external/local_config_cc/cc_wrapper.sh` failed: exit code: 1
  |
  = note: "external/local_config_cc/cc_wrapper.sh" "-m64" "-L" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.0.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.1.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.10.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.11.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.12.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.13.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.14.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.15.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.2.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.3.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.4.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.5.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.6.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.7.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.8.rcgu.o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.runfiles_test.7rcbfp3g-cgu.9.rcgu.o" "-o" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test" "bazel-out/darwin-fastbuild/bin/tools/runfiles/runfiles_test.wsx61dhnteu5819.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libtest-049ef957f3c3bff3.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libterm-85376e998eb8d4cf.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-5b62a9453c560a5d.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libstd-d4fbe66ddea5f3ce.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-cb02f3c2aa14313b.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-b0895307a49d7b98.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libunwind-5751ec7e6e80fbea.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-136c67c44acb8989.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/liblibc-440e2779940c5e25.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/liballoc-089d48ff1bba5f70.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-9d6280dd79b180e2.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libcore-f948d62f596dcd3d.rlib" "/private/var/tmp/_bazel_jedmonds/35519b6885cd84f654acda1089b07add/external/rust_darwin_x86_64/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-35232c4af1148867.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-undefined" "dynamic_lookup" "-headerpad_max_install_names" "-lstdc++" "-lm"
  = note: ld: library not found for -lstdc++
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

INFO: Elapsed time: 2.644s, Critical Path: 0.85s
INFO: 1 process: 1 darwin-sandbox.
FAILED: Build did NOT complete successfully

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions