-
Notifications
You must be signed in to change notification settings - Fork 12
Switch L2 images to use Debian Backports instead of Rustup #52
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
base: trunk/l2
Are you sure you want to change the base?
Conversation
| export RUSTUP_HOME="/rustup" | ||
| export CARGO_HOME="/cargo" | ||
| mkosi-chroot rustup toolchain install $RUST_VERSION | ||
| mkosi-chroot rustup default $RUST_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questoin:
how can we control which version of rust is being used for builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to update rustc/cargo to the latest version, you can update the timestamp in l2/_op_rbuilder/mkosi.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessarily to the latest, but to an arbitrary one. preferably not via some timestamp, but by just specifying the version itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust is significantly better than other languages when it comes to backwards compatibility. for example, when i worked at repl.it, we had to upgrade the machines that hundreds of thousands of active, paying users were using to compile their software without breaking anything. so, we had complex mechanisms to pin compiler toolchains to specific versions for every language except rust, since with rust, the latest version always has better compatibility than some specific version. they have maintained the strict invariant in their compiler than anything that works on some version of rust will always work on subsequent versions, and they gone through great lengths to have not ever have broken that rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust might be absolutely best at backwards compatibility, but that won't rule out people factor.
in situations when something doesn't work quite as expected inside one or another of our rust dependencies, I don't want to end up in discussions with the maintainers of said dependency that go along the lines of: "our official build uses rust XXX but you guys use version XXX+N, maybe that's why. can you try using XXX and then report back to us?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can guarantee you no competent rust engineer would say this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're curious why i'm so confident in my opinion on this, you can read the following blog post by one of the leaders of Rust, specifically the section on stability: https://blog.m-ou.se/rust-standard/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with all due respect, I don't think anyone on this planet can speak for all 100% of the competent rust engineers population.
but apart from the subjectivities above, what exactly are we winning with the presented change?
The new Debian-backports rust versions:
These changes:
To update rustc/cargo to the latest version for a particular image, you only need to update the Debian repo timestamp for the image's root config file (e.g. the timestamp in
l2/_op_rbuilder/mkosi.conf). Rust maintains best-in-class backwards compatibility, which means granularity of specific rust versions are unnecessary. Updating to the latest version based on timestamp should always be sufficient.The only functional change of this PR to the L2 VM is that it changes the rust version to match the latest version available in the Debian backports as of the timestamp specified in
l2/mkosi.conf(2025/10/30), but I've verified that all the Rust software used by the L2 OP Rbuilder image compiles properly on that version, so this should be good to merge without affecting anything.However, after merging this PR, running
make cleanis necessary in order to make sure the measurements match