-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override releasever_{major,minor} with system-release provides #2198
Override releasever_{major,minor} with system-release provides #2198
Conversation
1a54f5b
to
4872d0a
Compare
Hi Evan and thanks for figuring this out! For me it sounds fine having new |
fa3f84f
to
0758ec7
Compare
ci-dnf-stack PR: rpm-software-management/ci-dnf-stack#1621 |
Cool, I've added the |
Tests are passing locally with rpm-software-management/libdnf#1689 and rpm-software-management/ci-dnf-stack#1621 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I find the requested behavior awful.
I would expect that releasever == releasever_major.releasever_minor
is always true.
I agree, it's gross. I would have preferred changing the RHEL releasever to 10.0 to be consistent with CentOS Stream, but that was shot down here: https://issues.redhat.com/browse/RHELBLD-16135. @carlwgeorge mentioned an "emergency backup plan" if we could not make this DNF change in time or had strong feelings against it. IIRC, that solution involves a scriptlet on epel-release that creates |
b352c77
to
99c2351
Compare
@kontura I agree with you on this, I would actually prefer that everything else correctly adapt to this paradigm, since it can be useful in a variety of ways. That said, it's not really the end of the world to have override knobs. I still don't understand why subscription-manager or rhc cannot handle this properly.
@evan-goode I'm not Carl, but I can answer this question. Requiring custom DNF variables makes integration very difficult for a variety of cases. These two reasons are why we want to avoid this:
|
Correct. We previously prototyped this for epel9. I just put up a draft PR to do this for epel10, mainly to get a scratch build for testing.
With the scriptlet approach, we would be writing a file that is arguably DNF configuration during a DNF transaction. I'm concerned about what side effects that can have, or if it's a safe approach at all. It does appear to work fine in limited testing. If you're not concerned about this as a DNF developer, then I would feel much better about it. Another slight concern is that we'll be running the scriptlet on every dnf transaction that has a package with a file in I was initially concerned about the impact of using a file trigger scriptlet with rpm-ostree, but with the speedy adoption of bootc and the fact that this will on be needed on EL10, I'm not sure we need to worry about it anymore. |
How do these tools handle the |
They don't. At least in the cases where repo files aren't used directly, new repo definitions are used with |
If it targeted the file, it would never fire, since |
File trigger prefix matching explicitly includes symlinks, and doesn't check if the matching file has been modified, only that it's part of the transaction (or already exists on the system in the case of the package with the trigger being installed). But it's a moot point since it only works with directories. |
I personally wouldn't worry about creating a file in The changes look good to me now but I am confused by the failing Packit builds. |
It does fail reliably in COPR builds, I have bisected it and it seems to be caused by 90604c3. |
I think it's the use of |
We'll need to bump the libdnf version for the new API function and |
This allows setting a releasever_major or releasever_minor independent of releasever, which is needed by EPEL. Related: https://issues.redhat.com/browse/RHEL-68034
The releasever_major and releasever_minor substitution variables are usually derived by splitting releasever on the first `.`. However, to support EPEL 10 [1], we would like a way for distributions to override these values. Specifically, we would like RHEL 10 to have a releasever of `10` with a releasever_major of `10` and a releasever_minor of `0` (later incrementing to `1`, `2`, to correspond with the RHEL minor version). This commit adds a new API function, `detect_releasevers`, which derives releasever, releasever_major, and releasever_minor from virtual provides on the system-release package (any of `DISTROVERPKG`). The detection of releasever is unchanged. releasever_major and releasever_minor are specified by the versions of the `system-release-major` and `system-release-minor` provides, respectively. If the user specifies a `--releasever=X.Y` on the command line, the distribution settings for releasever, releasever_major, and releasever_minor will all be overridden: releasever will be set to X.Y, releasever_major will be set to X, and releasever_minor will be set to Y, same as before. If a user wants to specify a custom releasever_major and releasever_minor, they have to set all three with `--setopt=releasever=X --setopt=releasever_major=Y --setopt=releasever_minor=z`, taking care to put `releasever_major` and `releasever_minor` after `releasever` so they are not overridden. [1] https://issues.redhat.com/browse/RHEL-68034
Allows the user to override the $releasever_major and $releasever_minor variables on the command line, like --releasever.
Adds dnf.rpm.detect_releasevers to the API docs and mention it is now preferred over dnf.rpm.detect_releasever. Updates examples/install_extension.py to use detect_releasevers and set the releasever_major and releasever_minor substitution variables.
99c2351
to
4c37ce8
Compare
libdnf already got a version bump to 0.74.0 after this change, and dnf master now |
The
releasever_major
andreleasever_minor
substitution variables are usually derived by splittingreleasever
on the first.
. However, to support EPEL 10 [1], we would like a way for distributions to override these values. Specifically, we would like RHEL 10 to have a releasever of10
with a releasever_major of10
and a releasever_minor of0
(later incrementing to1
,2
, to correspond with the RHEL minor version).This commit adds a new API function,
detect_releasevers
, which derivesreleasever
,releasever_major
, andreleasever_minor
from virtual provides on the system-release package (any ofDISTROVERPKG
). The detection of releasever is unchanged.releasever_major
andreleasever_minor
are specified by the versions of thesystem-release-major
andsystem-release-minor
provides, respectively.If the user specifies a
--releasever=X.Y
on the command line, the distribution settings forreleasever
,releasever_major
, andreleasever_minor
will all be overridden:releasever
will be set to X.Y,releasever_major
will be set to X, andreleasever_minor
will be set to Y, same as before.If a user wants to specify a custom
releasever_{major,minor}
, they have to set all three with--setopt=releasever=X --setopt=releasever_major=Y --setopt=releasever_minor=z
, taking care to putreleasever_major
andreleasever_minor
afterreleasever
so they are not overridden. This is admittedly not ideal, but I can't think of another solution to this problem that preserves the following properties:releasever_{major,minor}
are derived by splittingreleasever
. This behavior was added in Split $releasever to $releasever_major and $releasever_minor #1989.--releasever
is specified on the command line,releasever_{major,minor}
should be set accordingly, even ifreleasever{major_minor}
are specified by provides in the distribution system-release package.Maybe we could add
--releasever_major=
and--releasever_minor
options that take priority over--releasever
to improve point (3).Another caveat to allowing overriding
releasever_{major,minor}
is existing API users usingdetect_releasever
. Take this snippet from ourdoc/examples/install_extension.py
:Now, in order to detect the correct
releasever_{major,minor}
, the correct code would beRequires rpm-software-management/libdnf#1689.
[1] https://issues.redhat.com/browse/RHEL-68034