Bug 1757267
| Summary: | glibc: Reconsider the use of Requires(Pre): setup to fix the case where user tries to remove setup. | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Carlos O'Donell <codonell> |
| Component: | glibc | Assignee: | DJ Delorie <dj> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | aoliva, arjun, ashankar, astepano, codonell, dj, fweimer, james.antill, law, mfabian, mnewsome, packaging-team-maint, pfrankli, pmatilai, qe-baseos-security, rth, siddhesh, tmraz, yaneti |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | glibc-2.30.9000-14 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1755986 | Environment: | |
| Last Closed: | 2019-11-05 14:56:08 UTC | 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
Carlos O'Donell
2019-10-01 01:43:13 UTC
DJ, Could you please have a look at a rawhide build with Requires(Pre): setup changed to Requires: setup. They key issue here is going to be testing an upgrade and downgrade on a box with that glibc. Then if that works move it into Rawhide and see what breaks. Thanks. Those pre-dependencies are only good for breaking dependency loops, and that's probably the reason it's there for in the first place. The question is: will glibc work if setup happens to get installed after it, due to dependency loops being cut? There's nothing wrong with adding a second requires without the (pre) qualifier to fix the setup package being removable, that might well be the closest thing to truth considering what it is. Another possibility is using Requires(pre,post) which will also force it to stay after installation. RPM 4.8 removed Prereq: and added Requires(pre) but they do different
things. GLIBC 2.7.90-8 converted from Prereq to Requires(pre) but not
quite correctly. The nscd package has its own pre/post requires; of
the remaining subpackages, only glibc-headers has a %pre that looks at
the filesystem, all other scriptlets (besides nscd) happen while glibc
is "installed". So I suspect the following patch is correct, which
sets a general dependency on basesystem, as well as a Requires(pre) in
glibc-headers on it.
diff --git a/glibc.spec b/glibc.spec
index 11865a4..ab19929 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -174,7 +174,7 @@ Requires: glibc-common = %{version}-%{release}
# Various components (regex, glob) have been imported from gnulib.
Provides: bundled(gnulib)
-Requires(pre): basesystem
+Requires: basesystem
# This is for building auxiliary programs like memusage, nscd
# For initial glibc bootstraps it can be commented out
@@ -356,6 +356,7 @@ which is highly discouraged.
Summary: Header files for development using standard C libraries.
Provides: %{name}-headers(%{_target_cpu})
Requires(pre): kernel-headers
+Requires(pre): basesystem
Requires: kernel-headers >= 2.2.1, %{name} = %{version}-%{release}
BuildRequires: kernel-headers >= 3.2
> RPM 4.8 removed Prereq: and added Requires(pre) but they do different things. Rpm 4.8 did no such thing, Prereq was deprecated around and the fine-grained qualifiers added somehwere around rpm 4.0 - 4.1. 4.8 might've made the deprecation more verbose. Requires(pre) (and other similar "scriptlet dependencies") are only ever required to break dependency loops for ordering. When no loops are present, the order is unaffected. The catch with Requires(pre) is that it tells rpm that such a dependency can be removed once the install has completed, which is fine if it's a scriptlet-only dependency which is sometimes the case, but if the pre-dependency is to break a dependency loop then it's not. The glibc basesystem dependency is of the latter kind, there's a well-known and fragile dependency loop between the "early bootstrap" packages, I'd think twice before removing it. Like I noted in comment #2, I'd suggest either adding a second requires on basesystem without the "pre", or turn it into Requires(pre,postun) which prevents it from being removed after installation as well. For glibc-headers there's no point in depending on basesystem, but there is a missing Requires(pre) is coreutils because it actually uses 'rm' there. I certainly don't mind putting in all the requires, as a belt-and-suspenders solution. I just didn't want to do it blindly ;-) This is fixed in Fedora Rawhide with this commit:
commit eb580e4bc609c9b07278527cd90a74db548a23e2
Author: DJ Delorie <dj>
Date: Thu Oct 24 13:05:55 2019 -0400
Add Requires on basesystem for main package (#1757267)
Add Requires on coreutils for glibc-headers (uses rm)
The solution is for glibc to require basesystem.
|