bazelbuild / bazelbuild/rules_rust

bindgen_toolchain example fails with rules_cc 0.1.2

Open
#3,482 1 comment 1 reaction 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

It seems that `bindgen_toolchain` example doesn't work with latest `rules_cc` published on BCR on MacOS.

Everything works fine with rules_cc versions up to 0.1.1:

```
rules_rust/examples/bindgen_toolchain on  main [!?] on ☁️
✦ ❯ bazelisk build //test/integration:simple_bindgen
INFO: Analyzed target //test/integration:simple_bindgen (203 packages loaded, 5384 targets configured).
INFO: Found 1 target...
Target //test/integration:simple_bindgen up-to-date:
bazel-bin/test/integration/libsimple_bindgen-3348090008.rlib
INFO: Elapsed time: 45.921s, Critical Path: 42.62s
INFO: 315 processes: 139 internal, 176 darwin-sandbox.
INFO: Build completed successfully, 315 total actions
```

However once I updated `bazel_dep(name = "rules_cc", version = "0.1.2")`, it fails with:

```
NFO: Analyzed target //test/integration:simple_bindgen (204 packages loaded, 5388 targets configured).
ERROR: /private/var/tmp/_bazel_mpavlenko/68be9dfd15abd4f7b001bfb30d77f4cf/external/rules_rust+/util/process_wrapper/BUILD.bazel:31:36: Compiling Rust (without process_wrapper) bin process_wrapper (6 files) [for tool] failed: (Exit 1): bootstrap_process_wrapper.sh failed: error executing Rustc command (from target @@rules_rust+//util/process_wrapper:process_wrapper) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_rust+/util/process_wrapper/bootstrap_process_wrapper.sh -- ... (remaining 30 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error: linking with `external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh` failed: exit status: 127
|
= note: "external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh" "/var/folders/t7/l2nrr9l13mzd_rhl7vshtwrh0000gp/T/rustcLYKieA/symbols.o" "<17 object files omitted>" "/private/var/tmp/_bazel_mpavlenko/68be9dfd15abd4f7b001bfb30d77f4cf/execroot/_main/bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_rust++i+rules_rust_tinyjson/{libtinyjson-1317710085.rlib}.rlib" "/private/var/tmp/_bazel_mpavlenko/68be9dfd15abd4f7b001bfb30d77f4cf/external/rules_rust++rust+rust_macos_aarch64__aarch64-apple-darwin__stable_tools/lib/rustlib/aarch64-apple-darwin/lib/{libstd-b14eaf39f161baba.rlib,libpanic_unwind-e9afca0624de13f2.rlib,libobject-f4f25c763c07e1da.rlib,libmemchr-f5821a4757eb4967.rlib,libaddr2line-e2075fd42f8fdfe6.rlib,libgimli-08932eb7054dd262.rlib,librustc_demangle-ed8c67e97825d1a5.rlib,libstd_detect-1047965a55c74dd5.rlib,libhashbrown-a128e33792b49d56.rlib,librustc_std_workspace_alloc-9d142a7fc6a557ed.rlib,libminiz_oxide-b5c8cae15aefe652.rlib,libadler2-458be00c7580c8fb.rlib,libunwind-ebf825f8faf836bb.rlib,libcfg_if-c920e7cfad4eac40.rlib,liblibc-b046c3bdd2263ebf.rlib,liballoc-4320d4958ec5f4d4.rlib,librustc_std_workspace_core-8e246dbdcfd33251.rlib,libcore-c8c2fe5a80a1416e.rlib,libcompiler_builtins-78f29445e315e03f.rlib}.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/lib/rustlib/aarch64-apple-darwin/lib" "-o" "bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_rust+/util/process_wrapper/process_wrapper" "-Wl,-dead_strip" "-nodefaultlibs" "-mmacosx-version-min=15.5" "-no-canonical-prefixes" "-fobjc-link-runtime" "-headerpad_max_install_names" "-Wl,-dead_strip" "-lc++" "-lm"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: env: bash: No such file or directory

error: aborting due to 1 previous error
```

I was able to reproduce this problem on both Apple Silicon and Intel based Mac, with MacOS 15.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.