Skip to content

genpapifdef: Resolve install conflict between i686 and x86_64 papi-de…#569

Merged
Treece-Burgess merged 1 commit intoicl-utk-edu:masterfrom
kelyons:master
Mar 6, 2026
Merged

genpapifdef: Resolve install conflict between i686 and x86_64 papi-de…#569
Treece-Burgess merged 1 commit intoicl-utk-edu:masterfrom
kelyons:master

Conversation

@kelyons
Copy link
Contributor

@kelyons kelyons commented Mar 5, 2026

…vel RPMs

/usr/include/f77papi.h, /usr/include/f90papi.h, /usr/include/fpapi.h are generated at build time by a perl helper script src/maint/genpapifdef.pl.

The order of the keys in the %defs and %presets hashes are not guaranteed by the perl interpreter to be identical on the i686 and x86_64 architectures. This results in a different header file being generated by the genpapifdef.pl script on each architecture. When these files are included in a papi-devel RPM package, RPM views the files as conflicting and will not allow installation of both the i686 and x86_64 packages at the same time.

This patch sorts the keys of the %defs and %presets hashes prior to looping through them, which makes the order consistent on i686 and x86_64. Since the order of the keys is consistent, the same header files are produced, RPM no longer views the files as conflicting, and it is possible to install both the i686 and x86_64 papi-devel packages at the same time.

Orabug: 39036654

Reviewed-by: Alex Burmashev alexander.burmashev@oracle.com

Pull Request Description

Author Checklist

  • [X ] Description
    We are shipping both i686 and x86_64s builds of papi RPMs as part of Oracle Linux. Currently it is not possible to install papi-devel.i686 and papi-devel.x86_64 at the same time as some header files conflict:

Total download size: 5.8 M
Installed size: 20 M
Downloading Packages:
(1/10): papi-7.2.0-1.el9.x86_64.rpm 2.6 MB/s | 170 kB 00:00
(2/10): libpfm-4.13.0-5.el9.i686.rpm 2.3 MB/s | 282 kB 00:00
(3/10): libpfm-4.13.0-5.el9.x86_64.rpm 2.1 MB/s | 350 kB 00:00
(4/10): papi-libs-7.2.0-1.el9.i686.rpm 5.4 MB/s | 216 kB 00:00
(5/10): papi-devel-7.2.0-1.el9.i686.rpm 1.8 MB/s | 373 kB 00:00
(6/10): papi-devel-7.2.0-1.el9.x86_64.rpm 2.0 MB/s | 373 kB 00:00
(7/10): papi-libs-7.2.0-1.el9.x86_64.rpm 1.6 MB/s | 209 kB 00:00
(8/10): libgcc-11.5.0-14.0.1.el9.i686.rpm 2.8 MB/s | 104 kB 00:00
(9/10): glibc-2.34-245.0.1.el9.i686.rpm 10 MB/s | 1.9 MB 00:00
(10/10): glibc-gconv-extra-2.34-245.0.1.el9.i68 8.3 MB/s | 1.8 MB 00:00

Total 11 MB/s | 5.8 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Transaction test error:
file /usr/include/f77papi.h conflicts between attempted installs of papi-devel-7.2.0-1.el9.x86_64 and papi-devel-7.2.0-1.el9.i686
file /usr/include/f90papi.h conflicts between attempted installs of papi-devel-7.2.0-1.el9.x86_64 and papi-devel-7.2.0-1.el9.i686
file /usr/include/fpapi.h conflicts between attempted installs of papi-devel-7.2.0-1.el9.x86_64 and papi-devel-7.2.0-1.el9.i686

The headers conflict because the content differs due to the keys of hashes being in different order on the two architectures.

This patch sorts the hash keys before writing the headers, resulting in identical files on both architectures, and no RPM conflict.

  • [X ] Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • [X ] Tests
    The PR needs to pass all the tests

@Treece-Burgess
Copy link
Contributor

Hello @kelyons, thank you for submitting this PR. I will take a look at it.

@Treece-Burgess Treece-Burgess self-requested a review March 6, 2026 02:24
Copy link
Contributor

@Treece-Burgess Treece-Burgess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have access to an Oracle Linux distribution and therefore I cannot directly recreate the error encountered. However, from testing the master branch, the files fpapi.h, f77papi.h, and f90papi.h will result in file contents differing in order on each PAPI build (encountered on RHEL 8.10 with an AMD EPYC 7402).

Further, from rpm.org and noted in this PR multiple install versions will cause an error unless files match exactly.

Adding sort allows for the files fpapi.h, f77papi.h, and f90papi.h to be identical for each PAPI build. Sanity testing is below.

Illyad at Oregon (OS: RHEL 8.10, CPU: AMD EPYC 7402, GCC 8.5.0):

  • PAPI Build: ✅
  • PAPI Utilities*: ✅ (matches master)
  • ftests: ✅ (comparable to master)

Pinwheel at Oregon (OS: Debian 12 , CPU: AMD EPYC 7513, GCC 12.2.0)

  • PAPI Build: ✅
  • PAPI Utilities*: ✅ (matches master)
  • ftests: ✅ (comparable to master)

* - papi_component_avail, papi_native_avail, papi_avail, papi_command_line

…vel RPMs

/usr/include/f77papi.h, /usr/include/f90papi.h, /usr/include/fpapi.h are generated at build time by a perl helper script src/maint/genpapifdef.pl.

The order of the keys in the %defs and %presets hashes are not guaranteed by the perl interpreter to be identical on the i686 and
x86_64 architectures. This results in a different header file being generated by the genpapifdef.pl script on each architecture.  When these files are included in a papi-devel RPM package, RPM views the files as conflicting and will not allow installation of both the i686 and x86_64 packages at the same time.

This patch sorts the keys of the %defs and %presets hashes prior to looping through them, which makes the order consistent on i686 and x86_64.  Since the order of the keys is consistent, the same header files are produced, RPM no longer views the files as conflicting, and it is possible to install both the i686 and x86_64 papi-devel packages at the same time.

Orabug: 39036654

Signed-off-by: Kevin Lyons <kevin.x.lyons@oracle.com>
Reviewed-by: Alex Burmashev <alexander.burmashev@oracle.com>
@Treece-Burgess Treece-Burgess merged commit a6bc4ab into icl-utk-edu:master Mar 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants