Skip to content

Commit 5ce385c

Browse files
committed
fix: add use_repo for local_config_cc to enable C++ toolchains
The key fix for C++ toolchain resolution was adding: - use_repo(cc_configure, "local_config_cc") This ensures @local_config_cc repository is available for building Rust binaries that require C++ linking, resolving the persistent 'No matching toolchains found for @@bazel_tools//tools/cpp:toolchain_type' error.
1 parent 5b16979 commit 5ce385c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

MODULE.bazel

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ wasi_sdk.register(
107107
)
108108
use_repo(wasi_sdk, "wasi_sdk")
109109

110-
# Register both WASI SDK and C++ toolchains
110+
# Enable C++ toolchain auto-configuration for cross-platform support
111+
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure")
112+
use_repo(cc_configure, "local_config_cc")
113+
114+
# Register both WASI SDK and C++ toolchains
111115
register_toolchains(
112116
"@wasi_sdk//:wasi_sdk_toolchain",
113117
"@wasi_sdk//:cc_toolchain",
114-
"@bazel_tools//tools/cpp:all", # Default host C++ toolchains for Rust binaries
115118
)
116119

117120
# TinyGo WASI Preview 2 toolchain

0 commit comments

Comments
 (0)