Skip to content

Commit df9ad71

Browse files
committed
ci: repair macOS Rust shims and bump runners to macos-15
1 parent 9340a82 commit df9ad71

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/build-tools.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- platform: unknown-linux-gnu
1818
runner: ubuntu-22.04
1919
- platform: apple-darwin
20-
runner: macos-14
20+
runner: macos-15
2121
exclude:
2222
- platform: pc-windows-msvc
2323
arch: aarch64
@@ -97,7 +97,7 @@ jobs:
9797
- platform: pc-windows-msvc
9898
runner: windows-2022
9999
- platform: apple-darwin
100-
runner: macos-14
100+
runner: macos-15
101101
exclude:
102102
- platform: pc-windows-msvc
103103
arch: aarch64

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
$Platforms += 'macos'
8383
8484
$Platforms | ForEach-Object {
85-
$Runner = switch ($_) { 'windows' { 'windows-2022' } 'macos' { 'macos-14' } 'linux' { 'ubuntu-22.04' } }
85+
$Runner = switch ($_) { 'windows' { 'windows-2022' } 'macos' { 'macos-15' } 'linux' { 'ubuntu-22.04' } }
8686
foreach ($Arch in $Archs) {
8787
$Jobs += @{
8888
arch = $Arch
@@ -324,10 +324,25 @@ jobs:
324324
rustup target add aarch64-pc-windows-msvc
325325
shell: pwsh
326326

327+
# The macos-15 runner image ships `cargo`, `rustc`, etc. in ~/.cargo/bin as
328+
# symlinks to Homebrew's `rustup-init`, which is a shell-script wrapper that
329+
# only dispatches on the `rustup`/`rustup-init` names (not on `cargo`/`rustc`/
330+
# `clippy`). Invoking `cargo` therefore runs `rustup-init` and fails with
331+
# "unexpected argument 'build'". The official rustup installer lays down proper
332+
# multi-call hard-link shims, so we run it to repair ~/.cargo/bin.
333+
- name: Repair Rust shims (macOS)
334+
if: ${{ matrix.os == 'macos' }}
335+
run: |
336+
set -eux
337+
rm -rf "$HOME/.cargo/bin"
338+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
339+
| bash -s -- -y --default-toolchain none --no-modify-path --profile minimal
340+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
341+
shell: bash
342+
327343
- name: Configure macOS (intel) runner
328344
if: ${{ matrix.os == 'macos' && matrix.arch == 'x64' }}
329345
run: |
330-
sudo rm -rf /Library/Developer/CommandLineTools
331346
rustup target add x86_64-apple-darwin
332347
333348
- name: Build

0 commit comments

Comments
 (0)