Skip to content

Add job checking for reproducibility issues#2342

Merged
emilyalbini merged 1 commit intomasterfrom
ea-repro
Jan 9, 2026
Merged

Add job checking for reproducibility issues#2342
emilyalbini merged 1 commit intomasterfrom
ea-repro

Conversation

@emilyalbini
Copy link
Member

@emilyalbini emilyalbini commented Jan 6, 2026

This PR adds a set of CI jobs to try and prevent nondeterminism in the build process. While they are not a guarantee that Hubris will be reproducible, it will hopefully catch most cases where we accidentally introduce nondeterminism.

There are two new jobs, reproducible-a and reproducible-b, building the same board (I arbitrarily picked cosmo-b, it can be anything). The first job uses the standard Ubuntu runner with little to no modification, while the second job tries to mutate the build environment as much as possible to introduce sources of nondeterminism. The code of the second job is heavily commented to describe each source and how we introduce it.

Inspiration for which variations to introduce was inspired by both past personal experience and the documentation provided by the reproducible-builds project. There is a source I wanted to include (different UIDs) but didn't, and that's because running things as different users inside of GitHub Actions was breaking too many things to be worth it.

There is then a final new job, reproducible-check, that gets the artifacts from both builders and compares them with diffoscope, another tool by the reproducible-builds project. In case there are differences it will upload the diffoscope report as an artifact for analysis. This is a run where I intentionally induced nondeterminism, if you want to look at how things would be in case of a failure (there is a link to the diffoscope report in there).

If there are other sources of nondeterminism we want to try and inject let me know and I'll see how feasible it is to add them.

Fixes #2299

@emilyalbini emilyalbini force-pushed the ea-repro branch 20 times, most recently from f2b3afd to e452eda Compare January 7, 2026 20:42
@emilyalbini emilyalbini changed the title WIP: Add job checking for reproducibility issues Add job checking for reproducibility issues Jan 7, 2026
@emilyalbini emilyalbini marked this pull request as ready for review January 7, 2026 20:51
Comment on lines 123 to 125
# Hubris builds have to be reproducible, and we want to test that in CI. This job does a build of
# an arbitrary board (specifically cosmo-b, but it can be changed to any board) with the standard
# Ubuntu image and no interference, as the baseline to compire to.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any chance we could also test an RoT board? There's enough disjoint code between SP and RoT and I could unfortunately see us accidentally sneaking in something non-reproducible to the RoT. Arguably there is some amount of disjoint code between e.g. cosmo and sidecar but that amount is smaller than SP vs RoT.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! Added both the RoT and Cosmo. It should also be trivial to add more in the future by just adding extra boards to the matrix.

#
# We also use disorderfs to randomize the ordering of listing directories, to catch code
# assuming directory entries are always returned in the same order.
- name: Prepare a custom build root directory with disorderfs
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL disorderfs. This is lightly terrifying and also useful!

@emilyalbini emilyalbini force-pushed the ea-repro branch 4 times, most recently from 4bd8a5f to 0d2dfec Compare January 9, 2026 11:38
Copy link
Collaborator

@labbott labbott left a comment

Choose a reason for hiding this comment

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

LGTM let's give this a shot 😎

@emilyalbini emilyalbini merged commit d7a42ce into master Jan 9, 2026
174 checks passed
@emilyalbini emilyalbini deleted the ea-repro branch January 9, 2026 15:21
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.

Add CI job(s) testing for reproducibility

2 participants