Closed hawkw closed 2 months ago
Yes I think we could just accept true
for the existing rust_toolchain
property instead of a string, and have that do whatever rustup
usually does as much as possible with the toolchain files.
I have implemented support for rust_toolchain = true
in ccaf3cdfe68a63d7edb057e38dfe0460cd769f7f, which is now live. From the updated documentation:
It is also possible to use the boolean value
true
here, at which point the system will interpret the contents of therust-toolchain.toml
file in the root of the repository to decide what to install. The file must contain a validchannel
value, and may also contain a validprofile
value. Neither the legacy (pre-TOML) file format, nor TOML files which contain thepath
directive, are supported.#: rust_toolchain = true
Currently, a Buildomat job can have a
rust_toolchain = <string>
configuration key to install Rustup and the specified toolchain. Many projects use arust-toolchain.toml
file to specify the Rust version and additional components that should be used to build the repo. However, a project which has arust-toolchain.toml
must duplicate the toolchain version in any Buildomat jobs it defines which require Rust to be present. It would be nice to be able to use the toolchain file as a single source of truth, so that changing the toolchain version only requires changingrust-toolchain.toml
For instance, see: https://github.com/oxidecomputer/hubris/pull/1748#discussion_r1566003910If I understand correctly, the presence of the
rust-toolchain =
configuration is also what tells Buildomat that a job requiresrustup
at all. Therefore, I think we probably want to specify that the toolchain file should be used using either a new value (e.g.rust-toolchain = "file:rust-toolchain.toml"
) or a new config (mayberust-toolchain-file = "rust-toolchain.toml"
or something?). This way, we can still avoid installing Rustup for builds that don't need it.I'd be happy to have a go at implementing this, potentially.