Comments (18)
python-sip6.spec
That has %fdupes -s doc
and is irrelevant for python
from python-rpm-macros.
Trying to come up with a proof concept here, but the problem is that if you run %fdupes
and then use compileall, the hardlinks get replaced. Still trying to think of a good solution.
from python-rpm-macros.
I wonder whether #151 is involved somehow.
from python-rpm-macros.
@Vogtinator, @bnavigator, and @bmwiedemann might be interested as well.
from python-rpm-macros.
This should support existing spec files since calling fdupes a second time should result in no changes
There could be some edge cases like %fdupes -s
converting hardlinks to symlinks, but I recommend against %fdupes -s
anyway...
from python-rpm-macros.
I think all python spec files now don't use %fdupes -s
from python-rpm-macros.
I think all python spec files now don't use %fdupes -s
Just for the record (none of these are much relevant for anything):
milic~/b/spec_factory$ rg -l 'fdupes -s' python-*
python-youtube-dl.spec
python-sip6.spec
python-pytest-expect.spec
python-pymediainfo.spec
python-OWSLib.spec
python-mkdocs.spec
python-livereload.spec
python-gphoto2.spec
python-ghp-import.spec
python-cangjie.spec
python-apipkg.spec
milic~/b/spec_factory$
However, it is really not much relevant for this discussion (delegated to Trello).
from python-rpm-macros.
In the last years, timestamps are mostly not a problem for .pyc files, because rpmbuild
normalizes mtime via %clamp_mtime_to_source_date_epoch Y
and .pyc headers usually default to checksum mode with SOURCE_DATE_EPOCH
set.
What is a problem are variations (e.g. from ASLR) that go into .pyc files. Because .pyc files are memory-dumps of internal python state, they are hard to make properly reproducible.
e.g.
> cat test.py
lext = {'png', 'gif', 'jpg', 'pcx', 'pnm', 'tif', 'xpm'}
> for i in $(seq 10) ; do setarch -R python3.10 -m py_compile test.py ; md5sum __pycache__/test.cpython-310.pyc
done|sort -u|wc -l
10
from python-rpm-macros.
This is actually not directly about reproducible builds but about fixing a packaging issue: https://bugzilla.suse.com/show_bug.cgi?id=1207805
from python-rpm-macros.
Bug is non-public
from python-rpm-macros.
In the last years, timestamps are mostly not a problem for .pyc files, because
rpmbuild
normalizes mtime via%clamp_mtime_to_source_date_epoch Y
and .pyc headers usually default to checksum mode withSOURCE_DATE_EPOCH
set.
@bmwiedemann, is that also true for SLE/Leap? The py39 custom repos for 15.X builds always throw rpmlint errors because that one doesn't like the mtimes of the .pyc files. I ignore them.
from python-rpm-macros.
Bug is non-public
I am sorry about that, I tried to add you to the bug so it should be visible at least to you. Does it work?
from python-rpm-macros.
I can read it now.
Taking @bmwiedemann's input into account, I suspect this is a SLE/Leap only issue for Python 3.6 generated .pyc files.
%#FLAVOR#_compile
is already part of %#FLAVOR#_pyproject_install
. No harm in adding %fdupes
before that call, so that duplicate source files get the same mtime. Legacy %python_install
would need to get a bit more attention.
Alternative suggestion: Add -n
to the %fdupes
calls. I think in 99% of the cases, where identical .pyc files get deduplicated are empty __init__.py
files.
from python-rpm-macros.
Alternative suggestion: Add
-n
to the%fdupes
calls. I think in 99% of the cases, where identical .pyc files get deduplicated are empty__init__.py
files.
no — 99% of cases are identical files for opt-0 and opt-1 (which make rpmlint unhappy as there are usually a lot of them)
from python-rpm-macros.
But those have always the same mtime and have never been a problem for reproducible builds due to deduplication.
from python-rpm-macros.
Yeah, the issue is only about *.py files getting replaced by hardlinks. Replacing .pyc files with hardlinks is fine, their mtime is not used.
from python-rpm-macros.
Really interested in your proof here. Because your last comment directly contradicts your concept of the initial post (#156 (comment))
Barely any packages calls %fdupes before the python compile, and if it does this it is only fixable in the package specfile not in the python macros.
from python-rpm-macros.
That was an evil idea, not a fiat accompli -- I'm still trying tings out, but I welcome your input.
from python-rpm-macros.
Related Issues (20)
- update-alternatives priorities
- Breaks builds (e.g., tex(symbol) is split) HOT 2
- Request to bring %python_compileall to python-rpm-macros HOT 7
- rpmlint is not happy with the current libalternatives handling HOT 2
- Error in libalternatives filelist produced by the %python_alternative macro HOT 1
- export PYTHONPATH and --import-mode=append required for successful python builds HOT 7
- Shouldn’t %primary_interpreter be part of the OBS project rather than in the SPEC file? HOT 7
- Missing {} around parameter in _python_sysconfig_path/var macros HOT 1
- Old "py_requires" macro for python2 fails to expand properly on Leap 15.4 HOT 2
- libalternatives handling wrong HOT 3
- Additional flags in scriptlets (like `%pre -f`) HOT 21
- %pyproject_wheel doesn't work without %python_subpackages HOT 2
- Cannot add `--install-options` to %pyproject_install HOT 4
- Add python312 in <flavor> HOT 2
- python_compileall fails to strip the buildroot HOT 16
- Conditionally switch off providing python3-* packages for primary set HOT 16
- rewrite shebangs for "pythons python3" packages HOT 1
- _pyproject_wheeldir of "build" is way too generic HOT 15
- Add a macro for use of build and installer HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-rpm-macros.