Bug 2133850 - Downstream-only patch in Python 3: #328 Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild
Summary: Downstream-only patch in Python 3: #328 Restore pyc to TIMESTAMP invalidation...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.12
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-11 15:08 UTC by Tomas Orsava
Modified: 2023-01-06 14:23 UTC (History)
8 users (show)

Fixed In Version: python3.12-3.12.0~a3-2.fc38
Clone Of:
Environment:
Last Closed: 2023-01-06 14:23:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1287556 0 unspecified CLOSED Downstream only patches in Python3 2022-10-11 15:20:20 UTC

Internal Links: 1287556

Description Tomas Orsava 2022-10-11 15:08:34 UTC
From python3.11.spec:

# 00328 # 318e500c98f5e59eb1f23e0fcd32db69b9bd17e1
# 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
# Downstream only: only used when building RPM packages
# Ideally, we should talk to upstream and explain why we don't want this
Patch328: 00328-pyc-timestamp-invalidation-mode.patch

Comment 1 Tomas Orsava 2022-10-11 15:10:47 UTC
Previously tracked in BZ#1287556.

Comment 2 Petr Viktorin (pviktori) 2022-10-12 12:26:49 UTC
This should be solved by __pysource__, if accepted upstream: https://discuss.python.org/t/pysource-file-layout-for-installed-modules/14594

Comment 3 Miro Hrončok 2022-12-19 11:01:58 UTC
I figured out we can pass --invalidation-mode=timestamp to compilall when we byte-compile explicitly and we don't need to care about other use cases that much.

See https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/154 and https://src.fedoraproject.org/rpms/python3.12/pull-request/17


Note You need to log in before you can comment on or make changes to this bug.