Opam insists on downgrades because of ocamlfind

I have ocamlfind 1.7.3 installed and almost any install action with opam results in opam wanting to perform a ton of removals and insisting on downgrading findlib. I can’t really understand why this is the case, but I can’t be the only one running into this. Any help is appreciated.

 % opam install shexp
The following actions will be performed:
  ⊘  remove    duration                0.1.0  [conflicts with ocamlfind]
  ⊘  remove    ppx_tools_versioned     5.0.1  [conflicts with ocamlfind]
  ⊘  remove    websocket               2.9    [uses async]
  ⊘  remove    alcotest                0.7.2  [conflicts with ocamlfind]
  ⊘  remove    mirage-stack            1.0.0  [conflicts with ocamlfind]
  ⊘  remove    iocaml-kernel           0.4.8  [conflicts with ocamlfind]
  ⊘  remove    tyxml                   4.1.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-kv               1.1.0  [uses fmt]
  ⊘  remove    topkg-jbuilder          0.1.0  [uses topkg]
  ⊘  remove    mirage-clock-lwt        1.2.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-console          2.3.0  [uses mirage-flow]
  ⊘  remove    cow                     2.2.0  [conflicts with ocamlfind]
  ⊘  remove    ptime                   0.8.3  [conflicts with ocamlfind]
  ⊘  remove    topkg-care              0.9.0  [conflicts with ocamlfind]
  ⊘  remove    zarith                  1.5    [conflicts with ocamlfind]
  ⊘  remove    mirage-no-xen           1
  ⊘  remove    bisect_ppx              1.2.0  [conflicts with ocamlfind]
  ⊘  remove    merlin-extend           0.3    [conflicts with ocamlfind]
  ⊘  remove    reactiveData            0.2.1  [conflicts with ocamlfind]
  ⊘  remove    merlin                  3.0.0*  [conflicts with ocamlfind]
  ⊘  remove    mirage-block            1.1.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-fs               1.1.0  [uses fmt]
  ⊘  remove    hashcons                1.2    [conflicts with ocamlfind]
  ⊘  remove    mirage-no-solo5         1
  ⊘  remove    oasis                   0.4.10  [conflicts with ocamlfind]
  ⊘  remove    mirage-time-lwt         1.0.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-channel-lwt      3.0.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-net              1.1.0  [uses fmt]
  ⊘  remove    cpuid                   0.1.1  [conflicts with ocamlfind]
  ⊘  remove    utop                    2.0.1  [conflicts with ocamlfind]
  ⊘  remove    cohttp                  0.22.0  [uses async]
  ⊘  remove    mirage-protocols        1.1.0  [conflicts with ocamlfind]
  ⊘  remove    uuidm                   0.9.6  [conflicts with ocamlfind]
  ⊘  remove    uint                    1.2.0  [conflicts with ocamlfind]
  ⊘  remove    ounit                   2.0.0  [conflicts with ocamlfind]
  ⊘  remove    optcomp                 1.6    [conflicts with ocamlfind]
  ⊘  remove    ocp-index               1.1.5  [uses cmdliner, ocp-build]
  ⊘  remove    ctypes                  0.12.0  [conflicts with ocamlfind]
  ⊘  remove    conf-zmq                0.1
  ⊘  remove    atdgen                  1.10.2  [uses biniou]
  ⊘  remove    xmlm                    1.3.0  [conflicts with ocamlfind]
  ⊘  remove    omd                     1.3.0  [conflicts with ocamlfind]
  ⊘  remove    ezjsonm                 0.5.0  [conflicts with ocamlfind]
  ⊘  remove    webbrowser              0.6.1  [conflicts with ocamlfind]
  ⊘  remove    opam-format             2.0.0~beta3.1  [uses opam-core]
  ⊘  remove    conf-perl               1
  ⊘  remove    conf-gmp                1
  ⊘  remove    conf-autoconf           0.1
  ⊘  remove    ocamlmod                0.0.8  [conflicts with ocamlfind]
  ⊘  remove    ocamlify                0.0.1  [conflicts with ocamlfind]
  ⊘  remove    mirage-time             1.0.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-channel          3.0.0  [conflicts with ocamlfind]
  ⊘  remove    io-page                 1.6.1  [conflicts with ocamlfind]
  ⊘  remove    ocb-stubblr             0.1.1  [conflicts with ocamlfind]
  ⊘  remove    magic-mime              1.0.1  [conflicts with ocamlfind]
  ⊘  remove    conduit                 0.15.4  [uses async]
  ⊘  remove    base64                  2.1.2  [conflicts with ocamlfind]
  ⊘  remove    ocp-indent              1.6.0  [uses cmdliner, ocp-build]
  ⊘  remove    lambda-term             1.11   [uses lwt]
  ⊘  remove    integers                0.2.2  [conflicts with ocamlfind]
  ⊘  remove    ctypes-foreign          0.4.0
  ⊘  remove    conf-pkg-config         1.0
  ⊘  remove    yojson                  1.3.3  [conflicts with ocamlfind]
  ⊘  remove    atd                     1.2.1  [uses easy-format, menhir]
  ⊘  remove    hex                     1.1.1  [conflicts with ocamlfind]
  ⊘  remove    bos                     0.1.6  [conflicts with ocamlfind]
  ⊘  remove    opam-file-format        2.0.0~beta3
  ⊘  remove    opam-core               2.0.0~beta3.1  [conflicts with ocamlfind]
  ⊘  remove    uri                     1.9.4  [conflicts with ocamlfind]
  ⊘  remove    mirage-flow-lwt         1.2.0  [conflicts with ocamlfind]
  ⊘  remove    ipaddr                  2.8.0  [uses base-bytes]
  ⊘  remove    async                   v0.9.0  [uses async_kernel]
  ⊘  remove    zed                     1.5    [uses base-bytes]
  ⊘  remove    lwt_react               1.0.1  [uses react]
  ⊘  remove    biniou                  1.0.13  [conflicts with ocamlfind]
  ⊘  remove    menhir                  20170607  [conflicts with ocamlfind]
  ⊘  remove    rresult                 0.5.0  [conflicts with ocamlfind]
  ⊘  remove    logs                    0.6.2  [conflicts with ocamlfind]
  ⊘  remove    fpath                   0.7.2  [conflicts with ocamlfind]
  ⊘  remove    ocp-build               1.99.19-beta  [conflicts with ocamlfind]
  ⊘  remove    ocamlgraph              1.8.7  [conflicts with ocamlfind]
  ⊘  remove    jsonm                   1.0.1  [conflicts with ocamlfind]
  ⊘  remove    stringext               1.4.3  [conflicts with ocamlfind]
  ⊘  remove    mirage-flow             1.2.0  [conflicts with ocamlfind]
  ⊘  remove    mirage-clock            1.2.0  [conflicts with ocamlfind]
  ⊘  remove    cstruct-lwt             3.0.0  [uses lwt]
  ⊘  remove    async_extra             v0.9.0  [uses async_kernel]
  ⊘  remove    camomile                0.8.5  [conflicts with ocamlfind]
  ⊘  remove    react                   1.2.1  [conflicts with ocamlfind]
  ⊘  remove    easy-format             1.2.0  [conflicts with ocamlfind]
  ⊘  remove    conf-which              1
  ⊘  remove    astring                 0.8.3  [conflicts with ocamlfind]
  ⊘  remove    uutf                    1.0.1  [conflicts with ocamlfind]
  ⊘  remove    mirage-device           1.1.0  [uses fmt]
  ⊘  remove    lwt                     3.0.0  [conflicts with ocamlfind]
  ⊘  remove    cstruct                 3.0.0  [uses base-bytes]
  ⊘  remove    async_unix              v0.9.0  [uses async_kernel]
  ⊘  remove    async_rpc_kernel        v0.9.0  [uses core_kernel]
  ⊘  remove    fmt                     0.8.3  [conflicts with ocamlfind]
  ⊘  remove    camlp4                  4.04+1  [uses ocamlbuild]
  ⊘  remove    ocplib-endian           1.0    [conflicts with ocamlfind]
  ⊘  remove    core                    v0.9.1  [conflicts with base]
  ⊘  remove    async_kernel            v0.9.0  [uses core_kernel]
  ⊘  remove    uchar                   0.0.1  [uses ocamlbuild]
  ⊘  remove    cmdliner                1.0.0  [conflicts with ocamlfind]
  ⊘  remove    core_kernel             v0.9.0  [conflicts with base]
  ⊘  remove    ppx_jane                v0.9.0  [conflicts with jbuilder]
  ⊘  remove    jane-street-headers     v0.9.0  [conflicts with jbuilder]
  ⊘  remove    configurator            v0.9.1  [conflicts with base]
  ⊘  remove    ppx_typerep_conv        v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_sexp_value          v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_sexp_message        v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_pipebang            v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_optional            v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_let                 v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_fail                v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_expect              v0.9.0  [conflicts with base]
  ⊘  remove    ppx_bin_prot            v0.9.0  [uses bin_prot]
  ⊘  remove    ppx_bench               v0.9.1  [conflicts with jbuilder]
  ⊘  remove    ppx_base                v0.9.0  [conflicts with jbuilder]
  ⊘  remove    typerep                 v0.9.0  [conflicts with base]
  ⊘  remove    re                      1.7.1  [conflicts with ocamlfind]
  ⊘  remove    ppx_assert              v0.9.0  [conflicts with base]
  ⊘  remove    bin_prot                v0.9.0  [conflicts with base]
  ⊘  remove    ppx_inline_test         v0.9.1  [conflicts with base]
  ⊘  remove    ppx_js_style            v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_hash                v0.9.0  [conflicts with base]
  ⊘  remove    ppx_enumerate           v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_here                v0.9.1  [conflicts with jbuilder]
  ⊘  remove    ppx_variants_conv       v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_fields_conv         v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_custom_printf       v0.9.0  [conflicts with jbuilder]
  ⊘  remove    octavius                1.1.0  [conflicts with ocamlfind]
  ⊘  remove    ppx_compare             v0.9.0  [conflicts with base]
  ⊘  remove    variantslib             v0.9.0  [conflicts with base]
  ⊘  remove    fieldslib               v0.9.0  [conflicts with base]
  ⊘  remove    ppx_traverse            v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_sexp_conv           v0.9.0  [conflicts with jbuilder]
  ⊘  remove    topkg                   0.9.0  [conflicts with ocamlfind]
  ⊘  remove    ppx_type_conv           v0.9.0  [uses ppx_deriving]
  ⊘  remove    ppx_metaquot            v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_deriving            4.1    [conflicts with ocamlfind]
  ⊘  remove    ppx_driver              v0.9.1  [uses ocamlbuild]
  ⊘  remove    ppx_tools               5.0    [conflicts with ocamlfind]
  ⊘  remove    cppo                    1.5.0  [conflicts with ocamlfind]
  ⊘  remove    ppx_optcomp             v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ocamlbuild              0.11.0  [conflicts with ocamlfind]
  ⊘  remove    base-bytes              base   [conflicts with ocamlfind]
  ⊘  remove    ppx_core                v0.9.0  [conflicts with base]
  ⊘  remove    stdio                   v0.9.0  [conflicts with base]
  ⊘  remove    ppx_traverse_builtins   v0.9.0  [conflicts with jbuilder]
  ⊘  remove    ppx_ast                 v0.9.1  [conflicts with jbuilder]
  ⊘  remove    ocaml-migrate-parsetree 1.0.1  [conflicts with ocamlfind]
  ⊘  remove    ocaml-compiler-libs     v0.9.0  [conflicts with jbuilder]
  ↘  downgrade ocamlfind               1.7.3 to 1.3.2  [upstream changes]
  ⊘  remove    result                  1.2
  ↘  downgrade jbuilder                1.0+beta10 to 1.0+beta7  [required by shexp]
  ↘  downgrade base                    v0.9.2 to v0.9.1  [required by shexp]
  ∗  install   posixat                 v0.9.0  [required by shexp]
  ∗  install   shexp                   v0.9.0
