Open vringar opened 1 month ago
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.
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?
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
?
A project I'm contributing to unfortunately has all their scripts do things like
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?