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

[reproducible builds] timestamp varies in buildah/internal/mkcw #5191

Closed
bmwiedemann opened this issue Nov 27, 2023 · 3 comments · Fixed by #5195
Closed

[reproducible builds] timestamp varies in buildah/internal/mkcw #5191

bmwiedemann opened this issue Nov 27, 2023 · 3 comments · Fixed by #5195

Comments

@bmwiedemann
Copy link
Contributor

Description

While working on reproducible builds for openSUSE, I found that our buildah 1.33.1 package varies across builds.

buildah-1.31.2 still built reproducibly on 2023-08-14

Steps to reproduce the issue:

  1. build buildah in two fresh VMs with cd ~/rpmbuild/BUILD/buildah-1.33.1 && SOURCE_DATE_EPOCH=1 GOPATH=$HOME/go GOFLAGS=-buildmode=pie make GIT_COMMIT=unknown buildah && md5sum bin/buildah

Something within the system records the timestamp, so it possible to get two bit-identical within the same VM, but not in two different VMs.

Describe the results you received:
results varied in a UNIX epoch timestamp at offset 4 in an ELF section labeled github.com/containers/buildah/internal/mkcw..gobytes.1 -- visible in objdump -D --disassemble=github.com/containers/buildah/internal/mkcw..gobytes.1 bin/buildah |grep -A5 gobytes.1.:

Describe the results you expected:
it should be possible to receive bit-identical build-results

Output of rpm -q buildah or apt list buildah:

buildah-1.33.1

Output of buildah version:

Version:         1.33.1
Go Version:      go1.21.4
Image Spec:      1.1.0-rc.5
Runtime Spec:    1.1.0
CNI Spec:        1.0.0
libcni Version:  v1.1.2
image Version:   5.29.0
Git Commit:      unknown
Built:           Thu Jan  1 00:00:01 1970
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64

Output of cat /etc/*release:

openSUSE Tumbleweed 20231122
(don't have exact output)
@rhatdan
Copy link
Member

rhatdan commented Nov 27, 2023

@nalind PTAL

@nalind
Copy link
Member

nalind commented Nov 28, 2023

Based on conversations elsewhere, I think this is as simple as using -n when we compress the statically-built dummy entrypoint binary. @bmwiedemann, is there any chance you're able to grab the tip of the pull request and check if it fixes the problem you're seeing?

@bmwiedemann
Copy link
Contributor Author

Yes, gzip -n helps.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants