tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
60 stars 8 forks source link

Bug when installing on a lower ocaml version switch than what has been done previously #111

Closed panglesd closed 1 year ago

panglesd commented 1 year ago

When installing tools in a 4.14 switch, followed by installing tools on a 4.13 switch, I get the following errors (full output here):

  -> [3/6] Building ocaml-lsp-server...
ocaml-platform: [DEBUG] Running: 'opam' 'install' 'ocaml-lsp-server' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam'
ocaml-platform: [INFO] Error in 'opam' 'install' 'ocaml-lsp-server' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam':
[ERROR] The compilation of ocaml failed at "/tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml".

#=== ERROR while compiling ocaml.4.14.0 =======================================#
# context              2.0.10 | linux/x86_64 |  | file:///home/opam/opam-repository
# path                 /tmp/ocaml-platform-sandbox-4063b2/_opam/.opam-switch/build/ocaml.4.14.0
# command              /tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml
# exit-code            1
# env-file             ~/.opam/log/ocaml-50187-9893d8.env
# output-file          ~/.opam/log/ocaml-50187-9893d8.out
### output ###
# OCaml version mismatch: 4.13.1, expected 4.14.0

The former state can be restored with:
    opam switch import "/tmp/ocaml-platform-sandbox-4063b2/_opam/.opam-switch/backup/state-20220927121105.export"
Or you can retry to install your package selection with:
    opam install --restore
  -> [4/6] Building merlin...
ocaml-platform: [DEBUG] Running: 'opam' 'install' 'merlin' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam'
ocaml-platform: [INFO] Error in 'opam' 'install' 'merlin' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam':
[ERROR] The compilation of ocaml failed at "/tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml".

#=== ERROR while compiling ocaml.4.14.0 =======================================#
# context              2.0.10 | linux/x86_64 |  | file:///home/opam/opam-repository
# path                 /tmp/ocaml-platform-sandbox-4063b2/_opam/.opam-switch/build/ocaml.4.14.0
# command              /tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml
# exit-code            1
# env-file             ~/.opam/log/ocaml-50953-326a35.env
# output-file          ~/.opam/log/ocaml-50953-326a35.out
### output ###
# OCaml version mismatch: 4.13.1, expected 4.14.0

  -> [5/6] Building dune-release...
ocaml-platform: [DEBUG] Running: 'opam' 'install' 'dune-release' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam'
ocaml-platform: [INFO] Error in 'opam' 'install' 'dune-release' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam':
[ERROR] The compilation of ocaml failed at "/tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml".

#=== ERROR while compiling ocaml.4.14.0 =======================================#
# context              2.0.10 | linux/x86_64 |  | file:///home/opam/opam-repository
# path                 /tmp/ocaml-platform-sandbox-4063b2/_opam/.opam-switch/build/ocaml.4.14.0
# command              /tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml
# exit-code            1
# env-file             ~/.opam/log/ocaml-51041-d3d859.env
# output-file          ~/.opam/log/ocaml-51041-d3d859.out
### output ###
# OCaml version mismatch: 4.13.1, expected 4.14.0

  -> [6/6] Building dune...
ocaml-platform: [DEBUG] Running: 'opam' 'install' 'dune' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam'
ocaml-platform: [INFO] Error in 'opam' 'install' 'dune' '--yes' '-q' '--color=never' '--switch' '/tmp/ocaml-platform-sandbox-4063b2' '--root' '/home/opam/.opam':
[ERROR] The compilation of ocaml failed at "/tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml".

#=== ERROR while compiling ocaml.4.14.0 =======================================#
# context              2.0.10 | linux/x86_64 |  | file:///home/opam/opam-repository
# path                 /tmp/ocaml-platform-sandbox-4063b2/_opam/.opam-switch/build/ocaml.4.14.0
# command              /tmp/ocaml-platform-system-compiler-37aae1/ocaml /tmp/ocaml-platform-sandbox-4063b2/_opam/share/ocaml-config/gen_ocaml_config.ml 4.14.0 ocaml
# exit-code            1
# env-file             ~/.opam/log/ocaml-51295-d2c37b.env
# output-file          ~/.opam/log/ocaml-51295-d2c37b.out
### output ###
# OCaml version mismatch: 4.13.1, expected 4.14.0

ocaml-platform: [ERROR] Command 'opam install dune --yes -q --color=never --switch
           /tmp/ocaml-platform-sandbox-4063b2 --root /home/opam/.opam' failed: exited with 31
ocaml-platform: [ERROR] Command 'opam install dune-release --yes -q --color=never --switch
           /tmp/ocaml-platform-sandbox-4063b2 --root /home/opam/.opam' failed: exited with 31
ocaml-platform: [ERROR] Command 'opam install merlin --yes -q --color=never --switch
           /tmp/ocaml-platform-sandbox-4063b2 --root /home/opam/.opam' failed: exited with 31
ocaml-platform: [ERROR] Command 'opam install ocaml-lsp-server --yes -q --color=never --switch
           /tmp/ocaml-platform-sandbox-4063b2 --root /home/opam/.opam' failed: exited with 31

It seems the installation of some package try to upgrade the ocaml package...