Skip to content

Commit c9dc097

Browse files
committed
tests: cargo clean before checking stubs compile
1.59.0-beta.6 (0426998f5 2022-02-02) runs into an internal compiler error unless we do this. (This has been reported to rustc in rust-lang/rust#93131) It may be a good idea to keep this `clean` in the long term anyway, so as to ensure that nothing from the "Check exercises" step unduly affects the "Ensure stubs compile" step.
1 parent 518a07e commit c9dc097

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ jobs:
123123
run: ./_test/check_exercises.sh
124124
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}
125125

126+
- name: Cargo clean (to prevent previous compilation from unintentionally interfering with later ones)
127+
run: ./_test/cargo_clean_all.sh
128+
126129
- name: Ensure stubs compile
127130
env:
128131
DENYWARNINGS: ${{ matrix.deny_warnings }}

_test/cargo_clean_all.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
status=0
4+
repo="$(cd "$(dirname "$0")/.." && pwd)"
5+
6+
for ex in "$repo"/exercises/*/*/; do
7+
name=$(grep '^name =' "$ex/Cargo.toml" | cut -d\" -f2)
8+
if [ -z "$name" ]; then
9+
echo "don't know name of $ex"
10+
status=1
11+
continue
12+
fi
13+
cargo clean --manifest-path "$ex/Cargo.toml" --package "$name"
14+
done
15+
16+
exit $status

0 commit comments

Comments
 (0)