Skip to content

Replace axoupdater with a small verified updater #1592

Open

Description

@JacobStephens2

This was generated by AI during triage.

Problem

thirdshift update (src/update.rs) uses axoupdater. That costs two things:

  1. Build weight. axoupdater needs axoasset's remote feature, which always pulls in image (with moxcms and pxfm) and turns on reqwest's default-tls (rustls with aws-lc). Stop building aws-lc-sys, and axoupdater's image stack if a flag allows #203 removed aws-lc from our own reqwest but found no flag that drops this stack, so it stays (see the comment in Cargo.toml). In the Make the test suite faster #174 baseline, moxcms, image and pxfm took about 220s of a 616s cold build, and aws-lc stays in the tree only because of the updater. Every new Run worktree and every CI job pays this.
  2. Wrong SELinux label. Console never starts on SELinux-enforcing hosts (502): updater mislabels binary, unit can't run from $HOME #1078 part 1: after an update, the binary is labelled user_tmp_t, probably because the updater downloads into a temp directory and rename()s across it. systemd can't execute a file with that label, so the Console unit fails on SELinux-enforcing hosts.

Proposal

Replace axoupdater with a small updater of our own on the existing blocking reqwest (rustls with ring):

  • Look up the latest v<version> GitHub Release and choose the asset for this target (x86_64-unknown-linux-musl, aarch64-apple-darwin) as dist names it.
  • Verify the download before installing it. Decide what to trust: dist's published checksums at minimum, or GitHub artifact attestations / a signature.
  • Download into a temp file in the same directory as the installed binary, fsync, set the mode, then rename over the binary. A same-directory rename avoids crossing filesystems and gives the file the directory's label, which fixes Console never starts on SELinux-enforcing hosts (502): updater mislabels binary, unit can't run from $HOME #1078 part 1. Otherwise run restorecon where SELinux is present.
  • Keep ADR 0003's rule: replace only a copy that has the installer's receipt, and point crates.io or source installs to cargo.

Why ready-for-human

Installing a binary from the network is security-sensitive, so a human should decide:

  • what the update trusts (checksum vs attestation vs signature), and what happens when verification fails;
  • the receipt format, to stay compatible with dist's installer;
  • rollback if the new binary won't start;
  • testing for real: an update from the previous release on Rocky 9 with SELinux enforcing, on WSL2, and on macOS.

Acceptance criteria

  • cargo tree -i image, cargo tree -i aws-lc-sys and cargo tree -i axoasset find nothing
  • The PR reports cold cargo test --no-run wall time against the Make the test suite faster #174 baseline
  • thirdshift update verifies the download before replacing anything, and leaves the old binary in place when verification fails
  • On Rocky 9 with SELinux enforcing, the updated binary is home_bin_t and thirdshift-console.service starts
  • Copies without a receipt are left alone, as today
  • ADR 0003's Consequences say that thirdshift's own updater replaces axoupdater

Related: #174, #203, #1078.

Activity

  1. added
    enhancement
    ready-for-human
    on Oct 29, 2026
  2. JacobStephens2 commented on Nov 9, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Updated build-time evidence

    This issue's build-weight argument cites #174's baseline, where moxcms, image and pxfm took about 220 s of a 616 s cold build. That no longer describes the cost. A cold dev build on 2026-11-09 (rustc 1.99.1, Lima VM, 4 vCPU aarch64) took 58–66 s:

    • The image stack is now small: moxcms takes 2.8 s and image 2.0 s, and they compile in parallel with other crates.
    • aws-lc-sys is now the cost. Its build script compiles AWS-LC from C for about 30 s, and rustls → reqwest → thirdshift wait on it, so it sits on the critical path.

    Measured end state. To approximate this issue's end state for the build only, I did three things in a scratch Worktree at 82f88ec8:

    • removed axoupdater and stubbed the update functions;
    • moved reqwest to rustls-no-provider plus rustls ring;
    • confirmed that cargo tree -i aws-lc-sys finds nothing.

    The cold build dropped from 58.7 s to 42.4 s, about 16 s or 28%. Edit rebuilds were unchanged at about 6–7 s. Every new Run Worktree and CI job pays a cold build.

    The acceptance criteria still hold: cargo tree -i aws-lc-sys and cargo tree -i image should find nothing. ready-for-human still fits, for the security reasons in the body. #1868 records the full experiments in docs/research/rust-build-profile.md.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions