Stream: wasmtime

Topic: ✔ "failed to reduce input adapter module to its minimal s...


view this post on Zulip kmeakin (Aug 05 2024 at 20:26):

I'm trying to run ./ci/run-tests.sh so I can reproduce the CI failures on https://github.com/bytecodealliance/wasmtime/pull/9074 locally. But I'm getting:

error: failed to run custom build command for `test-programs-artifacts v0.0.0 (/home/karl/git/third-party/wasmtime/crates/test-programs/artifacts)`

Caused by:
  process didn't exit successfully: `/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-7b1fbb6ef30a3cfe/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=../../wasi-preview1-component-adapter
  wasi reactor adapter: "/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out/wasi_snapshot_preview1.reactor.wasm"
  cargo:rerun-if-changed=../../wasi-preview1-component-adapter
  wasi command adapter: "/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out/wasi_snapshot_preview1.command.wasm"
  cargo:rerun-if-changed=../../wasi-preview1-component-adapter
  wasi proxy adapter: "/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out/wasi_snapshot_preview1.proxy.wasm"
  cargo:rerun-if-changed=../src
  creating a component from "/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out/wasm32-wasip1/debug/api_proxy.wasm"

  --- stderr
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown"
     Compiling wasi-preview1-component-adapter v25.0.0 (/home/karl/git/third-party/wasmtime/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 1.98s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown" "--no-default-features" "--features=command"
     Compiling wasi-preview1-component-adapter v25.0.0 (/home/karl/git/third-party/wasmtime/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 1.98s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_TARGET_DIR="/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out" RUSTFLAGS="" "cargo" "build" "--release" "--package=wasi-preview1-component-adapter" "--target=wasm32-unknown-unknown" "--no-default-features" "--features=proxy"
     Compiling wasi-preview1-component-adapter v25.0.0 (/home/karl/git/third-party/wasmtime/crates/wasi-preview1-component-adapter)
      Finished `release` profile [optimized] target(s) in 1.18s
  running: env -u CARGO_ENCODED_RUSTFLAGS CARGO_PROFILE_DEV_DEBUG="2" CARGO_TARGET_DIR="/home/karl/git/third-party/wasmtime/target/debug/build/test-programs-artifacts-8b6599c0f6cb2865/out" RUSTFLAGS="" "cargo" "build" "--target=wasm32-wasip1" "--package=test-programs"
      Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
  thread 'main' panicked at crates/test-programs/artifacts/build.rs:175:10:
  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 found in adapter module
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is with a fresh clone of the repo

This is a second attempt of #6219, but this time only includes rewrites that are obviously beneficial by reducing number of instructions

view this post on Zulip Pat Hickey (Aug 05 2024 at 21:13):

rustc --version?

view this post on Zulip Pat Hickey (Aug 05 2024 at 21:21):

i checked out your branch locally and cant reproduce with rust 1.80 on mac aarch64 (host architecture almost certainly shouldnt matter for this part of the build, since its a cross build)

view this post on Zulip Pat Hickey (Aug 05 2024 at 21:21):

my best guess is to cargo clean and try again

view this post on Zulip kmeakin (Aug 05 2024 at 22:03):

rustc --version --verbose
rustc 1.82.0-nightly (176e54520 2024-08-04)
binary: rustc
commit-hash: 176e5452095444815207be02c16de0b1487a1b53
commit-date: 2024-08-04
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0

view this post on Zulip kmeakin (Aug 05 2024 at 22:10):

switching to stable toolchain seems to have fixed it

view this post on Zulip Pat Hickey (Aug 05 2024 at 23:15):

ah, yeah, i have no idea what might break that with nightly, hopefully its just some temporary blip

view this post on Zulip Pat Hickey (Aug 05 2024 at 23:17):

unfortunately, the adapter is some of the gnarliest code we have, it uses various shenanigains and sleights of hand so that rustc/llvm produces a wasm binary that doesnt have any const data, and it wouldnt shock me if llvm got smart enough to see through some of those tricks...

view this post on Zulip Alex Crichton (Aug 06 2024 at 07:24):

I think I've figured out what's going on here and I'm endeavouring to debug

view this post on Zulip Alex Crichton (Aug 06 2024 at 13:05):

looks like this is a regression from https://github.com/llvm/llvm-project/commit/ba3c1f9ce30cf4f8aee5f1961df74d65e11d53bc which first got into rust with llvm 19 which happened relatively recently in nightly

…a (#81539) In WebAssembly, we have `WASM_SYMBOL_NO_STRIP` symbol flag to mark the referenced content as retained. However, the flag is not enough to express retained data that is not referenced...

view this post on Zulip kmeakin (Aug 07 2024 at 22:47):

Would it help to add a rust-toolchain.toml file so contributors aren't broken by having the wrong version?

view this post on Zulip Alex Crichton (Aug 09 2024 at 18:03):

I've opened https://github.com/bytecodealliance/wit-bindgen/pull/1021 to solve this, personally I'd prefer to not do rust-toolchain.toml, I'll leave a comment on the PR

This is not needed for the wasi_snapshot_preview1 adapter in Wasmtime and is causing issues with LLVM 19, so add an option to turn it off which will be enabled in Wasmtime.

view this post on Zulip Alex Crichton (Aug 12 2024 at 21:29):

To close the loop here I believe that main as-of now should be able to build on the latest nightly

view this post on Zulip Notification Bot (Sep 09 2024 at 12:18):

Till Schneidereit has marked this topic as resolved.


Last updated: Dec 23 2024 at 13:07 UTC