Skip to content

Commit d9d70c9

Browse files
committed
fix: enable C++ toolchain auto-configuration for Rust binaries
Fixed the cc_configure extension name and added .bazelrc to enable --incompatible_enable_cc_toolchain_resolution. This matches the rules_wasm_component configuration and enables proper C++ toolchain detection for rust_binary targets like wasm_embed_aot. Changes: - Fixed cc_configure extension name in MODULE.bazel - Added .bazelrc with C++ toolchain resolution enabled - Simplified release workflow AOT build command
1 parent 79aab6e commit d9d70c9

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,8 @@ jobs:
7474
7575
# Build the component with embedded AOT artifacts
7676
echo "Embedding AOT artifacts as custom sections..."
77-
# Configure C++ toolchain environment for Rust binary compilation
78-
export CC=/usr/bin/gcc
79-
export CXX=/usr/bin/g++
80-
bazel build //tinygo:file_ops_component_aot \
81-
--repo_env=CC=/usr/bin/gcc \
82-
--repo_env=CXX=/usr/bin/g++ \
83-
--action_env=CC=/usr/bin/gcc \
84-
--action_env=CXX=/usr/bin/g++
77+
# Enable C++ toolchain resolution (requires cc_configure in MODULE.bazel)
78+
bazel build //tinygo:file_ops_component_aot
8579
8680
# Copy to a predictable location
8781
cp bazel-bin/tinygo/file_ops_component_aot.wasm ./file_ops_component_aot.wasm

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bazel_dep(name = "rules_cc", version = "0.2.4")
1919
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2020

2121
# Enable C++ toolchain auto-configuration for cross-platform support
22-
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
22+
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure")
2323
use_repo(cc_configure, "local_config_cc")
2424

2525
# Add compatibility proxy repository for rules_cc 0.2.0 (required for bzlmod)

0 commit comments

Comments
 (0)