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
rustc --version
?
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)
my best guess is to cargo clean and try again
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
switching to stable toolchain seems to have fixed it
ah, yeah, i have no idea what might break that with nightly, hopefully its just some temporary blip
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...
I think I've figured out what's going on here and I'm endeavouring to debug
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
Would it help to add a rust-toolchain.toml
file so contributors aren't broken by having the wrong version?
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
To close the loop here I believe that main
as-of now should be able to build on the latest nightly
Till Schneidereit has marked this topic as resolved.
Last updated: Dec 23 2024 at 13:07 UTC