`compute build` can validate the wrong `cargo`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- build-system, cli
Research direction
Start at the fastly compute build entry point and its preflight/toolchain validation, then reproduce the issue with the provided cargo, rustc, rustup, and PATH commands. Done means Homebrew's shadowing cargo is detected before compilation and the user receives actionable guidance when the selected toolchain lacks wasm32-wasip1.
Written by the indexing model from the issue text.
Description
Version
Fastly CLI version v16.0.0 (Homebrew)
Built with go version go1.26.5 darwin/arm64 (2026-08-27)
Viceroy version: viceroy 0.20.1
macOS 26.6.2, Homebrew 6.0.19
What happened
I used homebrew to install both rust and rustup on my machine. I have wasm32-wasip1 installed, but homebrew's rust and cargo shadows the rustup version. When I init a new compute service the preflight check detects wasm32-wasip1 and passes, and the build fails ~20 crates in with unhelpful advice that won't fix the issue.
In a clean directory I ran:
$ fastly compute init --non-interactive --language rust \
--from https://github.com/fastly/compute-starter-kit-rust-default
$ fastly compute build
Result:
✓ Verifying fastly.toml
✓ Identifying package name
✓ Identifying toolchain
✗ Running [scripts.build]
INFO: Command output:
--------------------------------------------------------------------------------
Compiling proc-macro2 v1.0.106
... ~20 more crates ...
error[E0463]: can't find crate for `core`
= note: the `wasm32-wasip1` target may not be installed
= help: consider downloading the target with `rustup target add wasm32-wasip1`
error[E0463]: can't find crate for `std`
= note: the `wasm32-wasip1` target may not be installed
= help: consider downloading the target with `rustup target add wasm32-wasip1`
error: could not compile `itoa` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `stable_deref_trait` (lib) due to 1 previous error
... 5 more `could not compile` lines ...
--------------------------------------------------------------------------------
ERROR: error during execution process (see 'command output' above): exit status 101.
Expected
I suppose I expected that it would init without an error, but after figuring out the PATH shadowing I'd be happy with a preflight check and an actionable error.
Investigation
The target is installed in rustup:
$ rustup target list --installed
aarch64-apple-darwin
wasm32-wasip1
$ rustup target add wasm32-wasip1
info: component rust-std for target wasm32-wasip1 is up to date
So I look at the rest of the environment to see which version of rust / cargo / the toolchain I'm running.
$ command -v cargo rustc
/opt/homebrew/bin/cargo
/opt/homebrew/bin/rustc
$ cargo --version
cargo 1.97.1 (c980f4866 2026-06-30) (Homebrew)
$ rustup which cargo
/Users/lonnen/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo
$ echo "$PATH" | tr ":" '\n'
...
/Users/lonnen/.cargo/bin
/opt/homebrew/bin
/opt/homebrew/sbin
...
- Dominant language
- Go
- Stars
- 164
- Forks
- 80
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fastly/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug feature request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100