Skip to content
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

Depexts detection does not work on CentOS when EPEL is involved #4669

Closed
kit-ty-kate opened this issue May 18, 2021 · 2 comments · Fixed by #4679
Closed

Depexts detection does not work on CentOS when EPEL is involved #4669

kit-ty-kate opened this issue May 18, 2021 · 2 comments · Fixed by #4679
Assignees
Milestone

Comments

@kit-ty-kate
Copy link
Member

Detected in ocaml/opam-repository#18704

The way things work in CentOS wrt opam is that when EPEL is needed, we install it first (through epel-release) then we install the package required. However the new depexts detection in opam does not find the package since it is not yet available (as it is in the EPEL repository) and thus mark it as unavailable.

I'm not entirely sure how to deal with that here..

@dra27
Copy link
Member

dra27 commented May 18, 2021

Hmm. Depending on epel-release as a depext may work for CentOS, but that already doesn't work for RHEL (you're supposed to install the epel-release rpm explicitly to enable it, IIRC).

This can't be fixed in depext detection (at least quickly) - it's fundamentally about configuring the package manager which is not what this is for. Essentially the OS package manager has not been "correctly" configured (it'd be like having the wrong apt repo configuration)

Practical thoughts, though:

  • Change the default invariant to pull in "epel-release" on CentOS - i.e. effectively have opam init request to set that up - so we "kick" users to get EPEL enabled before it's definitely needed. However, I'm not convinced we should do this - there's a reason EPEL exists, and doing this semi-automatically rather violates it.
  • See what needs doing to get opam itself into EPEL. According to https://src.fedoraproject.org/rpms/opam, the opam package is orphaned. If the main way to install opam is via EPEL then most users are going to get it by default!
  • Improve the error handling (possibly for Alpine's benefit too?) to make better suggestions when the packages can't be found - perhaps adding a concept of enabled repos to depext? It feels like a rabbit-hole in something that's already quite complicated, though!

@dra27
Copy link
Member

dra27 commented May 18, 2021

Referencing all the relevant parts of this. This part, pulled in from ocaml-opam/opam-depext#77, is not working (the special-casing needs to be lifted, executed - i.e. epel-release installed first, and then followed by a fresh query for the available package list for it to work):

| Centos ->
(* TODO: check if they all declare "rhel" as primary family *)
(* When opam-packages specify the epel-release package, usually it
means that other dependencies require the EPEL repository to be
already setup when yum-install is called. Cf. opam-depext/#70,#76. *)
let epel_release = "epel-release" in
let install_epel rest =
if List.mem epel_release packages then
["yum", "install"::yes ["-y"] [epel_release]] @ rest
else rest
in
install_epel
["yum", "install"::yes ["-y"]
(OpamStd.String.Set.of_list packages
|> OpamStd.String.Set.remove epel_release
|> OpamStd.String.Set.elements);
"rpm", "-q"::"--whatprovides"::packages], None

There's also the original issues in ocaml-opam/opam-depext#70 and ocaml-opam/opam-depext#76.

I'm rather on @avsm's side in ocaml-opam/opam-depext#77 (comment) - I'm not convinced opam-depext should ever have been doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants