Bug 1187473 - python-rpm-macros on SLE and Leap do not support the official wiki recommendations
python-rpm-macros on SLE and Leap do not support the official wiki recommenda...
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Other
Leap 15.3
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Matej Cepl
E-mail List
https://github.com/openSUSE/python-rp...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-17 16:38 UTC by Benjamin Greiner
Modified: 2022-03-02 12:12 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Greiner 2021-06-17 16:38:45 UTC
As discussed on the python mailinglist [1], python-rpm-macros on Leap 15.X and SLE-15 are not up to date. This creates problems, when packagers want to update official repo packages, and follow the wiki instructions [2]. E.g. the recommended %pyunittest macro instead of deprecated python setup.py test is not available in SLE/Leap's python-rpm-macros-20200207.5feb6c1.

[1] https://lists.opensuse.org/archives/list/python@lists.opensuse.org/thread/XPPLKFMBNWTH77CEY6RP675KA6OI4USD/
[2] https://en.opensuse.org/openSUSE:Packaging_Python#Running_tests
Comment 1 Matej Cepl 2021-07-22 11:48:17 UTC
Internal ticket for SLE-15SP4 https://jira.suse.com/browse/PM-2818
Comment 2 Matej Cepl 2022-01-05 15:48:29 UTC
SLE-15 will have updated python-rpm-macros in SP4.
Comment 3 Matej Cepl 2022-01-05 15:49:33 UTC
I think we are with  python-rpm-macros-20211022.38e7c70 right now.
Comment 4 Benjamin Greiner 2022-01-05 16:21:04 UTC
But what about 15.3? I got this in my inbox just today:

Visit https://build.opensuse.org/package/live_build_log/devel:languages:python/python-ctypeslib2/15.3/x86_64

Package devel:languages:python/python-ctypeslib2 failed to build in 15.3/x86_64

Check out the package for editing:
  osc checkout devel:languages:python python-ctypeslib2

Last lines of build log:
[   54s] ++ cat _current_flavor
[   54s] + python_flavor=python3
[   54s] + '[' -z python3 ']'
[   54s] + '[' python3 '!=' python3 ']'
[   54s] + echo python3
[   54s] + mkdir -p build/bin
[   54s] + ln -s /home/abuild/rpmbuild/BUILDROOT/python-ctypeslib2-2.3.2-lp153.10.2.x86_64/usr/bin/clang2py-3.6 build/bin/clang2py
[   54s] ++ pwd
[   54s] + export PATH=/home/abuild/rpmbuild/BUILD/ctypeslib2-2.3.2/build/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
[   54s] + PATH=/home/abuild/rpmbuild/BUILD/ctypeslib2-2.3.2/build/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
[   54s] ++ clang -print-resource-dir
[   54s] + export CPATH=/usr/lib64/clang/11.0.1/include
[   54s] + CPATH=/usr/lib64/clang/11.0.1/include
[   54s] ++ getconf LONG_BIT
[   54s] + '[' 64 -eq 32 ']'
[   54s] + %pyunittest discover -s test/ -v
[   54s] /var/tmp/rpm-tmp.YrWnTt: line 56: fg: no job control
[   54s] error: Bad exit status from /var/tmp/rpm-tmp.YrWnTt (%check)

Visit https://build.opensuse.org/package/live_build_log/devel:languages:python/python-precis-i18n/15.3/x86_64

Package devel:languages:python/python-precis-i18n failed to build in 15.3/x86_64

Check out the package for editing:
  osc checkout devel:languages:python python-precis-i18n

Last lines of build log:
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-50-generate-fips-hmac
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-55-boot-scripts
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-60-hook
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-65-lib64-linux
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-70-extract-translations
[   37s] find: '//home/abuild/rpmbuild/BUILDROOT/python-precis-i18n-1.0.3-lp153.11.3.x86_64/usr/share/polkit-1/actions/': No such file or directory
[   37s] find: '//home/abuild/rpmbuild/BUILDROOT/python-precis-i18n-1.0.3-lp153.11.3.x86_64/usr/share/mime/': No such file or directory
[   37s] find: '//home/abuild/rpmbuild/BUILDROOT/python-precis-i18n-1.0.3-lp153.11.3.x86_64/usr/share/metainfo/': No such file or directory
[   37s] find: '//home/abuild/rpmbuild/BUILDROOT/python-precis-i18n-1.0.3-lp153.11.3.x86_64/usr/share/appdata/': No such file or directory
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-72-extract-appdata
[   37s] calling /usr/lib/rpm/brp-suse.d/brp-75-ar
[   37s] Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.QxqRW2
[   37s] + umask 022
[   37s] + cd /home/abuild/rpmbuild/BUILD
[   37s] + cd precis_i18n-1.0.3
[   37s] + %pyunittest -v
[   37s] /var/tmp/rpm-tmp.QxqRW2: line 28: fg: no job control
[   37s] error: Bad exit status from /var/tmp/rpm-tmp.QxqRW2 (%check)

