#17 Drop patch 328
Merged a year ago by churchyard. Opened a year ago by churchyard.
rpms/ churchyard/python3.12 no328  into  rawhide

@@ -1,54 +0,0 @@ 

- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

- Date: Thu, 11 Jul 2019 13:44:13 +0200

- Subject: [PATCH] 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

- Downstream only: only used when building RPM packages

- Ideally, we should talk to upstream and explain why we don't want this

- ---

-  Lib/py_compile.py           | 3 ++-

-  Lib/test/test_py_compile.py | 2 ++

-  2 files changed, 4 insertions(+), 1 deletion(-)

- 

- diff --git a/Lib/py_compile.py b/Lib/py_compile.py

- index 388614e51b..db52725016 100644

- --- a/Lib/py_compile.py

- +++ b/Lib/py_compile.py

- @@ -70,7 +70,8 @@ class PycInvalidationMode(enum.Enum):

-  

-  

-  def _get_default_invalidation_mode():

- -    if os.environ.get('SOURCE_DATE_EPOCH'):

- +    if (os.environ.get('SOURCE_DATE_EPOCH') and not

- +            os.environ.get('RPM_BUILD_ROOT')):

-          return PycInvalidationMode.CHECKED_HASH

-      else:

-          return PycInvalidationMode.TIMESTAMP

- diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py

- index 5e0a44ad96..ac14a6a54c 100644

- --- a/Lib/test/test_py_compile.py

- +++ b/Lib/test/test_py_compile.py

- @@ -19,6 +19,7 @@ def without_source_date_epoch(fxn):

-      def wrapper(*args, **kwargs):

-          with os_helper.EnvironmentVarGuard() as env:

-              env.unset('SOURCE_DATE_EPOCH')

- +            env.unset('RPM_BUILD_ROOT')

-              return fxn(*args, **kwargs)

-      return wrapper

-  

- @@ -29,6 +30,7 @@ def with_source_date_epoch(fxn):

-      def wrapper(*args, **kwargs):

-          with os_helper.EnvironmentVarGuard() as env:

-              env['SOURCE_DATE_EPOCH'] = '123456789'

- +            env.unset('RPM_BUILD_ROOT')

-              return fxn(*args, **kwargs)

-      return wrapper

-  

file modified
+3 -5
@@ -19,11 +19,9 @@ 

      '*/test/bad_coding.py',

      '*/test/bad_coding2.py',

      '*/test/badsyntax_*.py',

-     '*/test_lib2to3/data/bom.py',

-     '*/test_lib2to3/data/crlf.py',

-     '*/test_lib2to3/data/different_encoding.py',

-     '*/test_lib2to3/data/false_encoding.py',

-     '*/test_lib2to3/data/py2_test_grammar.py',

+     '*/test_lib2to3/data/*.py',

+     '*/test_lib2to3/data/*/*.py',

+     '*/test_lib2to3/data/*/*/*.py',

      '*.debug-gdb.py',

  ]

  

file modified
+15 -16
@@ -17,7 +17,7 @@ 

  %global prerel a3

  %global upstream_version %{general_version}%{?prerel}

  Version: %{general_version}%{?prerel:~%{prerel}}

- Release: 1%{?dist}

+ Release: 2%{?dist}

  License: Python-2.0.1

  

  # Getting this build in Koji on 32bit ARM is frustrating due to technical problems
@@ -302,20 +302,6 @@ 

  # pypa/distutils integration: https://github.com/pypa/distutils/pull/70

  Patch251: 00251-change-user-install-location.patch

  

- # 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

- 

  # 00371 # 1fc313929648e9b543542de09f59c55e175ac45a

  # Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)"

  #
@@ -945,15 +931,25 @@ 

  # Python CMD line options:

  # -s - don't add user site directory to sys.path

  # -B - don't write .pyc files on import

+ # Clamp the source mtime first, see https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes

+ # The clamp_source_mtime module is only guaranteed to exist on Fedoras that enabled this option:

+ %if 0%{?clamp_mtime_to_source_date_epoch}

+ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \

+ PYTHONPATH="%{_rpmconfigdir}/redhat" \

+ %{buildroot}%{_bindir}/python%{pybasever} -s -B -m clamp_source_mtime %{buildroot}%{pylibdir}

+ %endif

  # compileall CMD line options:

  # -f - force rebuild even if timestamps are up to date

  # -o - optimization levels to run compilation with

  # -s - part of path to left-strip from path to source file (buildroot)

  # -p - path to add as prefix to path to source file (/ to make it absolute)

  # --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space)

+ # --invalidation-mode - we prefer the timestamp invalidation mode for performance reasons

+ # -x - skip test modules with SyntaxErrors (taken from the Makefile)

  LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \

  %{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \

- -f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes || :

+ -f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes --invalidation-mode=timestamp \

+ -x 'bad_coding|badsyntax|site-packages|test/test_lib2to3/data'

  

  # Turn this BRP off, it is done by compileall2 --hardlink-dupes above

  %global __brp_python_hardlink %{nil}
@@ -1583,6 +1579,9 @@ 

  # ======================================================

  

  %changelog

+ * Mon Dec 19 2022 Miro Hrončok <mhroncok@redhat.com> - 3.12.0~a3-2

+ - No longer patch the default bytecode cache invalidation policy

+ 

  * Wed Dec 07 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0~a3-1

  - Update to 3.12.0a3

  

rebased onto d7fc071e678e482fccc7d3dcf1c33d7845f41157

a year ago

rebased onto 7dd03c9291953aa5c0101535db23e343eaffd0c5

a year ago

rebased onto af47c9837b554a16269a849a2edfe509f876cb2f

a year ago

Build succeeded.

rebased onto 1f1415a

a year ago

Build succeeded.

Pull-Request has been merged by churchyard

a year ago

Build succeeded.