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

Maybe provide wrapper to strip out rustup commands #189

Open
vringar opened this issue Oct 6, 2024 · 3 comments
Open

Maybe provide wrapper to strip out rustup commands #189

vringar opened this issue Oct 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@vringar
Copy link

vringar commented Oct 6, 2024

A project I'm contributing to unfortunately has all their scripts do things like

cargo +nightly fmt
cargo +nightly clippy

and while that's useful outside a nix managed environment it leads to me carrying a patchset just to be able to contribute.

Do you think a "fake rustup" that strips out and ignores these args before calling the real tools would be in scope for this project?

@oxalica oxalica added the enhancement New feature or request label Oct 6, 2024
@oxalica
Copy link
Owner

oxalica commented Oct 6, 2024

I think it's a good idea but I'm not sure if we should do this by default. Ignoring the toolchain argument can be very surprising and can cause hidden incorrect behavior for scripts, when it's not clearly the user's intention.

@vringar
Copy link
Author

vringar commented Oct 6, 2024

Definitely shouldn't be the default!
For rustup they note here and I think in some other blog post as well, that having high startup time in this proxy can significantly increase compilation time.
I don't have a code base to measure this with, but does that mean the wrapper should also be written in Rust or do you think a shell script would do?

@TheNeikos
Copy link

I think that this could be done in a way to not break these scripts by generating this wrapper once, and using something simple like a bash case to switch between the versions.

I'd think something like:

rust-bin.generateWrapperFor stable-1-80 [nightly, stable-1-82, beta-1-75]

And it would generate a script with a case for each of those versions, and run the first argument if the first argument is not a +version?

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

No branches or pull requests

3 participants