Skip to content

Conversation

ReenigneArcher
Copy link

@ReenigneArcher ReenigneArcher commented Jun 14, 2025

This PR adds a new input option to make installing cargo packages easier.

The inspiration for this was I planning to make my own setup-rust action after the https://github.com/dtolnay/rust-toolchain action doesn't respect a repository's toolchain file. I then found your action, which I was going to create a composite action around; but the only feature missing is to automatically install cargo packages. Hopefully this PR can be accepted and then I will not need to create a composite action around this. Thanks!

@jonasbb
Copy link
Member

jonasbb commented Jun 16, 2025

Thank you for the contribution. Can you please expand a bit on why this is desirable, compared to something like:

    steps:
      - uses: actions/checkout@v4
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - run: cargo install cargo-edit cargo-tarpaulin

I think in this case this simplifies everything too much. It is not uncommon to use --locked, enable feature flags, or use git dependencies. All these require feature flags that are not possible with this solution.

The "Install additional Cargo packages" step needs to be the last step of this composite action, after the caching step.

@robjtede
Copy link
Contributor

I feel like https://github.com/taiki-e/install-action fills this use case much better than we could here; it's a bit outside the scope of "setup-rust-toolchain" imo.

@ReenigneArcher
Copy link
Author

Can you please expand a bit on why this is desirable

It just simplifies the workflow, but definitely not a necessity. Although this action is not really necessary on github hosted runners these days either since they all now include rustup.

It is not uncommon to use --locked, enable feature flags, or use git dependencies. All these require feature flags that are not possible with this solution.

I'm not that familiar with the feature flags, but as long as they come after cargo install then technically you could pass in whatever flags or string you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants