On mercredi, 5 avril 2017 17.35:06 h CEST Brüns, Stefan wrote:
On Mittwoch, 5. April 2017 16:23:07 CEST Bruno Friedmann wrote:
For any packages build with the new singlespec way there those warnings
[ 21s] RPMLINT report: [ 21s] =============== [ 21s] python3-mappyfile.noarch: W: files-duplicate /usr/lib/python3.6/site- packages/mappyfile/__pycache__/tokens.cpython-36.pyc /usr/lib/python3.6/site- packages/mappyfile/__pycache__/tokens.cpython-36.opt-1.pyc [ 21s] python3-mappyfile.noarch: W: files-duplicate /usr/lib/python3.6/site- packages/mappyfile/__pycache__/__init__.cpython-36.opt-1.pyc /usr/lib/ python3.6/site-packages/mappyfile/__pycache__/__init__.cpython-36.pyc [ 21s] python3-mappyfile.noarch: W: files-duplicate /usr/lib/python3.6/site- packages/mappyfile-0.2.0-py3.6.egg-info/not-zip-safe /usr/lib/python3.6/site- packages/mappyfile-0.2.0-py3.6.egg-info/dependency_links.txt [ 21s] python3-mappyfile.noarch: W: files-duplicate /usr/lib/python3.6/site- packages/mappyfile/__pycache__/ordereddict.cpython-36.opt-1.pyc /usr/lib/ python3.6/site-packages/mappyfile/__pycache__/ordereddict.cpython-36.pyc [
21s] 3 packages and 0 specfiles checked; 0 errors, 4 warnings.
Should RPMLINT be fixed to become smarter, and just ignore those, or something still need to be fixed in the python part ?
RPMLINT is right on this, we should not ship duplicate files. The files are duplicate because the opt-1 optimization level has no effect on the bytecode files.
At least run %fdupes -s on the target directory, this will remove (symlink) the duplicates.
The next question is, should we even ship both no-optimization and opt-1 bytecode files? The bytecode itself improves startup time significantly, but the opt-1 is dubious:
it removes any assert(...) statements. Although may improve speed if there are assertions in a hot path, I doubt this is a good idea in general
opt-1 bytecode files will be ignored until we use "python3 -O1" or set PYTONOPTIMIZE=1
if there are no assertions, both bytecode files will be identical
To test it yourself, put the following three files in the same directory, and execute the tests with: a) python3 ./opttest.py b) python3 -O ./opttest.py c) ./opttest.py d) PYTHONOPTIMIZE=1 ./opttest.py
# optmodule_noassert.py def test_no_assert(): print("no assertion")
# optmodule.py def test_assert_good(): assert(1) print("assert good")
def test_assert_fail(): assert(0) print("assert fail")
#! /usr/bin/python3 # opttest.py import optmodule import optmodule_noassert
print("opttest")
optmodule_noassert.test_no_assert() optmodule.test_assert_good() optmodule.test_assert_fail()
Command a) and c) will throw an assertion and generate __pycache__/ optmodule{_noassert}.cpython-36.pyc.
Command b) and d) will throw no assertion and generate __pycache__/ optmodule{_noassert}.cpython-36.opt-1.pyc.
Both optmodule_noassert bytecode files are binary identical.
Kind regards,
Stefan
The fault is due to rpmlint, mostly there's a patch in it but it has 3.5 hardcoded :-) Reported https://bugzilla.opensuse.org/show_bug.cgi?id=1032748 -- Bruno Friedmann Ioda-Net Sàrl www.ioda-net.ch Bareos Partner, openSUSE Member, fsfe fellowship GPG KEY : D5C9B751C4653227 irc: tigerfoot -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org