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

opam list --installed --short --safe --color=never ocp-indent ocp-index merlin takes an unreasonable amount of time when ocp-index is missing #5314

Closed
n-osborne opened this issue Oct 14, 2022 · 4 comments · Fixed by #5317

Comments

@n-osborne
Copy link

The command opam list --installed --short --safe --color=never ocp-indent ocp-index merlin is run by the default addition to the Vim configuration for Merlin. Vim was then very slow to start.

The reason is that when ocp-index is missing, this command takes an unreasonable amount of time:

$ opam list --installed --short --debug-level=2 --color=never ocp-indent ocp-index merlin
00:00.022  CLI                             Parsing CLI version 2.1
00:00.022  GSTATE                          LOAD-GLOBAL-STATE @ /home/nicolas/.opam
00:00.022  SYSTEM                          LOCK /home/nicolas/.opam/lock (none => read)
00:00.023  RSTATE                          LOAD-REPOSITORY-STATE @ /home/nicolas/.opam
00:00.023  SYSTEM                          LOCK /home/nicolas/.opam/repo/state-323C573F.cache (none => read)
00:00.112  CACHE(repository)               Loaded /home/nicolas/.opam/repo/state-323C573F.cache in 0.088s
00:00.112  SYSTEM                          LOCK /home/nicolas/.opam/repo/state-323C573F.cache (read => none)
00:00.112  RSTATE                          Cache found
00:00.112  STATE                           LOAD-SWITCH-STATE @ default
00:00.113  SYSTEM                          LOCK /home/nicolas/.opam/default/.opam-switch/packages/cache (none => read)
00:00.114  CACHE(installed)                Loaded /home/nicolas/.opam/default/.opam-switch/packages/cache in 0.000s
00:00.114  SYSTEM                          LOCK /home/nicolas/.opam/default/.opam-switch/packages/cache (read => none)
00:00.356  STATE                           Switch state loaded in 0.244s
00:00.495  SYSTEM                          [log-265676-182a8f] (in 0.005s) lsb_release -s -r
00:00.507  SYSTEM                          [log-265676-9b6af0] (in 0.004s) ocamlc -vnum
00:00.622  SYSTEM                          mkdir /tmp/opam-265676-73eb86
00:01.036  SYSTEM                          rmdir /tmp/opam-265676-73eb86
00:02.262  XSYS                            Adding to env { LC_ALL=C }
00:02.281  STATE                           depexts loaded in 1.660s
merlin
ocp-indent
00:02.284  SYSTEM                          LOCK /home/nicolas/.opam/repo/lock (none => none)
00:02.284  SYSTEM                          LOCK /home/nicolas/.opam/config.lock (none => none)
$ opam config report
# opam config report
# opam-version         2.1.3
# self-upgrade         no
# system               arch=x86_64 os=linux os-distribution=manjaro os-version=22.0.0
# 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                 7
# repositories         1 (http), 5 (version-controlled) (default repo at 74ceb8fd)
# pinned               3 (git)
# current-switch       default
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /home/nicolas/.opam/default/lib/ocaml/stublibs:/home/nicolas/.opam/default/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       4.14.0+options
@kit-ty-kate
Copy link
Member

#5317 should fix this issue

@Patrick-Poitras
Copy link

Encountering the same problem in emacs.

@jake-87
Copy link

jake-87 commented Jul 13, 2024

For what it's worth, this is still an issue with opam 2.2.0, most likely because #5317 was never merged.

@kit-ty-kate
Copy link
Member

Sorry about that. Our efforts were focused on Windows, but now that 2.2.0 is released we're looking back at all the unmerged PRs and hopefully it should be fixed and released in the next few months.

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