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

Add functionality to use MSRV from rust-version field #70

Closed
KamilaBorowska opened this issue Feb 13, 2023 · 4 comments
Closed

Add functionality to use MSRV from rust-version field #70

KamilaBorowska opened this issue Feb 13, 2023 · 4 comments

Comments

@KamilaBorowska
Copy link

It would be useful if rust-toolchain could use whatever version is provided in rust-version field in Cargo.toml. For example, it could look like this:

- uses: dtolnay/rust-toolchain@msrv
  working-directory: project-within-workspace
@dtolnay
Copy link
Owner

dtolnay commented Feb 13, 2023

I would prefer not to support this.

@dtolnay dtolnay closed this as completed Feb 13, 2023
@alerque
Copy link

alerque commented Jun 7, 2023

Can we ask why or for a re-consider? Obviously this might not be the default, but having some option to use the MSRV toolchain specified in the Cargo would add some consistency to CI runs that specifically test whether the named MSRV is working. Having to maintain the same version in two places to test it is not ideal. For example I just saw this come up here:

typst/typst#1402 (comment)

csnover added a commit to csnover/binrw that referenced this issue Sep 23, 2023
Everything in actions-rs seems to be abandoned so also switching
to the dtolnay/rust-toolchain action, but per
dtolnay/rust-toolchain#70 apparently it will not support getting
MSRV directly so currently that is duplicated in CI, which is not
ideal but whatever.
csnover added a commit to csnover/binrw that referenced this issue Sep 23, 2023
Everything in actions-rs seems to be abandoned so also switching
to the dtolnay/rust-toolchain action, but per
dtolnay/rust-toolchain#70 apparently it will not support getting
MSRV directly so currently that is duplicated in CI, which is not
ideal but whatever.
csnover added a commit to csnover/binrw that referenced this issue Sep 23, 2023
Everything in actions-rs seems to be abandoned so also switching
to the dtolnay/rust-toolchain action, but per
dtolnay/rust-toolchain#70 apparently it will not support getting
MSRV directly so currently that is duplicated in CI, which is not
ideal but whatever.

Refs jam1garner#224.
@tamird
Copy link

tamird commented Nov 7, 2023

A reasonable workaround:

      - name: Read crate metadata
        id: metadata
        run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT

      - name: Install Rust
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ steps.metadata.outputs.rust-version }}

@nyurik
Copy link

nyurik commented Dec 12, 2023

I agree that this is seems like a needed feature - the action supports more exotic things like stable 18 months ago, but not a simpler feature like MSRV?

@dtolnay are there any specific reason you are thinking of that I don't see? Thanks for all the hard work! :)

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

5 participants