Skip to content

Rust toolchain mismatch: building for wasm32-wasip1 instead of wasm32-wasip2 #2

@avrabe

Description

@avrabe

Summary

The build is failing because the Rust toolchain is configured for wasm32-wasip1 but the platform transition expects wasm32-wasip2.

Error

ERROR: /private/var/tmp/_bazel_r/1ca65a983d68290a99a9611f71f46bcb/external/rules_rust++rust+rust_macos_aarch64__wasm32-wasip1__stable_tools/BUILD.bazel:97:15: Linking external/rules_rust++rust+rust_macos_aarch64__wasm32-wasip1__stable_tools/librust_toolchain.a failed: (Exit 1): true failed: error executing CppArchive command (from target @@rules_rust++rust+rust_macos_aarch64__wasm32-wasip1__stable_tools//:rust_toolchain) /bin/true rcsD bazel-out/darwin_arm64-fastbuild-ST-805526428602/bin/external/rules_rust++rust+rust_macos_aarch64__wasm32-wasip1__stable_tools/librust_toolchain.a ... (remaining 2 arguments skipped)

src/main/tools/process-wrapper-legacy.cc:80: "execvp(/bin/true, ...)": No such file or directory

Problem Analysis

  1. Platform transition in rust/transitions.bzl line 6 sets: "//command_line_option:platforms": "//platforms:wasm32-wasip2"
  2. Common constants in common/common.bzl line 4 defines: WASM_TARGET_TRIPLE = "wasm32-wasip2"
  3. But actual build shows: wasm32-wasip1 in the error path

Expected Behavior

The Rust toolchain should be configured for wasm32-wasip2 to match the platform definitions.

Steps to Reproduce

  1. Use rust_wasm_component_bindgen in a BUILD file
  2. Build the target: bazel build //path/to:target
  3. Build fails with wasm32-wasip1 toolchain error

Environment

  • Bazel 8.3.1
  • rules_wasm_component commit: f151bef
  • Platform: macOS ARM64
  • rules_rust: via MODULE.bazel dependencies

Potential Fix

The platform definitions in //platforms:wasm32-wasip2 may need to be updated to properly configure the Rust toolchain for wasip2 instead of wasip1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions