Skip to content

Display a message on CentOS if EPEL isn't enabled and depexts aren't available - #4679

Merged
rjbou merged 1 commit into
ocaml:masterfrom
dra27:epel-release
Jun 6, 2021
Merged

rjbou merged 1 commit into
ocaml:masterfrom
dra27:epel-release

Conversation

@dra27

@dra27 dra27 commented May 24, 2021

Copy link
Copy Markdown
Member

Provides the workaround for #4669 discussed last week. This PR temporarily sits on #4678, as it uses some of the refactorings - only 34d5caf is new.

With this patch, on CentOS without EPEL enabled you now see:

dra@thor:~/opam$ opam install conf-capnproto
[ERROR] Package conf-capnproto depends on the unavailable system package
        'capnproto'. You can use `--no-depexts' to attempt installation anyway.
        On CentOS/RHEL, many packages may assume that the Extra Packages for
        Enterprise Linux (EPEL) repository has been enabled. This is typically
        done by installing the 'epel-release' package. Please see
        https://fedoraproject.org/wiki/EPEL for more information.

Most of the change is refactoring the existing API to separate the computation of what's happened from formatting the message (so that OpamClient can semantically what happened).

I've only applied this to OpamClient.install_t and OpamSolution.check_availability - I'm not sure if some of the other functions in OpamClient want this or not.

@dra27 dra27 added the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label May 24, 2021
@dra27 dra27 added this to the 2.1.0~rc milestone May 24, 2021
@dra27 dra27 linked an issue May 24, 2021 that may be closed by this pull request
Comment thread src/state/opamSysInteract.ml Outdated
Some "On CentOS/RHEL, many packages may assume that the Extra Packages \
for Enterprise Linux (EPEL) repository has been enabled. This is \
typically done by installing the 'epel-release' package. Please \
see https://fedoraproject.org/wiki/EPEL for more information"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're going to need a number of these workarounds for different operating systems (e.g. Alpine's edgecommunity, Brew's custom taps and so on). Would it be feasible to move this into a package {message} entry somehow rather than hardcoding Fedora-specific logic in the client? Obviously, other opam-repositories other than OCaml's may not make this assumption as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The logic here is being embedded in the section of the opam client which deals with the logic for specific package managers, so I think it is in the right place for now?

It's not feasible between now and releasing 2.1, no. At the moment, for EPEL specifically, this is fixing a regression in behaviour because of a poor decision in 2017 to handle this in opam-depext! All this PR is doing (the actual new code is only a tiny bit on an error message) is displaying this message if it thinks it might be helpful. We should definitely follow this up with better (and generic) tagging, or some such, of depexts, though.

My understanding is that the Alpine repos work much better because the error message from apk clearly explains what needs doing (i.e. this PR brings dnf up to apk's standard 🙂). ppas, custom taps, etc. would be a completely new feature - EPEL is an official repository system (as, again, if I understand correctly, edgecommunity is an official repo, it's just not necessarily enabled by default?).

@dra27

dra27 commented May 24, 2021

Copy link
Copy Markdown
Member Author

(rebased to pick up a fix in #4678)

@dra27
dra27 force-pushed the epel-release branch 2 times, most recently from d03f42f to 725ee63 Compare May 24, 2021 20:52
@dra27 dra27 closed this May 25, 2021
@dra27 dra27 reopened this May 25, 2021
@rjbou
rjbou requested a review from AltGr May 26, 2021 11:29
@dra27 dra27 removed the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label May 27, 2021
@rjbou rjbou added the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label Jun 6, 2021
The opam-depext plugin used to hoist the epel-release package to
work-around this, but this is incompatible with checking the
availability. The special-case installation of epel-release is somewhat
unfortunate - it's now replaced with a guided approach suggesting what
might need changing.
@rjbou
rjbou merged commit e7b42cb into ocaml:master Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: QUEUED Pending pull request, waiting for other work to be merged or closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Depexts detection does not work on CentOS when EPEL is involved

3 participants