spinframework / spinframework/spin

Add toolchain hint heuristics on `spin new`

Open
#1,257 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/CLI enhancement
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

Each language has its own toolchain setup requirements. Ideally we could handle these seamlessly for developers, but until we can figure that out we should try to give more guidance to reduce frustration.

The most obvious example is skipping rustup target add wasm32-wasi, which while documented in the quickstart guide is easy to miss/forget. It would be great if we could detect this situation and print a helpful message at one or more of these points:

  • spin new - look for a Cargo.toml in the template?
  • spin build - on failure, look for cargo.*wasm32-wasi in a component.build.command?
  • spin up - on failure, look for target/wasm32-wasi in the source

In any of these cases we could use the existing check from build.rs: https://github.com/fermyon/spin/blob/60976e41231820ba6b3c4d6e0391814b459c7628/build.rs#L84-L94

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing toolchain check in build.rs and compare it with the quickstart guide's rustup target add wasm32-wasi requirement. Then inspect the proposed spin new, spin build, and spin up points and determine where the missing-target hint should appear; done means the relevant failure or template case produces helpful guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
cli, developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.