-
Notifications
You must be signed in to change notification settings - Fork 894
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
Create official Rust setup GitHub Action? #3409
Comments
I don't think this is necessary because, as visible in the rust-lang/rust-analyzer repository, |
I think we have a lot of history out there as things have evolved over time, and now Rustup is definitely in the official runner images: https://github.com/search?q=repo%3Aactions%2Frunner-images%20rustup&type=code even though it is not documented in their README today. Perhaps getting |
@jcbhmr as an experienced Rust maintainer, just wanted to say that I'm seeing all the repositories I'm participating in migrate to dtolnay/rust-toolchain. |
@djc Yup, I'm using @dtolnay's workflow as well since I know it's becoming the "de facto" option. However, I do wonder where my knowledge of this comes from, since something is clearly missing, otherwise @jcbhmr should also know about it... Or it needs some more promotion in a certain way? |
@djc @rami3l The action it you're referring to: https://github.com/dtolnay/rust-toolchain as you mentioned it becoming the "de facto": a beginner like me has no idea what the de facto is because its not really listed anywhere... when you search https://www.google.com/search?q=rust+github+actions you get @actions-rs, not the https://github.com/dtolnay/rust-toolchain. imo the best-case scenario here is one of:
👆 all that is from the perspective of a user who is completely oblivious to the complicated people-problems or other management issues with accomplishing any of those tasks from a more conscientious perspective, you mentioned more promotion: maybe on https://rustup.rs or some other official installation place? this could go a ways to cementing a particular action as the recommended one. |
@jcbhmr Discoverability issues are indeed easier to be identified by newcomers like you, thanks a lot for your detailed feedback! |
@dawnofmidnight @rbtcollins you mentioned that even other smaller projects like oras are included in the github runner images https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#cli-toolsbut still provide things like https://github.com/oras-project/setup-oras to make version pinning configuration etc. easier. i guess what I'm saying is there's a lot of convention around having official-ish setup actions. deno has one https://github.com/denoland/setup-deno even though its just a slightly off topic: to provide an example of a community project becoming official https://github.com/denolib/setup-deno became the official deno action https://github.com/denoland/setup-deno! its happened! just pointing that out 🤣 |
I need an action to setup Rust as well because sometimes my actions happen in a custom Docker image. FWIW I found out the thread that led me to dtolnay's workflow: actions-rs/toolchain#221. I'd been happily using @action-rs' one for quite a while until it didn't work anymore. |
@rami3l OTOH you could build your custom Docker image to have rustup already installed, as part of giving it parity with github runners, no? ( @jcbhmr I use https://github.com/marketplace/actions/rust-cache with many projects, because the caching glue is very nice and hard to replicate. I think the actions-rs org showed that there are many interesting actions (and more outside that org too - see the awesome-list present in the org). The salient questions are:
I don't have a strong view on the first one - on the one hand I'm skeptical of centralising things just-because, but on the other hand discoverability is indeed a challenge sometimes. On the second one though, there is a very clear answer: 'no'. Github requires dedicated repositories for actions published to their marketplace. So, this bug cannot be fixed here, ever. Making a new repository and all of that is also out of scope for the I suggest reaching out to the infra team and discuss with them, if you decide to drive such a project. I'm ok with leaving this bug open a little while as a place for you-all to coordinate, but longer term it needs to be transferred to a more appropriate repo, or closed. |
I'm not sure why we need a Perhaps users are seeking a more powerful feature that allows them to enable caching with a simple
The difference is github action runner install |
To be more specific about what's missing from "just use rustup its already there":
👆 those are the problems that a rust-lang/setup-rust should solve 😉 along with a bunch of other multi-line command features being collapsed into a single YAML
|
Annotations is another big feature that a rust action could provide. |
Hey, I found this issue thanks to Reddit. I suggested there to consider moving actions-rust-lang/setup-rust-toolchain under the official At the very least docs that people go to when installing rust could promote this action. |
FWIW @Manishearth is considering the option of creating a separate team for maintaining official GitHub Actions: We could definitely use some help in this respect, so feel free to chime in if you're interested! |
The previously used actions from actions-rs seem to be no longer maintained. Following the discussion in rust-lang/rustup#3409, this is one way to go.
The previously used actions from actions-rs seem to be no longer maintained. Following the discussion in rust-lang/rustup#3409, this is one way to go.
There were recently a lot of hiccups with installing rustup for Windows in CI and the previously used actions from actions-rs seem to be no longer maintained. Following the discussion in rust-lang/rustup#3409, this is one way to go.
There were recently a lot of hiccups with installing rustup for Windows in CI and the previously used actions from actions-rs seem to be no longer maintained. Following the discussion in rust-lang/rustup#3409, this is one way to go.
In CI, we are currently using `actions-rs` variant of steps. [They are pretty deprecated.](https://github.com/actions-rs) This resolves these, which I noticed during #186's [actions run](https://github.com/testcontainers/testcontainers-rs-modules-community/actions/runs/10481678682?pr=186): ![image](https://github.com/user-attachments/assets/26f6a040-314e-4183-bec9-0b0a03701b32) There are a ton of options avaliable, maybe even a `rust-lang`-action rust-lang/rustup#3409 Currently, that is not the case. (open to alternatives if you prefer another one more ^^) > [!NOTE] > This is not without downside as replacing `uses: actions-rs/cargo` with `run: cargo ...` does not come with the annotations that github displays f. ex. here from another repo where I recently also contributed this: > ![image](https://github.com/user-attachments/assets/6b61c970-800d-4489-8433-bd5df44bc5fa) > Said annotation would still be shown, but only as a test failour and not inline.. I have also added the nightly rustfmt part ^^
I think it is still worthwhile having a setup-rust action. The primary reason is that on GHES you cannot assume that your runner has rustup installed. It would be nice to have a way to setup rust on a self-hosted runner similar to what setup-python does. That is, download & install Python if it is not installed yet, setup the proper environment variables, etc. The nice thing about setup-python is that you can put a github.com on a GHES repo and the workflows typically runs out of the box. Plus, I find it a lot more consistent and trustworthy to have an official action called actions/setup-rust instead of some action on some unknown user account. |
Problem you are trying to solve
There's a lot of different Rust setup actions on GitHub Actions Marketplace:
https://github.com/marketplace?type=actions&query=setup+rust+
This dilutes the "truly good" ones because there's no well-known "good" one. The @actions-rs -- the most comprehensive org with the most users it seemed -- lead maintainer seems to be no longer active, and there's not really a good "best choice" replacement that I could find.
In short, the ecosystem is splintered. This is bad for beginners like me who just want to install the latest Rust version. (can you tell I'm a bit miffed? 🤣) Similar to how Deno has an official https://github.com/denoland/setup-deno action and Ruby has https://github.com/ruby/setup-ruby and so on, I think that some kind of setup-rust action would be a good idea.
I don't know if this is the right place to suggest such a thing, but I figured: hey, it's worth a shot!
Solution you'd like
If nothing else and this idea is out-of-scope for maintenance reasons, I'd at least like to see some kind of documentation pointer to 1 or 2 recommended GitHub Actions on maybe https://rustup.rs/ (cause that's where you go to install rust, right?) or maybe somewhere else? idk
If it's possible, you might also be able to convince @actions 👈 the https://github.com/actions org to add a setup-rust action. idk about that tho, that's even more far-fetched than a @rust-lang/setup-rust action...
I think it would be in the realm of plausibility to ask one of the various action authors 👆 from that big list (or even more than one of you could politically manage it) to bring the best action under the @rust-lang umbrella. That might actually be the most practical idea? 🤔 Or maybe not idk.
Notes
Sorry if I'm asking about this in the wrong place. Or if this idea is vastly out of scope. I just really think that having one good way to do this very common thing is a good idea.
Heck, even some of the @rust-lang repositories have this same issue! 😱
https://github.com/rust-lang/libc/blob/fab4a56f7265333f25bd6484784865c7bf513efa/.github/workflows/main.yml#L24-L29
And there's 90+ matches for a search of "rustup" used in GitHub Actions for @rust-lang: https://github.com/search?q=org%3Arust-lang+rustup+%28path%3A.github%2Fworkflows%2F*.yml+OR+path%3A.github%2Fworkflows%2F*.yaml%29&type=code
👆 this is the kinda thing that I'd love for an official @rust-lang/setup-rust or @rust-lang/setup-rustup or something action to solve.
The text was updated successfully, but these errors were encountered: