Skip to content

Commit 41e999a

Browse files
committed
Tooling: move rust-toolchain.toml to the workspace root
`apps/desktop/rust-toolchain.toml` was only in scope when rustup/cargo was invoked from inside `apps/desktop/`. That broke for the workspace's other two members (`crates/fsevent-stream`, `crates/index-query`) — they've been silently using whatever default toolchain rustup happened to have installed, not the pinned 1.95.0. And it broke the release workflow yesterday (`db58ff6b`'s build failed because the repo-root `rustup target add x86_64-apple-darwin` step touched a different toolchain than `pnpm tauri build` did inside `apps/desktop/`). The workspace `Cargo.toml` already lives at the repo root, `target/` already lives at the repo root, and rustup expects the toolchain pin next to the workspace `Cargo.toml`. Moving the file there makes the whole tree see a single, consistent toolchain regardless of which directory you `cd` into. - `git mv apps/desktop/rust-toolchain.toml ./rust-toolchain.toml`. Comment in the file updated to reflect the new location (no longer needs the "release.yml runs from repo root" footnote). - `release.yml`: drop the standalone `rustup target add x86_64-apple-darwin` step. The pinned channel now declares both targets, so rustup auto-syncs them the first time it resolves the toolchain. One source of truth. - `ci.yml` paths-filter: the `rust:` group's only Rust-trigger paths were `apps/desktop/src-tauri/**` and the old `apps/desktop/rust-toolchain.toml`. Broaden to also catch `crates/**`, the workspace `Cargo.toml` / `Cargo.lock`, and the new `rust-toolchain.toml` at root — any of those affect Rust builds and should fire the Rust job. Verified: `rustup show active-toolchain` resolves to `1.95.0-…(overridden by /Users/.../rust-toolchain.toml)` from the repo root AND from `crates/fsevent-stream/` (which previously got `stable` or whatever the user had).
1 parent 4b99a40 commit 41e999a

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ jobs:
3737
filters: |
3838
rust:
3939
- 'apps/desktop/src-tauri/**'
40-
- 'apps/desktop/rust-toolchain.toml'
40+
- 'crates/**'
41+
- 'Cargo.toml'
42+
- 'Cargo.lock'
43+
- 'rust-toolchain.toml'
4144
svelte:
4245
- 'apps/desktop/src/**'
4346
- 'apps/desktop/static/**'

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242
run: pnpm exec svelte-kit sync
4343
working-directory: ./apps/desktop
4444

45-
- name: Install x86_64 Rust target
46-
if: matrix.arch != 'aarch64'
47-
run: rustup target add x86_64-apple-darwin
48-
4945
- name: Import Apple certificate
5046
env:
5147
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ channel = "1.95.0"
99
# the runner picks them up automatically — without this, every CI Rust job
1010
# fails at the rustfmt step.
1111
components = ["rustfmt", "clippy"]
12-
# Release builds need both targets for the universal binary, and the standalone
13-
# `rustup target add x86_64-apple-darwin` step in `release.yml` runs from the
14-
# repo root (not `apps/desktop`), so it adds the target to a *different*
15-
# toolchain than the pinned channel `pnpm tauri build` actually uses. Declaring
16-
# the targets here makes rustup sync them with the pinned channel automatically.
12+
# Release builds the universal binary from both arch targets, so the pinned
13+
# channel needs both available. Listing them here makes rustup auto-sync them
14+
# the first time the toolchain is resolved; no separate `rustup target add`
15+
# step is needed in CI.
1716
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]

0 commit comments

Comments
 (0)