Visit https://build.opensuse.org/package/live_build_log/devel:languages:python/python-pep517/15.3/x86_64

Package devel:languages:python/python-pep517 failed to build in 15.3/x86_64

Check out the package for editing:
  osc checkout devel:languages:python python-pep517

Last lines of build log:
[   29s] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.lzLO2r
[   29s] + umask 022
[   29s] + cd /home/abuild/rpmbuild/BUILD
[   29s] + cd pep517-0.12.0
[   29s] ++ '[' -f _current_flavor ']'
[   29s] ++ true
[   29s] + python_flavor=
[   29s] + '[' -z '' ']'
[   29s] + python_flavor=tmp
[   29s] + '[' tmp '!=' python2 ']'
[   29s] + '[' -d build ']'
[   29s] + '[' -d _build.python2 ']'
[   29s] + echo python2
[   29s] + python2 -mpip install --root /home/abuild/rpmbuild/BUILDROOT/python-pep517-0.12.0-lp153.19.11.x86_64 --no-compile --no-deps --progress-bar off '*.whl' dist/pep517-0.12.0-py2.py3-none-any.whl
[   29s] DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
[   29s] WARNING: Requirement '*.whl' looks like a filename, but the file does not exist
[   29s] ERROR: *.whl is not a valid wheel filename.
[   29s] error: Bad exit status from /var/tmp/rpm-tmp.lzLO2r (%install)

Visit https://build.opensuse.org/package/live_build_log/devel:languages:python/python-flit-core/15.3/x86_64

Package devel:languages:python/python-flit-core failed to build in 15.3/x86_64

Check out the package for editing:
  osc checkout devel:languages:python python-flit-core

Last lines of build log:
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep517/LICENSE  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep517/README.rst  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep517/module1.py  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep517/pyproject.toml  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621/LICENSE  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621/README.rst  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621/module1a.py  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621/pyproject.toml  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621_nodynamic/README.rst  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621_nodynamic/module1.py  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests/samples/pep621_nodynamic/pyproject.toml  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core-3.4.0.dist-info/WHEEL  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core-3.4.0.dist-info/METADATA  
[   41s]   inflating: /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core-3.4.0.dist-info/RECORD  
[   41s] + rm -r /home/abuild/rpmbuild/BUILDROOT/python-flit-core-3.4.0-lp153.20.13.x86_64/usr/lib/python3.6/site-packages/flit_core/tests
[   41s] + %python_compileall
[   41s] /var/tmp/rpm-tmp.sFdfkT: line 43: fg: no job control
[   41s] error: Bad exit status from /var/tmp/rpm-tmp.sFdfkT (%install)

They use python-rpm-macros-20200207.5feb6c1-3.11.1 while these are all errors fixed in a recent python-rpm-macros.
Comment 5 Benjamin Greiner 2022-01-05 16:53:22 UTC
Hm, the failures are actually because you broke :backports.

https://build.opensuse.org/project/show/devel:languages:python:backports#comment-1567500
Comment 6 Matej Cepl 2022-01-06 21:49:15 UTC
(In reply to Benjamin Greiner from comment #5)
> Hm, the failures are actually because you broke :backports.
> 
> https://build.opensuse.org/project/show/devel:languages:python:
> backports#comment-1567500

That should be fixed now.
Comment 7 Benjamin Greiner 2022-01-06 22:55:52 UTC
https://build.opensuse.org/projects/devel:languages:python/meta still says deleted
Comment 9 Matej Cepl 2022-01-09 22:14:06 UTC
If you want something from me, tell me exactly what you want, and don’t
point me to your long rambling on a list, which has been still being discussed. Let
the thread on the list finish first, and we may get to some conclusions
there.
Comment 10 Benjamin Greiner 2022-01-09 23:33:24 UTC
Well, the original bug that python-rpm-macros in 15.3 is too old for the wiki is certainly still an open issue.
Comment 11 Simon Lees 2022-01-10 10:24:38 UTC
There are probably 2 possible solutions to this:

1. Update the wiki to mention 15.3 doesn't support these features.

2. In the past we have shipped similar updates to rpm macro's (I've certainly done it for cmake) through the maintenance process and only released them for openSUSE (or not at all) then the newer macro's would become available via the updates repo and we could at that to 15.3 in backports and d:l:p.
Comment 12 Benjamin Greiner 2022-01-10 10:45:16 UTC
Number 1 has the disadvantage that you often can't use the features at all because SRs will frequently be rejected by package and project maintainers with "but this breaks SLE/Leap support." or you always have to add specific expressions to the specfile in order to exclude the SLE/Leap builds. Having scheduled but failing builds in obs unnecessarily puts additional workloads onto the obs servers. Also, the build fail notifications are annoying.

