-
Notifications
You must be signed in to change notification settings - Fork 892
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
Allow specifying a custom toolchain in rust-toolchain
?
#2458
Comments
Nominally this is semi-supported by the |
Signed-off-by: Daniel Silverstone (WSL2) <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone (WSL2) <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone (WSL2) <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This would come in extremely handy for me as well, though for a fairly different use-case. In my case, I have a larger build system that sometimes needs to "fiddle some bits" before One way I've tried to hack around this problem is to tell users to install a custom system-wide toolchain that's really just a thing wrapper around the default toolchain, and which invokes the "fiddle" part of the main build system when necessary before forwarding to cargo. That approach works ok, but it a) requires that users know about and install this system-wide toolchain, and b) it's now a non-local configuration for building projects, which can make debugging build problems harder. But, with this feature, we could do much better. The first time you run the build system, it could set up a |
@jonhoo That's a really interesting use-case for this approach. I was wondering what value a path based rust-toolchain file might be wrt. checked in files; but as part of a wider build system that makes a huge amount of sense. If you wanted to adopt the WIP PR I have and take it further toward something mergeable then I'd be super-grateful. I trust you to find the corner cases I've not thought of yet. For now, you could have your build system set up the 'fiddling' toolchain itself and pop a rust-toolchain file down for that as part of the startup of the build system, to save your users having to know what to do. It also sounds like perhaps having a path based |
@kinnison I'd be happy to pick up the PR! Could you give me a rough idea of the state-of-affairs, next steps, and remaining/unresolved bits?
This gets tricky quickly, since IIUC the toolchains are all global (well, user-global). But the user might have tons of packages checked out locally, potentially using different versions of the build system that may want to use slightly different wrappers. I could have the build system generate a randomly named toolchain, but then we're generating garbage in the user's configuration over time, which doesn't sound right either. That's why I'm so excited by the prospect of a project-local toolchain.
I'm not sure why that would be necessary? Is creating the |
I think your use-case does indeed warrant the So the work I did is in #2471 and in that, Jubilee had a really good point that currently In my PR, I talked about thinking that Given that, I'd suggest that a good step would be (a) to remove support for the single-line rust-toolchain variant from the patch (which is in the Once that is all done, it'll be a case of updating the rustup book to explain the functionality, and we'll be good for review. I am happy to close my draft PR in favour of one you open, should you feel you still want to get this done. (Of course, if you want, you can ignore the work I already did, and just build from fresh if you have a better idea of how to go about it, I'm very not precious about the WIP code I hacked together 😁 ) |
Thanks! PR up in #2678 :) |
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
A project at work uses prebuilt toolchain binaries from internal infrastructure. We currently provide instructions on how to link that location with rustup for use with cargo and other tools. Ideally we'd be able to specify that relationship in version control and have rustup 'just work' when run within our directory tree.
I see that TOML support in the
rust-toolchain
file was recently merged (super exciting for other reasons too!) and I'm wondering whether it could be used to specify a "local" custom toolchain for a repository. Maybe something like this?The text was updated successfully, but these errors were encountered: