Hello, for 15.4 I get a lot of packages (e.g. python packages) which fail with error: File must begin with "/": !!_%1_not_installed_!!/* E.g.: https://build.opensuse.org/package/live_build_log/home:dstoecker/createrepo/... https://build.opensuse.org/package/live_build_log/Application:Geo/python-bas... ... Does anybody know what's wrong here and how to fix. Freedom in Peace -- https://www.dstoecker.eu/ (PGP key available)
Am Montag, 4. Juli 2022, 13:12:23 CEST schrieb Dirk Stöcker:
Hello,
for 15.4 I get a lot of packages (e.g. python packages) which fail with error: File must begin with "/": !!_%1_not_installed_!!/*
E.g.: https://build.opensuse.org/package/live_build_log/home:dstoecker/createrepo/ 15.4/x86_64 https://build.opensuse.org/package/live_build_log/Application:Geo/python-ba semap/15.4/x86_64 ...
Does anybody know what's wrong here and how to fix.
I think this has to do with python. I had the messages too. Either it occurred/occurs when it is a python2 package or it occurred/occurs when it is a package that requires python 3. Here then mostly >= 3.7 and that is not available in Leap 15.4 as standard. In Leap 15.4 python 3.6 is the default. I'm not sure anymore, but I think that comes with python2 packages. Try to change the two examples to python3 and hope that they also run with python 3.6. Regards Eric
On Montag, 4. Juli 2022 13:12:23 CEST Dirk Stöcker wrote:
Hello,
for 15.4 I get a lot of packages (e.g. python packages) which fail with error: File must begin with "/": !!_%1_not_installed_!!/*
E.g.: https://build.opensuse.org/package/live_build_log/home:dstoecker/createrepo/ 15.4/x86_64 https://build.opensuse.org/package/live_build_log/Application:Geo/python-ba semap/15.4/x86_64 ...
Does anybody know what's wrong here and how to fix.
Freedom in Peace
The error comes from (tried) expansion of the macros in /usr/lib/rpm/macros.d/macros.python{2,_all} %{py_requires} from the spec file is expanded to (macros.python2):
PreReq: python = %{py_ver}
%py_ver is an alias for %py_version, which reads:
%python_version %{_python_sysconfig_var %{expand:%__%{python_flavor}} py_version_short}
which uses:
%_python_sysconfig_var() %([ -x %1 ] && %1 -c "import sysconfig as s; print(s.get_config_var('%2'))" || echo "!!_%1_not_installed_!!")
Here we can see where the "_%1_not_installed_" is coming from. -> This should obviously read "!!_%{1}_not_installed_!!", as otherwise the substitution of %1 fails. The macro tries to call some python interpreter (checks for it with [-x ...]) to get the exact version, e.g. 2.7, 3.10. Apparently, the wanted interpreter is not found. Comparing with the Leap 15.3 build, and deducing from the fact "%py_requires" is defined in macros.python2, the result should be "PreReq: python = 2.7". Unfortunately, on Leap 15.4 the default python is 3.6, which is what "%python_flavor" refers to (on Leap, python_flavor takes one value during build, on TW it is assigned different values in turn, currently [3.8, 3.9, 3.10]). Now, if python3-base where installed, the macros could be expanded/run successfully, but the result would be:
PreReq: python = 3.6 which obviously is also wrong.
-> The %py_requires macro is broken on Leap 15.4. The two bugs in the python macros should be fixed of course. But still, you have to update the spec file to build with python 3.x for compatibility with Leap >= 15.4 and TW. Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019
On Montag, 4. Juli 2022 14:07:50 CEST Stefan Brüns wrote:
On Montag, 4. Juli 2022 13:12:23 CEST Dirk Stöcker wrote:
Hello,
for 15.4 I get a lot of packages (e.g. python packages) which fail with error: File must begin with "/": !!_%1_not_installed_!!/* [...] -> This should obviously read "!!_%{1}_not_installed_!!", as otherwise the substitution of %1 fails.
https://github.com/openSUSE/python-rpm-macros/issues/130
The macro tries to call some python interpreter (checks for it with [-x ...]) to get the exact version, e.g. 2.7, 3.10. [...] -> The %py_requires macro is broken on Leap 15.4.
https://github.com/openSUSE/python-rpm-macros/issues/131 Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019
participants (3)
-
Dirk Stöcker
-
Eric Schirra
-
Stefan Brüns