Bug 1977895

Summary: RFE: In brp-python-bytecompile and %py_byte_compile, use compileall with --hardlink-dupes
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-rpm-macrosAssignee: Petr Viktorin (pviktori) <pviktori>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: cstratak, j, m.cyprian, mhroncok, pviktori, python-sig
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rpm-macros-3.10-8.fc36 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-17 11:39:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miro Hrončok 2021-06-30 16:34:29 UTC
The compileall module (since Python 3.9) and the comileall2 module allows to save some disk space by hardlinking identical bytecode files from different optimization levels when the --hardlink-dupes flag is used.

Context: https://discuss.python.org/t/compileall-option-to-hardlink-duplicate-optimization-levels-bytecode-cache-files/3014

We should actually use that flag, since we created it :)

There is also brp-python-hardlink which achieves the same thing but it needlessly makes all builds a bit slower. Once we start using --hardlink-dupes in brp-python-bytecompile and %py_byte_compile, we might consider dropping brp-python-hardlink (or at least disabling it by default and only calling it on demand for our older Python interpreter packages).

Comment 1 Petr Viktorin (pviktori) 2021-09-09 15:36:50 UTC
PR: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/111

Comment 2 Fedora Update System 2021-09-17 11:37:16 UTC
FEDORA-2021-999f9780bd has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2021-999f9780bd

Comment 3 Fedora Update System 2021-09-17 11:39:58 UTC
FEDORA-2021-999f9780bd has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.