===== ∗  2   ↘  3   ⊘  155 =====

No idea but sometimes an opam upgrade --fixup can help.

--fixup doesn’t help unfortunately. The build plan proposed by opam doesn’t even seem to make sense. For example, the line:

  ↘  downgrade base                    v0.9.2 to v0.9.1  [required by shexp]

But shexp makes no such constraints on base:

depends:      "ocaml" {>= "4.03.0"}
              "base" {>= "v0.9" & < "v0.10"}
              "jbuilder" {build & >= "1.0+beta7"}
              "posixat" {>= "v0.9" & < "v0.10"}
              "spawn" {>= "v0.9" & < "v0.10"}
              "base-threads"

So I’m really confused as to what’s wrong here.

I ran into a similar issue with ocamlfind 1.7.3 for no reason I could see. My short-term hack was to pin a few packages manually. I also got different results on different platforms (tested at the time on macOS, Alpine via Docker and CentOS). I don’t have access to those machines for a few more days, but if the underlying cause can be found that would be good.

Try setting OPAMDEBUG=1 to see what the solver actions are.

Here they are, I don’t see anything useful here:

00:00.004  GSTATE                  LOAD-GLOBAL-STATE @ /home/rgrinberg/.opam
00:00.009  RSTATE                  LOAD-REPOSITORY-STATE @ /home/rgrinberg/.opam
00:00.050  RSTATE                  Loaded /home/rgrinberg/.opam/repo/state.cache in 0.040s
00:00.074  RSTATE                  Cache found
00:00.074  STATE                   LOAD-SWITCH-STATE @ 4.04.1
00:00.159  STATE                   Detected changed packages (marked for reinstall): {}
00:00.161  STATE                   Switch state loaded in 0.088s
00:00.162  FILE(switch-state)      Wrote /home/rgrinberg/.opam/4.04.1/.opam-switch/backup/state-20170610194737.export in 0.000s
00:00.222  CLIENT                  INSTALL shexp
00:00.342  SYSTEM                  [log-18808-5a61c5] (in 0.004s) uname -m
00:00.357  SYSTEM                  [log-18808-4bcc67] (in 0.015s) ocamlc -vnum
00:00.427  CLIENT                  Orphans: (changes: { shexp.v0.9.0 }, transitive: false) -> full {}, versions {}
00:00.580  SOLVER                  resolve request=install:(shexp) remove:() upgrade:()
00:00.837  SOLVER                  Load cudf universe (depopts:false, build:true)
00:01.294  CUDF                    resolve request=install:(shexp) remove:() upgrade:()
00:01.294  SOLVER                  Checking version of criteria accepted by the external solver
00:01.296  SYSTEM                  [log-18808-42bb52] (in 0.002s) aspcud -v
00:01.296  SOLVER                  Solver is aspcud > 1.9: using latest version criteria
00:01.296  CUDF                    Calling external solver with criteria -count(removed),-notuptodate(request),-sum(request,version-lag),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution),-sum(solution,version-lag)
00:11.772  SYSTEM                  [log-18808-5f1023] (in 10.441s) aspcud /home/rgrinberg/.opam/log/solver-in-18808-9b8556 /home/rgrinberg/.opam/log/solver-out-18808-7afd23 -count(removed),-notuptodate(request),-sum(request,version-lag),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution),-sum(solution,version-lag)
00:11.772  SYSTEM                  rm /home/rgrinberg/.opam/log/solver-in-18808-9b8556
00:11.772  SYSTEM                  rm /home/rgrinberg/.opam/log/solver-out-18808-7afd23
00:12.107  CUDF                    External solver call done in 10.811
00:12.469  SOLVER                  Load cudf universe (depopts:false, build:true)
00:12.935  SOLVER                  Load cudf universe (depopts:true, build:false)
00:13.507  SOLVER                  Load cudf universe (depopts:true, build:true)
00:14.151  CUDF                    graph_of_actions root_actions={  - ⊘  zed (= 4),  - ⊘  zarith (= 6),  - ⊘  yojson (= 12),  - ⊘  xmlm (= 5),  - ⊘  websocket (= 20),  - ⊘  webbrowser (= 2),  - ⊘  variantslib (= 22),  - ⊘  uutf (= 5),  - ⊘  uuidm (= 2),  - ⊘  utop (= 24),  - ⊘  uri (= 26),  - ⊘  uint (= 7),  - ⊘  uchar (= 1),  - ⊘  tyxml (= 18),  - ⊘  typerep (= 21),  - ⊘  topkg-jbuilder (= 1),  - ⊘  topkg-care (= 8),  - ⊘  topkg (= 11),  - ⊘  stringext (= 10),  - ⊘  stdio (= 2),  - ⊘  rresult (= 5),  - ⊘  result (= 3),  - ⊘  reactiveData (= 3),  - ⊘  react (= 7),  - ⊘  re (= 16),  - ⊘  ptime (= 4),  - ⊘  ppx_variants_conv (= 10),  - ⊘  ppx_typerep_conv (= 10),  - ⊘  ppx_type_conv (= 13),  - ⊘  ppx_traverse_builtins (= 2),  - ⊘  ppx_traverse (= 2),  - ⊘  ppx_tools_versioned (= 4),  - ⊘  ppx_tools (= 9),  - ⊘  ppx_sexp_value (= 10),  - ⊘  ppx_sexp_message (= 9),  - ⊘  ppx_sexp_conv (= 14),  - ⊘  ppx_pipebang (= 10),  - ⊘  ppx_optional (= 2),  - ⊘  ppx_optcomp (= 12),  - ⊘  ppx_metaquot (= 2),  - ⊘  ppx_let (= 9),  - ⊘  ppx_js_style (= 2),  - ⊘  ppx_jane (= 8),  - ⊘  ppx_inline_test (= 12),  - ⊘  ppx_here (= 10),  - ⊘  ppx_hash (= 2),  - ⊘  ppx_fields_conv (= 10),  - ⊘  ppx_fail (= 10),  - ⊘  ppx_expect (= 11),  - ⊘  ppx_enumerate (= 10),  - ⊘  ppx_driver (= 15),  - ⊘  ppx_deriving (= 14),  - ⊘  ppx_custom_printf (= 10),  - ⊘  ppx_core (= 12),  - ⊘  ppx_compare (= 11),  - ⊘  ppx_bin_prot (= 11),  - ⊘  ppx_bench (= 11),  - ⊘  ppx_base (= 2),  - ⊘  ppx_ast (= 3),  - ⊘  ppx_assert (= 8),  - ⊘  ounit (= 4),  - ⊘  optcomp (= 3),  - ⊘  opam-format (= 4),  - ⊘  opam-file-format (= 3),  - ⊘  opam-core (= 4),  - ⊘  omd (= 42),  - ⊘  octavius (= 3),  - ⊘  ocplib-endian (= 7),  - ⊘  ocp-index (= 13),  - ⊘  ocp-indent (= 24),  - ⊘  ocp-build (= 16),  - ⊘  ocb-stubblr (= 4),  - ⊘  ocamlmod (= 4),  - ⊘  ocamlify (= 1),  - ⊘  ocamlgraph (= 7),  - ⊘  ocamlfind (= 22),  - ⊘  ocamlbuild (= 6),  - ⊘  ocaml-migrate-parsetree (= 6),  - ⊘  ocaml-compiler-libs (= 2),  - ⊘  oasis (= 13),  - ⊘  mirage-time-lwt (= 1),  - ⊘  mirage-time (= 1),  - ⊘  mirage-stack (= 1),  - ⊘  mirage-protocols (= 2),  - ⊘  mirage-no-xen (= 1),  - ⊘  mirage-no-solo5 (= 1),  - ⊘  mirage-net (= 13),  - ⊘  mirage-kv (= 2),  - ⊘  mirage-fs (= 6),  - ⊘  mirage-flow-lwt (= 2),  - ⊘  mirage-flow (= 6),  - ⊘  mirage-device (= 2),  - ⊘  mirage-console (= 7),  - ⊘  mirage-clock-lwt (= 1),  - ⊘  mirage-clock (= 1),  - ⊘  mirage-channel-lwt (= 1),  - ⊘  mirage-channel (= 1),  - ⊘  mirage-block (= 5),  - ⊘  merlin-extend (= 1),  - ⊘  merlin (= 2),  - ⊘  menhir (= 29),  - ⊘  magic-mime (= 3),  - ⊘  lwt_react (= 2),  - ⊘  lwt (= 22),  - ⊘  logs (= 5),  - ⊘  lambda-term (= 10),  - ⊘  jsonm (= 3),  - ⊘  jbuilder (= 10),  - ⊘  jane-street-headers (= 2),  - ⊘  ipaddr (= 20),  - ⊘  iocaml-kernel (= 5),  - ⊘  io-page (= 11),  - ⊘  integers (= 4),  - ⊘  hex (= 5),  - ⊘  hashcons (= 2),  - ⊘  fpath (= 3),  - ⊘  fmt (= 6),  - ⊘  fieldslib (= 27),  - ⊘  ezjsonm (= 10),  - ⊘  easy-format (= 4),  - ⊘  duration (= 1),  - ⊘  ctypes-foreign (= 1),  - ⊘  ctypes (= 42),  - ⊘  cstruct-lwt (= 2),  - ⊘  cstruct (= 39),  - ⊘  cpuid (= 3),  - ⊘  cppo (= 15),  - ⊘  cow (= 28),  - ⊘  core_kernel (= 57),  - ⊘  core (= 91),  - ⊘  configurator (= 3),  - ⊘  conf-zmq (= 1),  - ⊘  conf-which (= 1),  - ⊘  conf-pkg-config (= 1),  - ⊘  conf-perl (= 1),  - ⊘  conf-gmp (= 1),  - ⊘  conf-autoconf (= 1),  - ⊘  conduit (= 32),  - ⊘  cohttp (= 47),  - ⊘  cmdliner (= 10),  - ⊘  camomile (= 3),  - ⊘  camlp4 (= 15),  - ⊘  bos (= 7),  - ⊘  bisect_ppx (= 11),  - ⊘  biniou (= 6),  - ⊘  bin_prot (= 45),  - ⊘  base64 (= 5),  - ⊘  base-bytes (= 1),  - ⊘  base (= 4),  - ⊘  atdgen (= 17),  - ⊘  atd (= 7),  - ⊘  async_unix (= 69),  - ⊘  async_rpc_kernel (= 11),  - ⊘  async_kernel (= 29),  - ⊘  async_extra (= 68),  - ⊘  async (= 58),  - ⊘  astring (= 4),  - ⊘  alcotest (= 23),  - ∗  shexp (= 1),  - ∗  posixat (= 2),  - ∗  ocamlfind (= 4),  - ∗  jbuilder (= 7),  - ∗  base (= 3) }
00:14.193  SOLUTION                apply

