Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions base/add-backports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# The mkosi sandbox environment should have a debian backports source list
# that matches the archive timestamp of the main release.
# See https://github.com/systemd/mkosi/issues/1755
MIRROR=$(jq -r .Mirror /work/config.json)
if [ "$MIRROR" = "null" ]; then
MIRROR="http://deb.debian.org/debian"
fi

cat > "$SRCDIR/mkosi.builddir/debian-backports.sources" <<EOF
Types: deb deb-src
URIs: $MIRROR
Suites: ${RELEASE}-backports
Components: main
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
2 changes: 2 additions & 0 deletions base/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release=trixie

[Build]
PackageCacheDirectory=mkosi.cache
SandboxTrees=mkosi.builddir/debian-backports.sources:/etc/apt/sources.list.d/debian-backports.sources
Environment=KERNEL_IMAGE KERNEL_VERSION
WithNetwork=true

Expand All @@ -23,6 +24,7 @@ FinalizeScripts=base/debloat.sh
PostInstallationScripts=base/debloat-systemd.sh
PostInstallationScripts=base/efi-stub.sh
BuildScripts=kernel/mkosi.build
SyncScripts=base/add-backports.sh

CleanPackageMetadata=true
Packages=kmod
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
qemu-utils
parted
unzip
jq
]
++ [reprepro];
};
Expand All @@ -92,6 +93,7 @@
nativeBuildInputs = [(mkosi system) measured-boot measured-boot-gcp];
shellHook = ''
mkdir -p mkosi.packages mkosi.cache mkosi.builddir ~/.cache/mkosi
touch mkosi.builddir/debian-backports.sources
'';
};
}) ["x86_64-linux" "aarch64-linux"]);
Expand Down
8 changes: 0 additions & 8 deletions l2/_op_rbuilder/mkosi.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ set -euxo pipefail

ENV_YAML="$SRCDIR/l2/_op_rbuilder/mkosi.extra/etc/flashbots/op-rbuilder.yaml"

RUST_VERSION=$(mkosi-chroot yq -r .rust.version < "$ENV_YAML")

OP_RBUILDER_REF=$(mkosi-chroot yq -r .op_rbuilder.git_reference < "$ENV_YAML")
TDX_QUOTE_PROVIDER_REF=$(mkosi-chroot yq -r .tdx_quote_provider.git_reference < "$ENV_YAML")
RPROXY_REF=$(mkosi-chroot yq -r .rproxy.git_reference < "$ENV_YAML")
NODE_HEALTHCHECKER_REF=$(mkosi-chroot yq -r .node_healthchecker.git_reference < "$ENV_YAML")

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?

export PATH="$CARGO_HOME/bin:$PATH"

source scripts/make_git_package.sh
source scripts/build_rust_package.sh

Expand Down
3 changes: 2 additions & 1 deletion l2/_op_rbuilder/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Packages=libtss2-dev

BuildPackages=golang
libssl-dev
rustup
cargo/trixie-backports
rustc/trixie-backports
unzip
yq
3 changes: 0 additions & 3 deletions l2/_op_rbuilder/mkosi.extra/etc/flashbots/op-rbuilder.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
rust:
version: 1.91.1

node_healthchecker:
git_reference: v0.1.11

Expand Down