@@ -45,11 +45,17 @@ jobs:
45
45
os : macos-latest
46
46
- host_target : i686-pc-windows-msvc
47
47
os : windows-latest
48
+ - host_target : aarch64-pc-windows-msvc
49
+ os : windows-11-arm
48
50
runs-on : ${{ matrix.os }}
49
51
env :
50
52
HOST_TARGET : ${{ matrix.host_target }}
51
53
steps :
52
54
- uses : actions/checkout@v4
55
+ - name : apt update
56
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
57
+ # The runners seem to have outdated apt repos sometimes
58
+ run : sudo apt update
53
59
- name : install qemu
54
60
if : ${{ matrix.qemu }}
55
61
run : sudo apt install qemu-user qemu-user-binfmt
63
69
sudo apt update
64
70
# Install needed packages
65
71
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
72
+ - name : Install rustup on Windows ARM
73
+ if : ${{ matrix.os == 'windows-11-arm' }}
74
+ run : |
75
+ curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
76
+ ./rustup-init.exe -y --no-modify-path
77
+ echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
66
78
- uses : ./.github/workflows/setup
67
79
with :
68
80
toolchain_flags : " --host ${{ matrix.host_target }}"
@@ -147,35 +159,48 @@ jobs:
147
159
- uses : actions/checkout@v4
148
160
with :
149
161
fetch-depth : 256 # get a bit more of the history
150
- - name : install josh-proxy
151
- run : cargo +stable install josh-proxy --git https://github.com/josh-project /josh --tag r24.10.04
162
+ - name : install josh-sync
163
+ run : cargo +stable install --locked --git https://github.com/rust-lang /josh-sync
152
164
- name : setup bot git name and email
153
165
run : |
154
166
git config --global user.name 'The Miri Cronjob Bot'
155
167
git config --global user.email 'miri@cron.bot'
156
168
- name : Install nightly toolchain
157
169
run : rustup toolchain install nightly --profile minimal
158
- - name : get changes from rustc
159
- run : ./miri rustc-pull
160
170
- name : Install rustup-toolchain-install-master
161
171
run : cargo install -f rustup-toolchain-install-master
162
- - name : format changes (if any)
172
+ - name : Push changes to a branch and create PR
163
173
run : |
174
+ # Make it easier to see what happens.
175
+ set -x
176
+ # Temporarily disable early exit to examine the status code of rustc-josh-sync
177
+ set +e
178
+ rustc-josh-sync pull
179
+ exitcode=$?
180
+ set -e
181
+
182
+ # If there were no changes to pull, rustc-josh-sync returns status code 2.
183
+ # In that case, skip the rest of the job.
184
+ if [ $exitcode -eq 2 ]; then
185
+ echo "Nothing changed in rustc, skipping PR"
186
+ exit 0
187
+ elif [ $exitcode -ne 0 ]; then
188
+ # If return code was not 0 or 2, rustc-josh-sync actually failed
189
+ echo "error: rustc-josh-sync failed"
190
+ exit ${exitcode}
191
+ fi
192
+
193
+ # Format changes
164
194
./miri toolchain
165
195
./miri fmt --check || (./miri fmt && git commit -am "fmt")
166
- - name : Push changes to a branch and create PR
167
- run : |
168
- # `git diff --exit-code` "succeeds" if the diff is empty.
169
- if git diff --exit-code HEAD^; then echo "Nothing changed in rustc, skipping PR"; exit 0; fi
170
- # The diff is non-empty, create a PR.
196
+
197
+ # Create a PR
171
198
BRANCH="rustup-$(date -u +%Y-%m-%d)"
172
199
git switch -c $BRANCH
173
200
git push -u origin $BRANCH
174
201
gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge.'
175
202
env :
176
203
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
177
- ZULIP_BOT_EMAIL : ${{ secrets.ZULIP_BOT_EMAIL }}
178
- ZULIP_API_TOKEN : ${{ secrets.ZULIP_API_TOKEN }}
179
204
180
205
cron-fail-notify :
181
206
name : cronjob failure notification
@@ -198,7 +223,7 @@ jobs:
198
223
It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
199
224
200
225
This likely means that rustc changed the miri directory and
201
- we now need to do a [`./miri rustc-pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
226
+ we now need to do a [`rustc-josh-sync pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
202
227
203
228
Would you mind investigating this issue?
204
229
0 commit comments