Skip to content

Commit ea9af77

Browse files
committed
fix: resolve Rust hermiticity issue with rules_cc fork (Issue #163)
## Solution Use fork with auto_detect parameter to disable system C++ toolchain detection. ## Changes 1. Added git_override to use avrabe/rules_cc fork with fix - Commit: 7215331f9e53f80070dc01c4a95a0f9c53ea477b - Branch: feature/optional-cc-toolchain-auto-detect 2. Configured cc_configure with auto_detect = False - Prevents /usr/local/wasi-sdk from being detected - Generates empty toolchain instead of system paths ## Test Results ✅ Build successful (605 processes) ✅ Hermiticity test PASSED (401 actions analyzed, 0 issues) ✅ No system paths in generated toolchain config ✅ No /usr/local/wasi-sdk references ## Before vs After Before: - 86 hermiticity issues - Hardcoded system WASI SDK linker paths - 43 suspicious tool references After: - 0 hermiticity issues - All tools from Bazel cache - Empty toolchain config (no system detection) ## Upstream This uses the fork temporarily until PR is accepted upstream: - Fork: https://github.com/avrabe/rules_cc - RFC: avrabe/rules_cc#1 - Verified: #163 Closes #163
1 parent 4cda2ff commit ea9af77

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

MODULE.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ bazel_dep(name = "platforms", version = "1.0.0")
1313
bazel_dep(name = "rules_cc", version = "0.2.4")
1414
bazel_dep(name = "rules_go", version = "0.57.0")
1515

16+
# Test optional auto-detection control (Issue #163)
17+
git_override(
18+
module_name = "rules_cc",
19+
remote = "https://github.com/avrabe/rules_cc.git",
20+
commit = "7215331f9e53f80070dc01c4a95a0f9c53ea477b",
21+
)
22+
1623
# OCI image signing capabilities
1724
bazel_dep(name = "rules_oci", version = "1.8.0")
1825

@@ -99,6 +106,12 @@ wasi_sdk.register(
99106
)
100107
use_repo(wasi_sdk, "wasi_sdk")
101108

109+
# Configure cc_configure to disable auto-detection (Issue #163)
110+
# This prevents system WASI SDK at /usr/local/wasi-sdk from being detected
111+
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
112+
cc_configure.configure(auto_detect = False)
113+
use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains")
114+
102115
# Register both WASI SDK and C++ toolchains
103116
register_toolchains(
104117
"@wasi_sdk//:wasi_sdk_toolchain",

0 commit comments

Comments
 (0)