Skip to content
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

fixate HEADS_GIT_VERSION to use a commit id of 7 characters #1228

Merged

Conversation

tlaurion
Copy link
Collaborator

Force length of commit id to 7 characters to that variation of length is not a source of reproducibility errors.

Fixes #1227

@tlaurion
Copy link
Collaborator Author

tlaurion commented Oct 20, 2022

@JonathonHall-Purism : please review simple code change. Digging of the issue happened under #1008.

The simplest way to test this would be to have a branch on your side corresponding to https://github.com/tlaurion/heads/tree/heads_git_version_fixated_to_abbrev7

We would expect the hashes to all be the same if nothing different installed on top of debian-11 (builds happening the same day, not resolving #936 issues)

Outcome of this would be end users being able to replicate builds from CircleCI (until we have reproducible docker image to have stable and reproducible toolstack poked to have reproducible ROMs again). But meanwhile, a ROM build with the same tools on OS should produce the same ROMs.

What was discovered under #1008 was that rebuilding for the same commit produced a different busybox binary. It is expected that what was installed on top of debian-11 varied (apt install) between two pipeline rebuilds without cache. More digging could be done to troubleshoot this, while having reproducible buildstack is another subject all together.

Doing some digging under #1008 showed that my CircleCI instance, as opposed to osresearch's, was producing ROMs with HEADS_GIT_VERSION having different sizes of commit ID, resulting in ROMs being built the same day on two different CircleCI instances producing slightly different ROMs, simply because HEADS_GIT_VERSION was different. That difference was linked with master commit id being reported differently on the two CircleCI instances.
git describe --tags --dirty reporting either v0.2.0-1263-gf2e45c43 or v0.2.0-1263-gf2e45c4 causing differences in the ROMs built.

This PR fixes that and only that to that HEADS_GIT_VERSION would have contained v0.2.0-1263-gf2e45c4 on the two instances and supposedly producing two exact roms for the same built board.

@tlaurion
Copy link
Collaborator Author

So @JonathonHall-Purism
https://app.circleci.com/pipelines/github/JonathonHall-Purism/heads/10/workflows/be4a70ac-3ff0-45d7-8145-24ae2cb905f0/jobs/274/parallel-runs/0/steps/0-103

and

https://app.circleci.com/pipelines/github/JonathonHall-Purism/heads/10/workflows/be4a70ac-3ff0-45d7-8145-24ae2cb905f0/jobs/274

Shows both :

7ff9d04e9f2ec0288d4a723cd9e87f5128adb6eebcf7d46704b4a9faee1aae4d /root/project/build/x86/x230-hotp-maximized/heads-x230-hotp-maximized-v0.2.0-1264-g5e6f4fb.rom

Merging

@tlaurion tlaurion merged commit 0389eca into linuxboot:master Oct 20, 2022
macpijan added a commit to Dasharo/coreboot that referenced this pull request Nov 17, 2022
The commit hash length as produced by the genbuild_h.sh can differ
depending on the environment (not really sure whether git version,
config, or anything else is the reason here). By focing fixed length,
we can improve build reproducibility on different machines, as this
information is stored in the binary as the COREBOOT_ORIGIN_GIT_REVISION
string.

See below reference on heads issue describing similar problem:
linuxboot/heads#1228

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
miczyg1 pushed a commit to Dasharo/coreboot that referenced this pull request Nov 17, 2022
The commit hash length as produced by the genbuild_h.sh can differ
depending on the environment (not really sure whether git version,
config, or anything else is the reason here). By focing fixed length,
we can improve build reproducibility on different machines, as this
information is stored in the binary as the COREBOOT_ORIGIN_GIT_REVISION
string.

See below reference on heads issue describing similar problem:
linuxboot/heads#1228

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
miczyg1 pushed a commit to Dasharo/coreboot that referenced this pull request Dec 20, 2022
The commit hash length as produced by the genbuild_h.sh can differ
depending on the environment (not really sure whether git version,
config, or anything else is the reason here). By focing fixed length,
we can improve build reproducibility on different machines, as this
information is stored in the binary as the COREBOOT_ORIGIN_GIT_REVISION
string.

See below reference on heads issue describing similar problem:
linuxboot/heads#1228

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
miczyg1 pushed a commit to Dasharo/coreboot that referenced this pull request Feb 16, 2023
The commit hash length as produced by the genbuild_h.sh can differ
depending on the environment (not really sure whether git version,
config, or anything else is the reason here). By focing fixed length,
we can improve build reproducibility on different machines, as this
information is stored in the binary as the COREBOOT_ORIGIN_GIT_REVISION
string.

See below reference on heads issue describing similar problem:
linuxboot/heads#1228

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
miczyg1 pushed a commit to Dasharo/coreboot that referenced this pull request Jun 16, 2023
The commit hash length as produced by the genbuild_h.sh can differ
depending on the environment (not really sure whether git version,
config, or anything else is the reason here). By focing fixed length,
we can improve build reproducibility on different machines, as this
information is stored in the binary as the COREBOOT_ORIGIN_GIT_REVISION
string.

See below reference on heads issue describing similar problem:
linuxboot/heads#1228

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
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.

Reproducibility issue linked to different length of commits under HEADS_GIT_VERSION
1 participant