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 init fails to find zstd when compiling ocaml-base-compiler #24953

Open
sporkl opened this issue Dec 17, 2023 · 0 comments
Open

opam init fails to find zstd when compiling ocaml-base-compiler #24953

sporkl opened this issue Dec 17, 2023 · 0 comments

Comments

@sporkl
Copy link

sporkl commented Dec 17, 2023

I was recently trying for a fresh install of ocaml, and when I ran opam init -y it looks like it failed to compile ocaml-base-compiler. When I installed zstd with brew install zstd, it worked afterwards.

I tried running it in a clean shell environment, and the same issue occurred as well.

Here's what the output looked like:

(base) dv@MacBook-Pro-403 ~ % opam init -y
No configuration file found, using built-in defaults.
Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg command on your system.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.


<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><>  🐫 
[default] Initialised

<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><>  🐫 

  In normal operation, opam only alters files within ~/.opam.

  However, to best integrate with your system, some environment variables
  should be set. If you allow it to, this initialisation step will update
  your zsh configuration by adding the following line to ~/.zshrc:

    [[ ! -r /Users/dv/.opam/opam-init/init.zsh ]] || source /Users/dv/.opam/opam-init/init.zsh  > /dev/null 2> /dev/null

  Otherwise, every time you want to access your opam installation, you will
  need to run:

    eval $(opam env)

  You can always re-run this setup with 'opam init' later.

[WARNING] Shell not updated in non-interactive mode: use --shell-setup

<><> Creating initial switch 'default' (invariant ["ocaml" {>= "4.05.0"}] - initially with ocaml-base-compiler) 

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><>  🐫 
Switch invariant: ["ocaml" {>= "4.05.0"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-options-vanilla.1
⬇ retrieved ocaml-base-compiler.5.1.1  (https://opam.ocaml.org/cache)
[ERROR] The compilation of ocaml-base-compiler.5.1.1 failed at "make -j15".

#=== ERROR while compiling ocaml-base-compiler.5.1.1 ==========================#
# context     2.1.5 | macos/x86_64 |  | https://opam.ocaml.org#a4b48f40
# path        ~/.opam/default/.opam-switch/build/ocaml-base-compiler.5.1.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j15
# exit-code   2
# env-file    /var/folders/sw/kx0xn99n7rv5cbyjwdn59z900000gn/T/opam-root-10007/ocaml-base-compiler-10007-cfa107.env
# output-file /var/folders/sw/kx0xn99n7rv5cbyjwdn59z900000gn/T/opam-root-10007/ocaml-base-compiler-10007-cfa107.out
### output ###
# /Applications/Xcode.app/Contents/Developer/usr/bin/make runtime-all
# [...]
#   MKDLL runtime/libcamlrun_shared.so
# /Applications/Xcode.app/Contents/Developer/usr/bin/make -C stdlib \
#         OCAMLRUN='$(ROOTDIR)/runtime/ocamlrun' \
#         CAMLC='$(BOOT_OCAMLC) -use-prims ../runtime/primitives' all
#   OCAMLC camlinternalFormatBasics.cmi
# dyld[15410]: Library not loaded: '@rpath/libzstd.1.dylib'
#   Referenced from: '/Users/dv/.opam/default/.opam-switch/build/ocaml-base-compiler.5.1.1/runtime/ocamlrun'
#   Reason: tried: '/usr/local/lib/libzstd.1.dylib' (no such file), '/usr/lib/libzstd.1.dylib' (no such file)
# make[2]: *** [camlinternalFormatBasics.cmi] Abort trap: 6
# make[1]: *** [coldstart] Error 2
# make: *** [world.opt] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build ocaml-base-compiler 5.1.1
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray         base
│ ∗ install base-threads          base
│ ∗ install base-unix             base
│ ∗ install ocaml-options-vanilla 1
└─ 

<><> ocaml-base-compiler.5.1.1 troubleshooting ><><><><><><><><><><><><><><>  🐫 
=> A failure in the middle of the build may be caused by build parallelism
      (enabled by default).
      Please file a bug report at https://github.com/ocaml/opam-repository/issues
=> You can try installing again including --jobs=1
      to force a sequential build instead.
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y
[NOTE] Opam has been initialised, but the initial switch creation failed.
       Use 'opam switch create <compiler>' to get started.

I submitted an issue to ocaml/ocaml as well here: ocaml/ocaml#12835

I am on an intel mac running macOS 12.5.1. If I should provide any additional info, please let me know.

Thanks!

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

1 participant