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

00328: Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild #3

Merged
merged 1 commit into from Jul 15, 2019

Conversation

@hroncok
Copy link
Member

commented Jul 11, 2019

Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest
%changelog date. This makes Python default to the CHECKED_HASH pyc
invalidation mode, bringing more reproducible builds traded for an import
performance decrease. To avoid that, we don't default to CHECKED_HASH
when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).

See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426

Untested yet. Will run a scratchbuild.

@hroncok

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

Prior to this change:

$ hexdump usr/lib64/python3.8/__pycache__/codecs.cpython-38.pyc | head -n1
0000000 0d53 0a0d 0003 0000 7730 bf47 16d2 6c2d

Scratchbuild: https://koji.fedoraproject.org/koji/taskinfo?taskID=36183131

@hroncok hroncok self-assigned this Jul 11, 2019

@hroncok hroncok added the WIP label Jul 11, 2019

@hroncok

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

With the change (file from the aarch64 package):

$ hexdump usr/lib64/python3.8/__pycache__/codecs.cpython-38.pyc | head -n1
0000000 0d53 0a0d 0000 0000 d9eb 5d1d 8eee 0000
@hroncok

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

Running python3 build in https://copr.fedorainfracloud.org/coprs/churchyard/dirty-tests/builds/ so I can test Python 3 package rebuilds against it.

00328: Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild
Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest
%changelog date. This makes Python default to the CHECKED_HASH pyc
invalidation mode, bringing more reproducible builds traded for an import
performance decrease. To avoid that, we don't default to CHECKED_HASH
when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).

See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426

@hroncok hroncok force-pushed the hroncok:source_epoch branch from 5c8fee4 to 746a45a Jul 11, 2019

@hroncok

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

Prior to the build:

$ hexdump usr/lib/python3.7/site-packages/emcee/__pycache__/mh.cpython-37.pyc | head -n1
0000000 0d42 0a0d 0003 0000 13eb 2a64 d154 f403
@hroncok

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

After the build:

$ hexdump usr/lib/python3.7/site-packages/emcee/__pycache__/mh.cpython-37.pyc | head -n1
0000000 0d42 0a0d 0000 0000 9a90 5788 1563 0000

This indeed fixes the problem.

@hroncok hroncok removed the WIP label Jul 11, 2019

@encukou
Copy link
Member

left a comment

Looks good, as does your test. (I didn't test myself.)

@hroncok hroncok merged commit 746a45a into fedora-python:fedora-3.8 Jul 15, 2019

@hroncok hroncok deleted the hroncok:source_epoch branch Jul 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.