Skip to content

Conversation

@alexhulbert
Copy link
Member

@alexhulbert alexhulbert commented Nov 26, 2025

The new Debian-backports rust versions:

  • Are scoped to particular images, meaning updating rust on Bob L2 will not change the rust version on the L2 op-rbuilder image, etc
  • Are pinned to the Debian repo timestamp. The image measurements will stay the same even if a new Rust version comes out

These changes:

  • speed up build times
  • remove the rust toolchain from our reproducibility threat model (since the debian backports version can be independently verified via the deb rebuilder scripts)
  • remove the unnecessary network calls to download the entire rust toolchain on each build (regardless of cache)

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 clean is necessary in order to make sure the measurements match

@alexhulbert alexhulbert marked this pull request as draft November 26, 2025 13:31
@alexhulbert alexhulbert marked this pull request as ready for review December 4, 2025 09:05
export RUSTUP_HOME="/rustup"
export CARGO_HOME="/cargo"
mkosi-chroot rustup toolchain install $RUST_VERSION
mkosi-chroot rustup default $RUST_VERSION
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary?

Copy link
Member Author

@alexhulbert alexhulbert Dec 11, 2025

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.

Copy link
Member

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?"

Copy link
Member Author

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

Copy link
Member Author

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/

Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants