Bug 2108441 - macros.kmp: latest_kernel is slow and always run
Summary: macros.kmp: latest_kernel is slow and always run
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-srpm-macros
Version: 42
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Denys Vlasenko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-19 05:13 UTC by Etienne CHAMPETIER
Modified: 2025-08-12 02:30 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-08-12 02:30:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Etienne CHAMPETIER 2022-07-19 05:13:01 UTC
Description of problem:
If not defined, kernel_version == last_kernel, but last_kernel command line always runs
I'm using rpmspec to list the generated rpms and generating make target on the fly, so running `rpm -qa` on each kmod spec slows down quite a bit the process.

Version-Release number of selected component (if applicable):
kernel-rpm-macros-205-14.fc36.noarch.rpm

How reproducible:
100%

Steps to Reproduce:
1. have a spec file with kernel_module_package and kernel_version defined

Actual results:
last_kernel runs because it's a %global
Also last_kernel uses `rpm -qa` which is pretty slow

Expected results:
When kernel_version is defined, last_kernel doesn't run

Additional info:
We can speed up last_kernel with something like
```
rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel-rt-devel kernel-aarch64-devel kernel-devel | /usr/lib/rpm/redhat/rpmsort -r 2>/dev/null | head -n1
```
We can also move it and make it a %define instead of a %global so it doesn't run when not used

Comment 1 Ben Cotton 2023-04-25 17:37:25 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
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 '36'.

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 36 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 2 Ludek Smid 2023-05-25 19:04:21 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Fedora Release Engineering 2023-08-16 08:08:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 5 Aoife Moloney 2024-11-08 10:44:01 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
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 '39'.

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 39 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 6 Etienne CHAMPETIER 2024-12-27 16:32:15 UTC
How can we move forward with this ?
Pull request was provided more than 1 year ago, it's a 2 lines change.
I also have a ticket open on RedHat side https://issues.redhat.com/browse/RHEL-57823 (support case 03922047) but still not planned either

Comment 7 Aoife Moloney 2025-02-26 12:52:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


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