Toolchain version 1.70 is parsed as 1.7
Happens in this pr: https://github.com/tokio-rs/mio/pull/1806, workflow: https://github.com/tokio-rs/mio/actions/runs/9514447708/job/26226798660.
Relevant GitHub Action config:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70
Relevant part of the job logs:
Run : parse toolchain version
: parse toolchain version
if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
if [[ Linux == macOS ]]; then
echo "toolchain=1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" >> $GITHUB_OUTPUT
else
echo "toolchain=1.$((($(date --date "${toolchain#stable }" +%s)/60/60/24-16569)/7/6))" >> $GITHUB_OUTPUT
fi
elif [[ $toolchain =~ ^stable' 'minus' '[0-9]+' 'releases?$ ]]; then
echo "toolchain=1.$((($(date +%s)/60/60/24-16569)/7/6-${toolchain//[^0-9]/}))" >> $GITHUB_OUTPUT
else
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
fi
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
CI: true
toolchain: 1.7
A workaround for this is using 1.70.0, that seems to work ok.
I think this is because the YAML itself treated the data as numbers. You can fix it by quoting it in strings e.g. '1.70'.
That could be it, would explain why 1.70.0 also works.
It that case there is not much we can do to fix it. Maybe it's worth pointing out in the documentation?
See #91.
I think this is because the YAML itself treated the data as numbers. You can fix it by quoting it in strings e.g.
'1.70'.
Yes this is just the YAML Document from Hell strikes again...
You should quote all strings in YAML. It's good habit. Like tying your shoes so you don't fall face down in the sidewalk. Please tie your own YAML shoes.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.70"
The dark magic regex in #131 is not the proper way to fix this...