Description of problem: In pyproject-rpm-macros-0-49, passing a large number of arguments to %py3_check_import on multiple lines no longer works: > %{py3_check_import foo > bar > bat > baz} This was useful for packages that had a huge number of mostly-independent submodules to test-import but preferred not to invoke %py3_check_import many times (since a single invocation improves performance and reduces clutter in the build log). This regression will cause several packages to FTBFS if it reaches stable releases. Version-Release number of selected component (if applicable): 0-49 How reproducible: Steps to Reproduce: 1. Find or make a package that uses %py3_check_import this way. For example, see python-hdfs in Fedora 35, 34, or 33. 2. Build with pyproject-rpm-macros-0-49 (currently: fedpkg mockbuild --enablerepo=local). Actual results: Build fails with an error message mentioning the first module that is listed on a line after %py3_check_import, e.g.: > + /usr/bin/python3 -s /usr/lib/rpm/redhat/import_all_modules.py hdfs > Check import: hdfs > + hdfs.client > /var/tmp/rpm-tmp.LsRHaZ: line 40: hdfs.client: command not found Expected results: Build succeeds. Additional info: This was first noted in the following comment: https://bugzilla.redhat.com/show_bug.cgi?id=2018551#c4 Bodhi updates for pyproject-rpm-macros-0-49: F36: https://bodhi.fedoraproject.org/updates/FEDORA-2021-6d843c39b0 F35: https://bodhi.fedoraproject.org/updates/FEDORA-2021-fd8d8c5f66 F34: https://bodhi.fedoraproject.org/updates/FEDORA-2021-22b68be2d5 F33: https://bodhi.fedoraproject.org/updates/FEDORA-2021-d085ce09ef
By grepping spec files with > rg '%\{py3_check_import.*[^}]$' I think the affected packages will be: - python-opencensus-proto - python-hdfs - python-googleapis-common-protos (also affected by https://bugzilla.redhat.com/show_bug.cgi?id=2018551) Workarounds include: - Call %py3_check_import many times - Accept a (perhaps very) long line in the spec file - Switch to %pyproject_check_import (ideal!)
A fix is probably to wrap this %{?**} [0] with some Lua, previous implementation used %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)} [1], this could be simpler ...gsub('%s+', ' ')) [0] https://src.fedoraproject.org/rpms/python-rpm-macros/blob/2d0673afb17814e4bd6b7a281574b1d0e1fdb3e3/f/macros.python3#_80 [1] https://src.fedoraproject.org/rpms/python-rpm-macros/blob/9b797df44dc6c184c5181f10bee24461287f84f3/f/macros.python3#_78
https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/121
FEDORA-2021-70e7a5dae0 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2021-70e7a5dae0
FEDORA-2021-70e7a5dae0 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.