> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genlabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Toolchain

> Rust version mismatches, stale RISC-V remnants, and gen genie build caching upstream changes.

<Accordion title="Rust version mismatch / no rust-toolchain.toml">
  Symptom: `cargo build` errors mention a stable feature gated on a newer
  compiler, or CI fails on a different Rust version than the workshop README
  specified. Sometimes the scaffolded project lacks a `rust-toolchain.toml` and
  inherits whatever Rust the host has.

  Fix: pin the toolchain explicitly at the repo root:

  ```toml theme={null}
  # rust-toolchain.toml
  [toolchain]
  channel = "1.83"          # match the version in the workshop README
  components = ["rust-src", "rustfmt", "clippy"]
  targets = ["riscv32im-unknown-none-elf"]
  ```

  `gen genie install-env --install` performs the install non-interactively if
  you're starting fresh.
</Accordion>

<Accordion title="Old RISC-V toolchain leftovers from a prior install">
  Symptom: opaque link / build errors that don't reproduce on a fresh machine.
  Cause: a previous `riscv32im-unknown-none-elf` toolchain from before the
  current pin, or stale `~/.cargo/registry` entries.

  Reset:

  ```bash theme={null}
  rustup target remove riscv32im-unknown-none-elf
  rustup target add    riscv32im-unknown-none-elf
  rm -rf ~/.cargo/registry/cache ~/.cargo/registry/index
  gen genie install-env --install
  ```
</Accordion>

<Accordion title="`cargo genie build` doesn't rebuild when shared crates change">
  Symptom: edits to a workspace-shared crate (e.g. a `lib*` you depend on)
  don't show up in the next contract build — old behavior persists. Cause:
  `gen genie build` caches per-contract artifacts under `<member>/artifacts/`
  and doesn't always detect upstream changes.

  Workaround: nuke the contract's artifacts dir and rebuild:

  ```bash theme={null}
  rm -rf my-token/my-token/artifacts
  gen genie build my-token
  ```
</Accordion>

<Note>
  Hit something not on this page? Send the failing command and the full error
  output to your Gen Labs contact — the page grows from real reports.
</Note>
