Skip to content

Rust toolchain references system WASI SDK linker #163

@avrabe

Description

@avrabe

Problem

The Rust toolchain () references a system-installed WASI SDK linker:

--codegen=link-arg=-fuse-ld=/usr/local/wasi-sdk/bin/ld64.lld

Discovered in: @@rules_rust+//util/process_wrapper:process_wrapper

Discovery

Comprehensive hermiticity test revealed:

./tools/hermetic_test/comprehensive_test.sh
# Found in //examples/basic:hello_component

Impact

  • Build depends on system WASI SDK installation
  • Affects all Rust WASM targets
  • Not hermetic for users of these rules

Root Cause

rules_rust is picking up system linker flags, possibly from:

  1. Environment variables (RUSTFLAGS, CARGO_BUILD_TARGET_*_LINKER)
  2. System rustc configuration
  3. Default cc toolchain configuration

Investigation Needed

  • Determine where rules_rust gets these linker flags
  • Configure Rust toolchain to use hermetic WASI SDK from Bazel
  • Ensure environment isolation in rules_rust actions

Related

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