Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to copy wasm binary using target wasm32-wasip1 when using Rust 1.81 #1317

Open
GeeWee opened this issue Sep 17, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@GeeWee
Copy link

GeeWee commented Sep 17, 2024

Version

Fastly CLI version v10.14.1 (b3926881)
Built with go version go1.22.7 linux/amd64 (2024-09-17)
Viceroy version: viceroy 0.12.0

What happened

Rust has recently renamed it's wasi target from wasm32-wasi to wasm32-wasip1.

Using the old name is starting to generate warnings in Rust 1.81.

I am unable to upgrade the target, as I get the following error:

ERROR: failed to copy wasm binary: cannot read source file: /Users/gustavwengel/programming/edge-api/target/wasm32-wasi/release/edge-api.wasm.

which makes sense, as the binary is now in target/wasm32-wasip1/...

Full command output:

$ fastly compute build --verbose
Fastly API endpoint: https://api.fastly.com

✓ Verifying fastly.toml

INFO: Failed to lookup wasm-tools binary in user $PATH. We'll attempt to locate it inside a Fastly CLI
managed directory.

INFO: wasm-tools is installed but the CLI config (`fastly config`) shows the TTL, checking for a newer
version, hasn't expired.

✓ Identifying package name
✓ Identifying toolchain

INFO: Creating ./bin directory (for Wasm binary)

Command output for 'cargo locate-project --quiet': {"root":"/Users/gustavwengel/programming/edge-api/edge-api/Cargo.toml"}

INFO: The Fastly CLI requires a Rust version '>= 1.56.1'.

Build script to execute:
	sh -c cargo build --bin edge-api --release --target wasm32-wasip1 --color always

INFO: Command output:
--------------------------------------------------------------------------------
    Finished `release` profile [optimized] target(s) in 0.40s
--------------------------------------------------------------------------------

✓ Running [scripts.build]

ERROR: failed to copy wasm binary: cannot read source file: /Users/gustavwengel/programming/edge-api/target/wasm32-wasi/release/edge-api.wasm.

Here are some steps you can follow to debug the issue:

- Re-run the fastly command with the --verbose flag to see more information.
- Is the required language toolchain (node/npm, rust/cargo etc) installed correctly?
- Is the required version (if any) of the language toolchain installed/activated?
- Were the required dependencies (package.json, Cargo.toml etc) installed?
- Did the build script (see fastly.toml [scripts.build]) produce a ./bin/main.wasm binary file?
- Was there a configured [scripts.post_build] step that needs to be double-checked?
@GeeWee GeeWee added the bug Something isn't working label Sep 17, 2024
@kpfleming
Copy link
Contributor

Indeed, we're aware of this name change but haven't had time to review all of the places throughout the build process which will need to be updated. Thanks for reporting it!

@kpfleming kpfleming changed the title Rust build failure: Failed to copy wasm binary using target wasm32-wasip1 Failed to copy wasm binary using target wasm32-wasip1 when using Rust 1.81 Sep 23, 2024
@GeeWee
Copy link
Author

GeeWee commented Sep 24, 2024

My pleasure! Would be wonderful to get some sort of timeline, as we generally have an environment where we can't build/deploy anything that generates warnings, which means we can't update our Rust version currently as there doesn't seem to be any way to silence the target rename warning.

@kpfleming
Copy link
Contributor

That's understandable; we don't have a timeline to provide right now, but realistically it will be a couple of months before we've identified all of the places in our Compute workflows that are affected by the platform name and are ready for customers to begin using wasm32-wasip1.

@GeeWee
Copy link
Author

GeeWee commented Sep 24, 2024

Okay, good to know! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants