actions-rs / toolchain

🛠️ GitHub Action for `rustup` commands
https://github.com/marketplace/actions/rust-toolchain
MIT License
585 stars 86 forks source link

Requesting toolchain version 1.70 installs 1.7.0 #230

Open ydirson opened 11 months ago

ydirson commented 11 months ago

Description

After switching my action from install toolchain 1.66 to 1.70, what I actually get is 1.7.0 (and surprisingly he build fails). As a workaround requesting 1.70.0 works, but it's obviously not good, in case a 1.70.1 comes out.

Workflow code

https://github.com/xcp-ng/xcp-metrics/commit/51756943bb633ece8c5ebb398f2dad65d189308d

    steps:
    - uses: actions/checkout@v3
    - uses: actions-rs/toolchain@v1
      with:
-        toolchain: 1.66
+        toolchain: 1.70
        override: true

Action output

https://github.com/xcp-ng/xcp-metrics/actions/runs/6377565635/job/17306468710

Run actions-rs/toolchain@v1
/home/runner/.cargo/bin/rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/runner/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.72.1 (d5c2e9c34 2023-09-13)
/home/runner/.cargo/bin/rustup toolchain install 1.7
info: syncing channel updates for '1.7.0-x86_64-unknown-linux-gnu'
lambda-fairy commented 11 months ago

This is a feature of YAML, not a bug. 1.70 is parsed as the number 1.7.

The workaround is to wrap the string in quotes:

-        toolchain: 1.70
+        toolchain: '1.70'
ydirson commented 11 months ago

Arf, implicit stringification in a bad place. Should probably show examples with version numbers, not just stable and nightly, and put a bold note there.

(note I've started moving on to dtolnay/rut-toolchain as a maintained successor of this project)