Examples

Rust toolchain ownership without duplicate runtime/tool drift

A focused Rust example that keeps Rustup, cargo, formatter, linter, and target ownership under one toolchain surface.

copynew usersbasicstable2026-05-30

Typical signals

  • the repo is Rust and currently splits the same truth across setup shell, runtimes, and tools
  • rustfmt, clippy, or cross targets should be contract truth instead of shell glue
  • you need one copyable example for the shipped toolchain ownership model before wider provider support exists

Why it matters

  • it turns a repo pattern into something humans, CI, and agents can read the same way
  • it makes the next command obvious instead of implied by README drift
  • it keeps readiness, setup, and execution explainable in receipts and diagnostics

Example contract

Use this when a Rust repo should treat Rust as one provider-backed ecosystem instead of repeating the same ownership across runtimes, tools, and setup scripts.

The example keeps toolchains.rust as the owner, lets Rustup manage components and targets, and still leaves truly standalone tools such as git under tools.

ota.yamlyaml
version: 1project:  name: rust-toolchain-flow  description: Focused example for Rust toolchain ownership without duplicate runtime or tool declarationstoolchains:  rust:    version: "1.94.0"    profile: minimal    components:      - rustfmt      - clippy    targets:      - x86_64-unknown-linux-musl    fulfillment:      source: rustup      mode: runtools:  git: "*"tasks:  setup:    prepare:      kind: dependency_hydration      medium: package_dependencies      source:        kind: cargo        cwd: .    requirements:      toolchains:        - rust    effects:      writes:        - target      network: true      network_kind: dependency_hydration  lint:    run: cargo fmt --check && cargo clippy --all-targets -- -D warnings    depends_on:      - setup    requirements:      toolchains:        - rust  test:    run: cargo test --all-targets    depends_on:      - lint    requirements:      toolchains:        - rust  release:tag:    run: git tag --list    depends_on:      - test    requirements:      toolchains:        - rust      tools:        git: "*"workflows:  default: contributor  contributor:    setup:      task: setup    run:      task: test  release:    setup:      task: setup    run:      task: release:tag

Task notes

Use ota doctor . and ota up --dry-run . first so you can see the selected Rust toolchain described through rustup rather than through duplicate runtimes.rust or tools.cargo declarations.

Use ota run release:tag . when you want to see the other side of the ownership boundary: the Rust ecosystem stays under toolchains.rust, but standalone git still stays under tools because the toolchain does not own it.