I would be okay with number 2.

Don't forget the necessary prjconf definitions, which you need to add to :Update then.

If you don't and make the definitions directly in d:l:p, you need to wrap them in %if conditions so that they don't conflict with the Factory definitions for Leap:


%if "%_repository" == "15.3" || "%_repository" == "15.4"
Macros:
## PYTHON MACROS BEGIN
# adapted form of https://github.com/openSUSE/python-rpm-macros/blob/master/default-prjconf for SLE/Leap
# requires python-rpm-macros >= 20210204
# order of %pythons is important: The last flavor overrides any operation on conflicting files and definitions during expansions,
# making it the "default" in many cases --> keep the primary python3 provider at the end.
%pythons %{?!skip_python2:python2} %{?!skip_python3:python3}
%add_python() %{expand:%%define pythons %1 %pythons}
 
# This method for generating python_modules gets too deep to expand for rpm at about 5 python flavors.
# Hence, python_module_iter is replaced by python_module_lua in macros.lua.
# However, OBS cannot expand lua, but has a much higher expansion depth, so this works fine for the server side resolver.
%python_module_iter(a:) %{expand:%%define python %{-a*}} ( %python-%args ) %{expand:%%{?!python_module_iter_%1:%%{python_module_iter -a%*}}%%{?python_module_iter_%1}}
# pseudo-undefine for obs: reset for the next expansion within the next call of python_module
%python_module_iter_STOP %global python %%%%python
%python_module() %{?!python_module_lua:%{expand:%%define args %{**}} %{expand:%%{python_module_iter -a %{pythons} STOP}}}%{?python_module_lua:%python_module_lua %{**}}
## PYTHON MACROS END
:Macros
%endif
Comment 13 Benjamin Greiner 2022-01-10 14:51:46 UTC
My last comment contained a completely wrong statement by me. It should read:

"If you don't and make the definitions in :Update or d:l:p:backorts but directly in d:l:p, you need to wrap them in %if conditions so that they don't conflict with the inherited Factory definitions for Tumbleweed."

I have updated the Wiki to reflect the current state.

Note the difference in https://build.opensuse.org/package/show/devel:languages:python/python-injector between 15.3 and 15.4:

15.3 does not have a new enough python-rpm-macros nor the prjconf definitions:

unresolvable: nothing provides if, nothing provides %python-base < 3.9, nothing provides %python-base < 3.7, nothing provides python-rpm-macros >= 20210131, (got version 20200207.5feb6c1-3.11.1)


15.4 does have it but is missing the prjconf definitions:

unresolvable: nothing provides if, nothing provides %python-base < 3.9, nothing provides %python-base < 3.7
Comment 14 Matej Cepl 2022-01-10 15:00:40 UTC
Could you check the current prjconf, please?

https://build.opensuse.org/projects/devel:languages:python/prjconf
Comment 15 Benjamin Greiner 2022-01-10 15:09:29 UTC
Yes, as you see by the successful build of python-injector for 15.4, this is the way until the definition makes it into openSUSE:SLE-15-SP4:GA, where python-rpm-macros-20211022.38e7c70 comes from.

So the issue has progressed to:

- 15.3: Maintenance update of python-rpm-macros and prjconf definition required
- 15.4: update prjconf definition to match python-rpm-macros in SLE-15-SP4:GA
Comment 16 Benjamin Greiner 2022-01-10 15:14:32 UTC
Actually, until there is a python-rpm-macros for 15.3 available in the project providing the %python_module_lua macro, you should remove the `"%_repository" == "15.3" ||` part.
Comment 17 Benjamin Greiner 2022-01-11 19:14:09 UTC
Update: Now that Dirk re-added the :backports paths into d:l:p, the prjconf definition is duplicate.

Projects outside of d:l:p using plain SLE or Leap 15.3 still can't use the new syntax. The wiki mentions this now. So this bug could go either as WONTFIX or the issues in comment #15 are addressed in the respective distribution repositories:

> - 15.3: Maintenance update of python-rpm-macros and prjconf definition
> required
> - 15.4: update prjconf definition to match python-rpm-macros in SLE-15-SP4:GA
Comment 18 Matej Cepl 2022-01-17 13:20:50 UTC
(In reply to Benjamin Greiner from comment #15)
> - 15.3: Maintenance update of python-rpm-macros and prjconf definition
> required

I have no a problem with with this, but I just cannot justify upgrade of package in SLE with possibility of breaking hundreds of other packages by somebody willing to play with more current packages in d:l:p without a proper bug with the business justification of it.
Comment 19 Matej Cepl 2022-03-02 12:12:56 UTC
I think we are done here.