Update CI to use Rust 1.93 toolchain for all targets
Add guidance on toolchain consistency to SKILL.md and ensure `cargo build` uses the correct toolchain in release workflow.
Seto Elkahfi committed
Mar 28, 2026 at 21:01 UTC
e2cfa025d4d5b55bf17d72315d61e002c12c62a9
2 files changed
+27
-6
.agents/skills/smbcloud-cli-release/SKILL.md
+21
@@ -136,6 +136,27 @@ Do not pass `NODE_AUTH_TOKEN` to `npm publish` when using trusted publishing.
136
137
The npm CLI detects the GitHub OIDC environment automatically and exchanges it for a short-lived publish credential.
138
139
+### Rust toolchain consistency
140
+
141
+When cross-compiling in CI, the Rust toolchain used for `rustup target add` must match the toolchain used by `cargo build`.
142
+
143
+For this repo, check `rust-toolchain.toml` first and keep the workflow matrix aligned with it.
144
+
145
+If the workflow installs a target for one toolchain but Cargo builds with another, CI can fail with:
146
+
147
+- `error[E0463]: can't find crate for core`
148
+- note that the target may not be installed
149
+
150
+This can happen even when `rustup target add <target>` already ran successfully.
151
+
152
+Preferred pattern:
153
+
154
+- install the requested toolchain explicitly
155
+- run `rustup target add <target> --toolchain <toolchain>`
156
+- run `cargo +<toolchain> build --target <target>`
157
+
158
+Do not rely on plain `cargo build` if the repo pin in `rust-toolchain.toml` can differ from the matrix toolchain version.
159
+
160
### Trusted publisher command
161
162
For this repo, the trust relationship should point at:
.github/workflows/release-npm.yml
+6
-6
@@ -31,7 +31,7 @@ jobs:
31
- {
32
NAME: linux-x64-glibc,
33
OS: ubuntu-20.04,
34
- TOOLCHAIN: 1.92,
34
+ TOOLCHAIN: 1.93,
35
TARGET: x86_64-unknown-linux-gnu,
36
}
37
# Cannot cross-compile for now
@@ -44,25 +44,25 @@ jobs:
44
- {
45
NAME: win32-x64-msvc,
46
OS: windows-2022,
47
- TOOLCHAIN: 1.92,
47
+ TOOLCHAIN: 1.93,
48
TARGET: x86_64-pc-windows-msvc,
49
}
50
- {
51
NAME: win32-arm64-msvc,
52
OS: windows-2022,
53
- TOOLCHAIN: 1.92,
53
+ TOOLCHAIN: 1.93,
54
TARGET: aarch64-pc-windows-msvc,
55
}
56
- {
57
NAME: darwin-x64,
58
OS: macos-11,
59
- TOOLCHAIN: 1.92,
59
+ TOOLCHAIN: 1.93,
60
TARGET: x86_64-apple-darwin,
61
}
62
- {
63
NAME: darwin-arm64,
64
OS: macos-11,
65
- TOOLCHAIN: 1.92,
65
+ TOOLCHAIN: 1.93,
66
TARGET: aarch64-apple-darwin,
67
}
68
steps:
@@ -104,7 +104,7 @@ jobs:
104
GH_OAUTH_REDIRECT_URI: ${{ secrets.GH_OAUTH_REDIRECT_URI }}
105
shell: bash
106
run: |
107
- cargo build --release --locked --target ${{ matrix.build.TARGET }}
107
+ cargo +${{ matrix.build.TOOLCHAIN }} build --release --locked --target ${{ matrix.build.TARGET }}
108
109
- name: Install node
110
uses: actions/setup-node@v6