ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.23k stars 351 forks source link

opam gets stuck on 'yum -q -C list' for minutes #4888

Closed edwintorok closed 2 years ago

edwintorok commented 2 years ago

If your issue concerns a package not building, please report to https://github.com/ocaml/opam-repository/issues or to the package maintainer unless you are confident it is an issue in the opam tool itself.

opam config report
# opam config report
# opam-version         2.1.0 
# self-upgrade         no
# system               arch=x86_64 os=linux os-distribution=fedora os-version=35
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 8
# repositories         1 (http), 1 (local), 4 (version-controlled) (default repo at c7b1bb0d)
# pinned               2 (git)
# current-switch       4.12.0+domains

Running something as simple as 'opam search oauth2' took 6m26s. Looking at opam with strace shows that it is waiting for a process, and that process is:

edwin      42633   42626  0 22:00 pts/2    00:00:00 /usr/bin/python3 /usr/bin/yum -q -C list

Running the command manually reveals why:

yum -q -C list
Importing GPG key 0x5A278D9C:
 Userid     : "Pavlo Rudyi <paulcarroty@riseup.net>"
 Fingerprint: 1302 DE60 2318 89FE 1EBA CADC 5467 8CF7 5A27 8D9C
 From       : https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg
Is this ok [y/N]: 

It prints a question that never gets a reply. There doesn't seem to be a way to 'accept' this question (I can manually run the command and accept it, but on next run it just asks again. Only happens when run wtih -C'.

The repo is one I added manually (not sure why it is picky only about this one, never asks about the other rpmfusion repo that I added:

 yum repolist
repo id                                                         repo name
fedora                                                          Fedora 35 - x86_64
fedora-cisco-openh264                                           Fedora 35 openh264 (From Cisco) - x86_64
gitlab.com_paulcarroty_vscodium_repo                            gitlab.com_paulcarroty_vscodium_repo
rpmfusion-free                                                  RPM Fusion for Fedora 35 - Free
rpmfusion-free-updates                                          RPM Fusion for Fedora 35 - Free - Updates
updates                                                         Fedora 35 - x86_64 - Updates

Anyway this can be solved easily by redirecting the stdin of yum to be /dev/null: then it immediately proceeds to printing the output (another way is to add -y so you get yum -q -C list.

This happens on Fedora 35.

edwintorok commented 2 years ago

Ah I see this is fixed already: https://github.com/ocaml/opam/commit/78093ea4299fb7a50bb5d9e939f39b24bc5cacbe I'll open a bug on Fedora's bugzilla asking for a backport.

rjbou commented 2 years ago

As you saw, the fix is already on master, and it is integrated in opam 2.1.1 that will be releases in few days,

edwintorok commented 2 years ago

Thanks, I've opened a bug on Fedora's bugtracker to make them aware (https://bugzilla.redhat.com/show_bug.cgi?id=2020451). If there is a new upstream release soon thats good.