Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolchain version 1.70 is parsed as 1.7 #112

Open
Thomasdezeeuw opened this issue Jun 14, 2024 · 4 comments
Open

Toolchain version 1.70 is parsed as 1.7 #112

Thomasdezeeuw opened this issue Jun 14, 2024 · 4 comments

Comments

@Thomasdezeeuw
Copy link

Happens in this pr: tokio-rs/mio#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
@Thomasdezeeuw
Copy link
Author

A workaround for this is using 1.70.0, that seems to work ok.

@willnode
Copy link

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'.

@Thomasdezeeuw
Copy link
Author

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?

@wackbyte
Copy link

See #91.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants