Bug 2185915 - Failure to expand rpm macro
Summary: Failure to expand rpm macro
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: fontawesome-fonts
Version: 40
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-11 14:56 UTC by Jerry James
Modified: 2024-11-07 15:41 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-07 15:41:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-9681 0 None None None 2023-04-12 05:38:40 UTC

Description Jerry James 2023-04-11 14:56:26 UTC
Description of problem:
This is not necessarily a bug in rpm, although I would appreciate some help figuring out the cause.  The new pre-push hook in Fedora git repos did not permit a push to the fontawesome-fonts repo.  See this bug report: https://pagure.io/fedpkg/issue/517.  As noted there, rpm seems to fail to expand %{fontpkgname1} and %{fontpkgname2}.

$ python3
Python 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpm
>>> spec=rpm.spec('fontawesome-fonts.spec')
>>> spec.sources
[('fontawesome-fonts-opentype-css.patch', 0, 2), ('60-%{fontpkgname2}.conf', 4, 1), ('60-%{fontpkgname1}.conf', 3, 1), ('README-Trademarks.txt', 2, 1), ('trademarks.py', 1, 1), ('https://github.com/FortAwesome/Font-Awesome/archive/6.4.0/Font-Awesome-6.4.0.tar.gz', 0, 1)]

Since the package builds successfully in both mock and koji, those macros are expanded successfully at RPM build time.

Version-Release number of selected component (if applicable):
rpm-4.18.0-1.fc37.x86_64
python3-rpm-4.18.0-1.fc37.x86_64

How reproducible:
Always

Steps to Reproduce:
1. sudo dnf install rpmdevtools
2. fedpkg clone fontawesome-fonts
3. cd fontawesome-fonts
4. spectool fontawesome-fonts.spec (or use rpm's python interface directly as shown above)

Actual results:
Source0: https://github.com/FortAwesome/Font-Awesome/archive/6.4.0/Font-Awesome-6.4.0.tar.gz
Source1: trademarks.py
Source2: README-Trademarks.txt
Source3: 60-%{fontpkgname1}.conf
Source4: 60-%{fontpkgname2}.conf
Patch0: fontawesome-fonts-opentype-css.patch

Expected results:
Source0: https://github.com/FortAwesome/Font-Awesome/archive/6.4.0/Font-Awesome-6.4.0.tar.gz
Source1: trademarks.py
Source2: README-Trademarks.txt
Source3: 60-fontawesome-6-free-fonts.conf
Source4: 60-fontawesome-6-brands-fonts.conf
Patch0: fontawesome-fonts-opentype-css.patch

Additional info:

Comment 1 Panu Matilainen 2023-04-12 05:38:26 UTC
The problem is that those sources refer to macros that are not yet defined at that point, because "%fontpkg -a" only gets called much later. This happens to "work" during an actual build due to side-effects from the way rpm parses specs with BuildArchitecture:, but relying on that is walking on very very thin ice.

Comment 2 Aoife Moloney 2023-11-23 01:39:25 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Aoife Moloney 2024-02-15 22:56:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 4 Fedora Admin user for bugzilla script actions 2024-10-17 01:55:44 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 5 Jerry James 2024-11-07 15:41:52 UTC
This is a duplicate, and the main bug has been fixed.  Closing this one.  Many thanks to the rpm team for the fix.


Note You need to log in before you can comment on or make changes to this bug.