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

Bug report: image_volume.py time_stamp breaks reproducible builds #1254

Closed
bmwiedemann opened this issue Jul 30, 2023 · 5 comments
Closed

Bug report: image_volume.py time_stamp breaks reproducible builds #1254

bmwiedemann opened this issue Jul 30, 2023 · 5 comments

Comments

@bmwiedemann
Copy link

Environment

OS: all (openSUSE-Tumbleweed-20230728)
Python version: all

Description

While working on reproducible builds for openSUSE, I found that
building our python-pyface package twice resulted in such diffs:

--- old//usr/lib/python3.11/site-packages/pyface/image/library/icons.zip/image_volume.py        2023-07-30 13:29:14.000000000 +0200
+++ new//usr/lib/python3.11/site-packages/pyface/image/library/icons.zip/image_volume.py        2039-09-01 02:45:16.000000000 +0200
@@ -4,7 +4,7 @@
     category='General',
     keywords=[],
     aliases=[],
-    time_stamp='20230730132924',
+    time_stamp='20390901024527',
     info=[

There should be a way to get deterministic build results, e.g. allow to override the build timestamp with SOURCE_DATE_EPOCH.

Steps to Reproduce

do a clean build twice

@corranwebster
Copy link
Member

Thanks for the report, although I don't think this is an issue with Pyface. I'm not sure why your build is touching the icons.zip file. You should be able to treat that as a fixed asset from the point of view of linux packaging.

@bmwiedemann
Copy link
Author

It seems, icons.zip is modified by the unittests:
https://code.opensuse.org/package/python-pyface/blob/3ea62406bddb3d455d2d0cc4be6661d24d7b95ea/f/python-pyface.spec#_88
maybe in pyface/image/tests/test_image.py ?

@corranwebster
Copy link
Member

Yes, I think there are tests which test the correct regeneration of the zip archives. Tests shouldn't be run on as part of actually creating a build artefact though? I'd think you'd want to run the tests on the result of the reproducible build.

@bmwiedemann
Copy link
Author

This seems to be an effect of how we build with rpmbuild. There tests run before bundling up files. Will try to avoid it there.

@bmwiedemann
Copy link
Author

We solved it now via https://build.opensuse.org/request/show/1131679 by copying PYTHONPATH / python_sitelib before a test.

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

No branches or pull requests

2 participants