Skip to content

spel init produces a scaffold that does not build out of the box #140

Description

@vpavlin

Summary

Running `spel init ` in a fresh directory, then `make build` immediately, fails with unrelated-looking errors. Two independent problems stack:

  1. Stale default `--spel-tag`. `spel-cli/src/init.rs:287` pins `spel-framework` to `tag = "v0.2.0-rc.1"`. That tag's `spel-framework/Cargo.toml` resolves `nssa_core` via `rev = "ffcbc15972adbf557939bf3e2852af276422631b"`, but the scaffold's own Cargo.toml pins `nssa_core = { tag = "v0.2.0-rc1" }` (no dot, and a strictly newer commit — `35d8df0`). Both end up in the build tree, and `#[lez_program]` macro expansion fails with type mismatches like:

    ```
    error[E0061]: this function takes 5 arguments but 3 arguments were supplied
    --> #[lez_program] macro expansion
    expected [u32; 8], found Vec
    argument Support dynamic/arg-based PDA seeds #2 of type Option<[u32; 8]> is missing
    ```

    Subsequent spel rc tags (`v0.2.0-rc.2`, `v0.2.0-rc.3`) fix this by pinning `nssa_core = { tag = "v0.2.0-rc1" }` — matching the scaffold's pin. Note that the final `v0.2.0` GA tag regresses to the `ffcbc15` rev, so the right default to bump to is `v0.2.0-rc.3`, not GA.

  2. `ruint@1.18.0` MSRV clash. The RISC-Zero docker image `cargo risczero build` uses ships rustc 1.88.0-dev. `ruint@1.18.0` (transitive via `risc0-binfmt → risc0-build → risc0-zkvm`) now requires rustc 1.90. The user sees:

    ```
    error: rustc 1.88.0-dev is not supported by the following package:
    ruint@1.18.0 requires rustc 1.90
    ```

    Workaround: `cargo update -p ruint --precise 1.17.0 --manifest-path methods/guest/Cargo.toml` before `make build`. Neither the scaffold nor any doc mentions this.

Repro

```bash
spel init demo
cd demo
make build # fails with ruint MSRV error

cargo update -p ruint --precise 1.17.0 --manifest-path methods/guest/Cargo.toml
make build # fails with two-nssa_core errors from #[lez_program]
```

With `spel init --spel-rev refs/heads/main demo` the second failure goes away (main has the aligned pin). With `--spel-tag v0.2.0-rc.3` it should also go away.

Proposed fix

  • Bump the default `spel_ref` in `spel-cli/src/init.rs` from `tag = "v0.2.0-rc.1"` to `tag = "v0.2.0-rc.3"`.
  • Pin `ruint` in the scaffolded `methods/guest/Cargo.toml` (or note the `cargo update` workaround in the scaffolded README) until the RISC-Zero docker image picks up a newer rustc. Alternatively, patch the scaffolded lockfile with `[patch.crates-io] ruint = …` so users don't have to know about it.

Impact

The tutorial (docs/tutorial.md) says "Step 1: `spel init my-counter`, Step 4: `make build`". Today that fails on a clean machine without any hint that the defaults need changing. Found during the tutorial walk that produced #138.

cc @fryorcraken

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions