Skip to content

Commit 8a4d058

Browse files
committed
refactor: derive nightly toolchain from rust-toolchain.toml everywhere
Make rust-toolchain.toml the single source of truth for the pinned nightly version. All local tooling now reads from it: - justfile: parses channel from rust-toolchain.toml - local-validate.sh: parses channel from rust-toolchain.toml - Dockerfile: copies rust-toolchain.toml early and extracts channel - e2e scripts: use plain `cargo` (rust-toolchain.toml auto-applies) - CLAUDE.md, CONTRIBUTING.md, docs: reference rust-toolchain.toml CI workflows still declare NIGHTLY_TOOLCHAIN as an env var (required before checkout), annotated to keep in sync with rust-toolchain.toml.
1 parent 9ea3943 commit 8a4d058

14 files changed

Lines changed: 25 additions & 21 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permissions: {}
1616

1717
env:
1818
CARGO_TERM_COLOR: always
19+
# Must match rust-toolchain.toml (single source of truth for the nightly pin).
1920
NIGHTLY_TOOLCHAIN: nightly-2026-04-24
2021

2122
jobs:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ concurrency:
2424
permissions: {}
2525

2626
env:
27+
# Must match rust-toolchain.toml (single source of truth for the nightly pin).
2728
NIGHTLY_TOOLCHAIN: nightly-2026-04-24
2829
RELEASE_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run && 'true' || 'false' }}
2930
RELEASE_PRE_RELEASE: ${{ github.event_name == 'workflow_dispatch' && inputs.pre_release && 'true' || 'false' }}

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ avoid `waitForTimeout()`.
196196

197197
## Code Quality
198198

199-
- Never run `cargo fmt` on stable in this repo. Always use the pinned nightly rustfmt (`just format`, `just format-check`, or `cargo +nightly-2026-04-24 fmt ...`).
199+
- Never run `cargo fmt` on stable in this repo. Always use the pinned nightly rustfmt (`just format`, `just format-check`, or `cargo fmt` — `rust-toolchain.toml` selects the right nightly automatically).
200200

201201
```bash
202202
just format # Format Rust (pinned nightly)
@@ -314,11 +314,11 @@ Conventional commits: `feat|fix|docs|style|refactor|test|chore(scope): descripti
314314

315315
For incremental local edits before full validation:
316316
- TS/TSX changed: run `biome check --write` and `cd crates/web/ui && npm run build`.
317-
- Rust changed: run `cargo +nightly-2026-04-24 fmt --all -- --check`.
317+
- Rust changed: run `cargo fmt --all -- --check`.
318318
- Both changed: run all three.
319319

320320
Exact commands (must match `local-validate.sh`):
321-
- Fmt: `cargo +nightly-2026-04-24 fmt --all -- --check`
321+
- Fmt: `cargo fmt --all -- --check`
322322
- Clippy: `just lint` (OS-aware: on macOS excludes CUDA features, on Linux uses `--all-features`)
323323
- Tests: `just test` (OS-aware: on macOS uses nextest without CUDA features, on Linux uses `--all-features`)
324324
- macOS app (Darwin hosts): `./scripts/build-swift-bridge.sh && ./scripts/generate-swift-project.sh && ./scripts/lint-swift.sh && xcodebuild -project apps/macos/Moltis.xcodeproj -scheme Moltis -configuration Release -destination "platform=macOS" -derivedDataPath apps/macos/.derivedData-local-validate CODE_SIGNING_ALLOWED=NO build`

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For security issues, do not open a public issue. Follow `SECURITY.md` instead.
1717
Prerequisites:
1818

1919
- Rust toolchain (stable)
20-
- `rustup` with nightly `nightly-2026-04-24` available
20+
- `rustup` with the nightly pinned in `rust-toolchain.toml` available
2121
- `just` task runner
2222
- `git-cliff` changelog generator
2323
- Node.js (for web UI e2e tests)

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ FROM rust:bookworm AS builder
1515

1616
WORKDIR /build
1717

18-
# Switch to nightly (pinned for reproducibility; wacore-binary needs portable_simd)
19-
RUN rustup install nightly-2026-04-24 && rustup default nightly-2026-04-24
18+
# Copy rust-toolchain.toml first so the nightly pin is defined in one place.
19+
COPY rust-toolchain.toml ./
20+
RUN NIGHTLY="$(sed -nE 's/^channel[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' rust-toolchain.toml)" \
21+
&& rustup install "$NIGHTLY" && rustup default "$NIGHTLY"
2022
2123
# Copy manifests first for better caching
2224
COPY Cargo.toml Cargo.lock ./

crates/web/ui/e2e/start-gateway-ollama-qwen-live.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ OLLAMA_HOST="${OLLAMA_BIND}" OLLAMA_MODELS="${OLLAMA_MODELS_DIR}" ollama pull "$
169169
if [[ -n "${BINARY}" ]]; then
170170
"${BINARY}" --no-tls --bind 127.0.0.1 --port "${PORT}" &
171171
else
172-
cargo +nightly-2026-04-24 run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}" &
172+
cargo run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}" &
173173
fi
174174
GATEWAY_PID="$!"
175175
wait "${GATEWAY_PID}"

crates/web/ui/e2e/start-gateway-onboarding-anthropic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ fi
9292
if [ -n "${BINARY}" ]; then
9393
exec "${BINARY}" --no-tls --bind 127.0.0.1 --port "${PORT}"
9494
else
95-
exec cargo +nightly-2026-04-24 run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
95+
exec cargo run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
9696
fi

crates/web/ui/e2e/start-gateway-onboarding-auth.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ fi
6666
if [ -n "${BINARY}" ]; then
6767
exec "${BINARY}" --no-tls --bind 127.0.0.1 --port "${PORT}"
6868
else
69-
exec cargo +nightly-2026-04-24 run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
69+
exec cargo run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
7070
fi

crates/web/ui/e2e/start-gateway-onboarding.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ fi
6262
if [ -n "${BINARY}" ]; then
6363
exec "${BINARY}" --no-tls --bind 127.0.0.1 --port "${PORT}"
6464
else
65-
exec cargo +nightly-2026-04-24 run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
65+
exec cargo run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
6666
fi

crates/web/ui/e2e/start-gateway-openai-live.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,5 @@ fi
113113
if [ -n "${BINARY}" ]; then
114114
exec "${BINARY}" --no-tls --bind 127.0.0.1 --port "${PORT}"
115115
else
116-
exec cargo +nightly-2026-04-24 run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
116+
exec cargo run --bin moltis -- --no-tls --bind 127.0.0.1 --port "${PORT}"
117117
fi

0 commit comments

Comments
 (0)