Bug 1829430

Summary: The "fedora" namespace in redhat-rpm-config Lua files is confusing
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: redhat-rpm-configAssignee: Florian Festi <ffesti>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: ajax, carl, ffesti, fweimer, john.j5live, jonathan, j, nicolas.mailhot, pmatilai, praiskup, pviktori
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: 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 2020-04-29 14:24:19 UTC
There are "fedora" namespaced files in redhat-rpm-config:

$ repoquery --repo=rawhide -l redhat-rpm-config | grep fedora
/usr/lib/rpm/lua/fedora
/usr/lib/rpm/lua/fedora/common.lua
/usr/lib/rpm/lua/fedora/rpm
/usr/lib/rpm/lua/fedora/srpm
/usr/lib/rpm/lua/fedora/srpm/forge.lua
/usr/lib/rpm/macros.d/macros.fedora-misc
/usr/lib/rpm/macros.d/macros.fedora-misc-srpm

I find it very confuisng, since the package is called "redhat" and other files in /usr/lib/rpm are namespaced as such:

$ repoquery --repo=rawhide -l redhat-rpm-config | grep redhat
/usr/lib/rpm/redhat
/usr/lib/rpm/redhat/brp-ldconfig
/usr/lib/rpm/redhat/brp-mangle-shebangs
/usr/lib/rpm/redhat/brp-python-bytecompile
/usr/lib/rpm/redhat/brp-strip-lto
/usr/lib/rpm/redhat/config.guess
/usr/lib/rpm/redhat/config.sub
/usr/lib/rpm/redhat/dist.sh
/usr/lib/rpm/redhat/find-provides
/usr/lib/rpm/redhat/find-requires
/usr/lib/rpm/redhat/gpgverify
/usr/lib/rpm/redhat/macros
/usr/lib/rpm/redhat/redhat-annobin-cc1
/usr/lib/rpm/redhat/redhat-hardened-cc1
/usr/lib/rpm/redhat/redhat-hardened-ld
/usr/lib/rpm/redhat/rpmrc

Should we aim for a common namespace? The redhat-rpm-package will eventually be merged into RHEL and "fedora" namespace in it will be even weirder there.

We found this when trying to add our own Lua files and trying to figure out where to put them.

Comment 2 Igor Raits 2020-04-29 16:45:41 UTC
Well, we can move those files into a fedora-rpm-macros if you prefer (hopefully not) :)

basically having redhat there is just wrong since they originate from fedora and they are being developed inside fedora.

Comment 3 Miro Hrončok 2020-04-29 16:46:49 UTC
Posted to the packaging mailing list as well for exposure:

https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/WJ2LISXGGQGNFBURP2NSCH2GSXHQ7SGV/

Comment 4 Miro Hrončok 2020-04-29 16:48:51 UTC
> Well, we can move those files into a fedora-rpm-macros if you prefer (hopefully not) :)

Huh. We have an empty macros file in fedora-rpm-macros. That is nice.



I am not proposing to move this to fedora-rpm-macros. I am simply stating the obvious: This package is called "redhat" and it contains "fedora" macros. That is confusing.

Should we call our macros "fedora" or "redhat"? Not sure, but we should not mix the two.

Comment 5 Igor Raits 2020-04-29 16:51:03 UTC
(In reply to Miro Hrončok from comment #4)
> > Well, we can move those files into a fedora-rpm-macros if you prefer (hopefully not) :)
> 
> Huh. We have an empty macros file in fedora-rpm-macros. That is nice.
> 
> 
> 
> I am not proposing to move this to fedora-rpm-macros. I am simply stating
> the obvious: This package is called "redhat" and it contains "fedora"
> macros. That is confusing.

This is history, I think this used to be in RHL, then Fedora Core was created and package was there with this name and then it just kept to be like this because nobody wants to touch these things.

> 
> Should we call our macros "fedora" or "redhat"? Not sure, but we should not
> mix the two.

If you are developing them in Fedora and RHEL will just sync them there, I'd call them "fedora".

Comment 6 Nicolas Mailhot 2020-04-29 17:07:04 UTC
Hi Miro

The fedora namespace was chosen by rpm maintainers, 2 years ago, when the Go macros caused them to fix lua file deployment in rpm, and the next question became how to use the new shiny /usr/lib/rpm/lua/ directory (since lua mecanisms required namespacing to avoid collisions).

As explained by Igor the technical work on those file is done by the Fedora project, including non @rh people, so the lua namespace is correct.

That is also the case for most of the work on redhat-rpm-config nowadays but its maintainers are afraid to rename it. If we applied our current naming conventions, it would be named fedora-rpm-macros (the usual suspects, including tibbs and me, tried to get its naming fixed in the past and the changes were always NAKed).

If you feel strongly about it the naming clean up must come from FPC or FESCO because the package maintainers prefer leaving things unchanged.

Comment 7 Nicolas Mailhot 2020-04-29 17:25:15 UTC
As to why we need /usr/lib/rpm/lua instead of embedding lua code in the usual macro files, well

1. /usr/lib/rpm/lua gives you a library to share lua code
2. rpm will tell you the real line number lua code failed at when executing a file in /usr/lib/rpm/lua; with embedded lua code good luck getting rpm to state where the original code error is

So good lua macro code practice is to put as little lua code as possible in traditional rpm macro files, and escape as soon as possible to /usr/lib/rpm/lua land

Comment 8 Miro Hrončok 2020-04-29 17:36:57 UTC
> As to why we need /usr/lib/rpm/lua instead of embedding lua code in the usual macro files

Well, this is very nice feature, it allows me to have Lua functions and reuse them in different macros \o/



> If you feel strongly about it the naming clean up must come from FPC or FESCO because the package maintainers prefer leaving things unchanged.

I don't really feel strongly, but we should at least say in the packaging guidelines that Lua libraries like this belong to XYZ. Now I just need to guess. Possibly there could be a macro and than the name would just be moot.

Comment 9 Panu Matilainen 2020-05-06 08:22:58 UTC
The package gets consumed by RHEL and CentOS too, so calling it fedora-rpm-config would actually be worse than the current name. And from that perspective the "fedora" namespace isn't all that great (might've even been my suggestion, I don't recall) but we needed, and still do, *some* namespace that ties it to this family rather than some generic "util/system" style name.

Comment 10 Miro Hrončok 2020-05-06 08:58:28 UTC
In my head, I think that the namespace should be "redhat". That is the namespace of the package and namespace of some of the other files in it.

If "redhat" is or is not a good name for this package is out of scope here.

Comment 11 Panu Matilainen 2020-05-06 09:09:03 UTC
I don't disagree.

I also have no personal attachment to this one way or the other, if people want to go through the pain of renaming the namespace, or by splitting it to another package, by all means do. Splitting parts that are primarily community-developed might not be such a bad thing, AIUI at least Nicolas doesn't much like the current repo/development model of redhat-rpm-config anyhow.

Comment 12 Ben Cotton 2020-08-11 13:21:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 13 Ben Cotton 2021-11-04 17:39:11 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
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
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Ben Cotton 2022-05-12 15:13:09 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
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 '34'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 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 15 Ben Cotton 2022-08-09 13:10:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 16 Aoife Moloney 2023-11-23 00:03:10 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.