Skip to content

wit-component wasi-preview1-component-adapter build fails on Rust 1.93: unsupported start section in adapter #2425

@ricochet

Description

@ricochet

I am seeing build failures when building the wasmtime adapter with rust 1.93. If I pin to 1.91, the build succeeds. The area where I think a potentail fix lies is in wit-component if we do something like strip _start or allow it in adapter modules.

This is something that we will want fixed eventually, but note this adapter today isn't supported at rust 1.93. Wasmtime's current policy is that this number can be no larger than the current stable release of Rust minus 2, so 1.91 is the correct pinned version.

  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/Users/bhayes/repos/wasmCloud/wash/target/debug/build/test-programs-artifacts-aee33c52f663b55d/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown"
     Compiling wasi-preview1-component-adapter v38.0.4 (/Users/bhayes/.cargo/git/checkouts/wasmtime-ae46461068d65b15/4c22e15/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 1.79s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/Users/bhayes/repos/wasmCloud/wash/target/debug/build/test-programs-artifacts-aee33c52f663b55d/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown" "--no-default-features" "--features=command"
     Compiling wasi-preview1-component-adapter v38.0.4 (/Users/bhayes/.cargo/git/checkouts/wasmtime-ae46461068d65b15/4c22e15/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 2.22s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/Users/bhayes/repos/wasmCloud/wash/target/debug/build/test-programs-artifacts-aee33c52f663b55d/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown" "--no-default-features" "--features=proxy"
     Compiling wasi-preview1-component-adapter v38.0.4 (/Users/bhayes/.cargo/git/checkouts/wasmtime-ae46461068d65b15/4c22e15/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 1.32s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_PROFILE_DEV_DEBUG="2" CARGO_TARGET_DIR="/Users/bhayes/repos/wasmCloud/wash/target/debug/build/test-programs-artifacts-aee33c52f663b55d/out" RUSTFLAGS="" "cargo" "build" "--target=wasm32-wasip1" "--package=test-programs"
      Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.67s

  thread 'main' (174215226) panicked at /Users/bhayes/.cargo/git/checkouts/wasmtime-ae46461068d65b15/4c22e15/crates/test-programs/artifacts/build.rs:234:14:
  module can be translated to a component: failed to decode world from module

  Caused by:
      0: failed to reduce input adapter module to its minimal size
      1: unsupported section `8` in adapter
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

The error unsupported section '8' in adapter indicates the adapter module now contains a start section (WebAssembly section ID 8) when built with Rust 1.93. The wit-component crate doesn't support a start section in adapter modules.

The wasm exception handling in LLVM may be emitting initialization code (via a start function) that wasn't present before for wasm32-unknown-unknown targets.

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