Possibly related: https://github.com/ocaml/opam/issues/2960.

The best way to debug solver weridness is to add explicit constraints on the command line. For instance, what does that command give you?

opam install shexp.v0.9.0 ocamlfind.1.7.3

I was going to suggest the same solution as @samoht: tell opam what you want more precisely and it should be able to tell you why it is not possible.

This also suggested in the FAQ

The fact that opam upgrade --fixup does anything at all shows that your current installation is considered inconsistent by opam (eg. not all dependencies are satisfied). A hack to know what is wrong could be to ask opam to recreate the switch, e.g. with:

opam switch import --switch testing-tmp --show <(opam switch export -)

and see how that goes

EDIT: you may want to also make sure you are really using the metadata you think you are for shexp: try opam show shexp --raw; and check for pinnings… All else failing, please run with --cudf debug-univ-shexp and send me the generated debug-univ-shexp-1.cudf

1 Like

I’m pretty sure this is an instance of https://github.com/ocaml/opam/issues/2203, since I got the same issue after clingo’s upgrade in Arch. You can apply the fix given by @dudelson in https://bugs.archlinux.org/task/54393?project=5.

By the way, the new version of clingo seems to make aspcud faster (and the packaging has been improved a lot).

The problem was correctly identified by @Drup. Thanks to everyone for all the help.