Bug 1954999

Summary: RPM 4.17 regression: Convenient public macro %apply_patch removed without warning
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: igor.raits, mjw, mkolman, packaging-team-maint, pmatilai, pmoravco, python-maint, vmukhame, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-22 11:44:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miro Hrončok 2021-04-29 08:56:28 UTC
Description of problem:
With the update to RPM 4.17 alpha, our packages with Python interpreters (at least Python 3.5, 3.6, 3.7, 3.8, 3.9) no longer build.

See for example https://koschei.fedoraproject.org/package/python3.9?collection=f35

The error is:
+ %apply_patch -q /builddir/build/SOURCES/00189-use-rpm-wheels.patch
/var/tmp/rpm-tmp.Hz12p3: line 66: fg: no job control

It appears that a publicly available macro was just removed without any deprecation.

I've searched the release note and it only contains:
> Fix %apply_patch internal helper macro naming (#1357)

It doesn't say the macro was removed in a backwards incompatible manner. Please don't just remove working things like that :/

It was removed in https://github.com/rpm-software-management/rpm/pull/1512 presumably because it was reported as hard to use with %setup in https://github.com/rpm-software-management/rpm/issues/1357

%apply_patch works quite nicely with %autosetup -N. Please don't make us change several Python spec files that use it just for the sake of "this was never intended to be used" -- convenient macros are convenient, removing them makes packaging harder.


Version-Release number of selected component (if applicable): rpm-4.16.90-0.git15395.2.fc35


How reproducible: Easy


Steps to Reproduce:
1. Use %apply_patch in spec

Actual results:
Macro is expanded to literal "%apply_patch", shell says:
fg: no job control

Expected results:
Macro is expanded to an actual command to apply the patch (exact form depending on what value was used for %autosetup -S).
Patch is applied.

Comment 2 Vít Ondruch 2021-04-29 09:56:05 UTC
Ah, you actually mentioned it here, sorry :)

Comment 3 Miro Hrončok 2021-04-29 10:12:04 UTC
As a compromise, I think %autosetup could define %apply_patch. That way, one can only use it with an appropriate setting.

Comment 4 Miro Hrončok 2021-04-30 09:10:22 UTC
This is my proposal how to solve this: https://github.com/rpm-software-management/rpm/pull/1668

Comment 5 Miro Hrončok 2021-04-30 10:42:19 UTC
Temporary workaround in Python spec file: https://src.fedoraproject.org/rpms/python3.9/pull-request/60

Comment 6 Ben Cotton 2021-08-10 13:00:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 7 Panu Matilainen 2022-06-22 11:44:17 UTC
There are no plans to revert %apply_patch removal. It's been already worked around in packages and alternative, supported ways added upstream.

Comment 8 Miro Hrončok 2022-09-06 09:46:07 UTC
All Fedora versions have RPM 4.17+ now. So %autopatch witch positional arguments can now be used everywhere on Fedora.