Bug 2291927
| Summary: | deprecation warning in %postun when updating libgcc via dnf | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mark E. Fuller <mark.e.fuller> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 42 | CC: | blind-confused, customercare, dmalcolm, fweimer, jakub, jlaw, josmyers, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, noloader, rgibons, sipoyare |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Mark E. Fuller
2024-06-12 11:30:15 UTC
*** Bug 2337295 has been marked as a duplicate of this bug. *** *** Bug 2338127 has been marked as a duplicate of this bug. *** *** Bug 2343197 has been marked as a duplicate of this bug. *** (In reply to Mark E. Fuller from comment #0) > warning: posix.wait(): .fork(), .exec(), .wait() and .redirect2null() are > deprecated, use rpm.execute() instead This RPM warning would be A LOT more helpful if it linked to: https://rpm-software-management.github.io/rpm/manual/lua.html#executepath--arg1- Trying to find that with a web search is hard. I think we want this fix: --- a/gcc.spec +++ b/gcc.spec @@ -2429,22 +2429,12 @@ fi # libgcc is installed %post -n libgcc -p <lua> if posix.access ("/sbin/ldconfig", "x") then - local pid = posix.fork () - if pid == 0 then - posix.exec ("/sbin/ldconfig") - elseif pid ~= -1 then - posix.wait (pid) - end + rpm.execute('/sbin/ldconfig') end %postun -n libgcc -p <lua> if posix.access ("/sbin/ldconfig", "x") then - local pid = posix.fork () - if pid == 0 then - posix.exec ("/sbin/ldconfig") - elseif pid ~= -1 then - posix.wait (pid) - end + rpm.execute('/sbin/ldconfig') end %ldconfig_scriptlets -n libstdc++ (In reply to Jonathan Wakely from comment #4) > --- a/gcc.spec > +++ b/gcc.spec > @@ -2429,22 +2429,12 @@ fi > # libgcc is installed > %post -n libgcc -p <lua> > if posix.access ("/sbin/ldconfig", "x") then > - local pid = posix.fork () > - if pid == 0 then > - posix.exec ("/sbin/ldconfig") > - elseif pid ~= -1 then > - posix.wait (pid) > - end > + rpm.execute('/sbin/ldconfig') > end You should check if you still need to run /sbin/ldconfig. Fedora default is to ship the symbolic links pre-installed. If you need to keep this, you need to check if rpm.execute ~= nil and use the old code otherwise, to support in-place upgrades from older Fedora release/RHEL 10. rpm.execute is in rpm >= 4.15 which mean fedora 31 had it. I don't think we support in-place upgrades from F31 to F41. RHEL 9 has rpm 4.16 so this would only be a problem for in-place upgrade from RHEL 8 to some future version of RHEL that would rebase on the Fedora spec. (In reply to Jonathan Wakely from comment #6) > rpm.execute is in rpm >= 4.15 which mean fedora 31 had it. I don't think we > support in-place upgrades from F31 to F41. RHEL 9 has rpm 4.16 so this would > only be a problem for in-place upgrade from RHEL 8 to some future version of > RHEL that would rebase on the Fedora spec. For Fedora using DNF (not RPM), Fedora supports a stride up to two. The most someone should perform is F31 -> F33. Also see <https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/>. I don't think I've seen Fedora documentation on using RPM to perform a system upgrade. Or I don't recall reading it. (In reply to Jonathan Wakely from comment #6) > rpm.execute is in rpm >= 4.15 which mean fedora 31 had it. I don't think we > support in-place upgrades from F31 to F41. RHEL 9 has rpm 4.16 so this would > only be a problem for in-place upgrade from RHEL 8 to some future version of > RHEL that would rebase on the Fedora spec. Ahh, I didn't realize that rpm.execute is not recent. With glibc, we also prefer the output redirection feature, and that is definitely quite recent. Yes rpm.spawn needs rpm >= 4.20 So perhaps
--- gcc.spec 2025-01-30 18:47:39.793081153 +0100
+++ gcc.spec 2025-01-31 17:55:39.378072567 +0100
@@ -2424,28 +2424,20 @@ if [ $1 = 0 ]; then
%{_sbindir}/update-alternatives --remove go %{_prefix}/bin/go.gcc
fi
+%{?ldconfig:
# Because glibc Prereq's libgcc and /sbin/ldconfig
# comes from glibc, it might not exist yet when
# libgcc is installed
%post -n libgcc -p <lua>
-if posix.access ("/sbin/ldconfig", "x") then
- local pid = posix.fork ()
- if pid == 0 then
- posix.exec ("/sbin/ldconfig")
- elseif pid ~= -1 then
- posix.wait (pid)
- end
+if posix.access ("%ldconfig", "x") then
+ rpm.execute ("%ldconfig")
end
%postun -n libgcc -p <lua>
-if posix.access ("/sbin/ldconfig", "x") then
- local pid = posix.fork ()
- if pid == 0 then
- posix.exec ("/sbin/ldconfig")
- elseif pid ~= -1 then
- posix.wait (pid)
- end
+if posix.access ("%ldconfig", "x") then
+ rpm.execute ("%ldconfig")
end
+}
%ldconfig_scriptlets -n libstdc++
then to make it compatible with %ldconfig_scriptlets in /usr/lib/rpm/macros.d/macros.ldconfig ?
*** Bug 2344146 has been marked as a duplicate of this bug. *** This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle. Changing version to 42. also in f41 *** Bug 2391722 has been marked as a duplicate of this bug. *** |