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 switch create . 5.2.0 isn't working on m2 mac #26058

Closed
feihong opened this issue Jun 11, 2024 · 2 comments
Closed

opam switch create . 5.2.0 isn't working on m2 mac #26058

feihong opened this issue Jun 11, 2024 · 2 comments

Comments

@feihong
Copy link
Contributor

feihong commented Jun 11, 2024

$ opam config report
# opam config report
# opam-version         2.1.6
# self-upgrade         no
# system               arch=arm64 os=macos os-distribution=homebrew os-version=14.4
# 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) (default repo at 402ab79d)
# pinned               0
# current-switch       default
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /Users/fhsu/.opam/default/lib/ocaml/stublibs:/Users/fhsu/.opam/default/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.0.0

I checked out the main branch of [melange-for-react-devs-template](https://github.com/melange-re/melange-for-react-devs-template} and then ran:

 $ opam switch create . 5.2.0 -y --deps-only

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><>  🐫
Switch invariant: ["ocaml-base-compiler" {= "5.2.0"} | "ocaml-system" {= "5.2.0"}]
The following actions will be performed:
  ∗ install ocaml-options-vanilla 1
  ∗ install host-arch-arm64       1
  ∗ install base-bigarray         base
  ∗ install base-threads          base
  ∗ install ocaml-base-compiler   5.2.0
  ∗ install host-system-other     1
  ∗ install base-unix             base
  ∗ install ocaml-config          3
  ∗ install ocaml                 5.2.0
  ∗ install ocamlfind             1.9.6
  ∗ install dune                  3.15.3
  ∗ install cmdliner              1.3.0
  ∗ install base-domains          base
  ∗ install stdlib-shims          0.3.0
  ∗ install sexplib0              v0.17.0
  ∗ install ppx_derivers          1.2.1
  ∗ install ocaml-compiler-libs   v0.17.0
  ∗ install menhirSdk             20231231
  ∗ install menhirLib             20231231
  ∗ install menhirCST             20231231
  ∗ install fix                   20230505
  ∗ install dune-build-info       3.15.3
  ∗ install cppo                  1.6.9
  ∗ install base-nnp              base
  ∗ install ppxlib                0.32.1
  ∗ install menhir                20231231
  ∗ install merlin-extend         0.6.1
  ∗ install melange               4.0.0-52
  ∗ install reason                3.11.0
  ∗ install reason-react-ppx      0.14.1
  ∗ install reason-react          0.14.1
===== ∗ 31 =====

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
⬇ retrieved dune.3.15.3  (cached)
⬇ retrieved cppo.1.6.9  (cached)
⬇ retrieved cmdliner.1.3.0  (cached)
∗ installed host-arch-arm64.1
∗ installed host-system-other.1
⬇ retrieved fix.20230505  (cached)
⬇ retrieved menhir.20231231  (cached)
⬇ retrieved menhirCST.20231231  (cached)
⬇ retrieved menhirLib.20231231  (cached)
⬇ retrieved melange.4.0.0-52  (cached)
⬇ retrieved menhirSdk.20231231  (cached)
⬇ retrieved merlin-extend.0.6.1  (cached)
⬇ retrieved dune-build-info.3.15.3  (cached)
⬇ retrieved ocaml-config.3  (cached)
∗ installed ocaml-options-vanilla.1
⬇ retrieved ocaml-compiler-libs.v0.17.0  (cached)
⬇ retrieved ocaml-base-compiler.5.2.0  (cached)
⬇ retrieved ppxlib.0.32.1  (cached)
⬇ retrieved ppx_derivers.1.2.1  (cached)
⬇ retrieved ocamlfind.1.9.6  (cached)
⬇ retrieved reason.3.11.0  (cached)
⬇ retrieved reason-react-ppx.0.14.1  (cached)
⬇ retrieved sexplib0.v0.17.0  (cached)
⬇ retrieved stdlib-shims.0.3.0  (cached)
⬇ retrieved reason-react.0.14.1  (cached)
∗ installed ocaml-base-compiler.5.2.0
∗ installed ocaml-config.3
[ERROR] The compilation of ocaml.5.2.0 failed at "ocaml
        /Users/fhsu/work/melange-for-react-devs-template/_opam/share/ocaml-config/gen_ocaml_config.ml 5.2.0
        ocaml".

#=== ERROR while compiling ocaml.5.2.0 ========================================#
# context     2.1.6 | macos/arm64 | ocaml-base-compiler.5.2.0 | https://opam.ocaml.org#402ab79d
# path        ~/work/melange-for-react-devs-template/_opam/.opam-switch/build/ocaml.5.2.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml /Users/fhsu/work/melange-for-react-devs-template/_opam/share/ocaml-config/gen_ocaml_config.ml 5.2.0 ocaml
# exit-code   2
# env-file    ~/.opam/log/ocaml-83931-dad3d7.env
# output-file ~/.opam/log/ocaml-83931-dad3d7.out
### output ###
# Cannot find file /Users/fhsu/work/melange-for-react-devs-template/_opam/share/ocaml-config/gen_ocaml_config.ml.



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build ocaml 5.2.0
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray         base
│ ∗ install base-threads          base
│ ∗ install base-unix             base
│ ∗ install host-arch-arm64       1
│ ∗ install host-system-other     1
│ ∗ install ocaml-base-compiler   5.2.0
│ ∗ install ocaml-config          3
│ ∗ install ocaml-options-vanilla 1
└─
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y
@hannesm
Copy link
Member

hannesm commented Jun 11, 2024

Thanks for your report, this seems to be caused by recent removals of files from opam-repository.

To recover from your situation, rm -rf ~/.opam/repo/default{,.tar.gz} && opam update default should help in the short-term. In the medium-term, please ensure to have GNU patch installed (via macports or homebrew).

This is further discussed at https://discuss.ocaml.org/t/the-compilation-of-ocaml-5-1-1-failed-at-ocaml-gen-ocaml-config-ml-5-1-1-ocaml/14731 and also #25961 #26050

@kit-ty-kate kit-ty-kate transferred this issue from ocaml/opam Jun 11, 2024
@kit-ty-kate
Copy link
Member

Duplicated of #25961

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

No branches or pull requests

3 participants