1

I am having many issues with up and running OCaml. I cleaned all and was trying to start fresh by installing opam.

brew install opam

which shows the following:

Warning: You are using macOS 14.4. We do not provide support for this pre-release version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience while you are running this pre-release version.

==> Downloading https://caml.inria.fr/pub/distrib/ocaml-4.10/ocaml-4.10.0.tar.xz Already downloaded: /Users/alimjan.yasin/Library/Caches/Homebrew/downloads/4a63001ce2ecaa29f05207c5de9605a4ffce681de8f1bd2ade9094cbfe2f0c5e--ocaml-4.10.0.tar.xz ==> Downloading https://github.com/ocaml/opam/releases/download/2.0.7/opam-full- curl: (35) Recv failure: Connection reset by peer

Error: Failed to download resource "opam" Download failed: https://github.com/ocaml/opam/releases/download/2.0.7/opam-full-2.0.7.tar.gz

So I tried the following:

bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"

and now I have the following:

Downloading opam 2.1.5 for macos on x86_64... There may not yet be a binary release for your architecture or OS, sorry. See https://github.com/ocaml/opam/releases/tag/2.1.5 for pre-compiled binaries, or run 'make cold' from https://github.com/ocaml/opam/archive/2.1.5.tar.gz to build from scratch

Now, what should I do? Thank you anyone helping to on this issue.

7
  • 1
    macOS 14.4 is not a pre-release version of anything. So what version of Homebrew are you running? Regarding the network error... turn off LittleSnitch if you have it running. Commented Apr 22 at 12:17
  • Thank you for the excellent suggestion @MarcWilson - I did re-scan this and those links all look good to me. Might just be some security setup or networking issues for the OP.
    – bmike
    Commented Apr 22 at 13:12
  • I read Homebrew discussion fora when I'm bored. The #1 response to people complaining about that network error is to remove LittleSnitch, LuLu, etc. Commented Apr 22 at 13:56
  • @MarcWilson I will try your suggestion, and let you know about it. Thank you!
    – arslan
    Commented Apr 25 at 8:40
  • @MarcWilson "brew --version" shows "Homebrew 2.5.2-30-g41ade40".
    – arslan
    Commented Apr 25 at 8:43

1 Answer 1

1

Those links look good to me and my macOS system can install it without any special setup and no errors.

Can you investigate any network filters / proxies or security software you run on top of macOS and/or try a different network to install the same way you did above?

My install goes without any errors from the US:

==> Installing opam
==> Pouring opam--2.1.5.arm64_sonoma.bottle.1.tar.gz
==> Caveats
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running:

$ opam init

zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/opam/2.1.5: 50 files, 13.6MB
==> Running `brew cleanup opam`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> opam
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running:

$ opam init

zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
me@m2 ~ % sw_vers
ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224

Another easy first step would be to ask brew to retrieve the source code and compile this on your specific system.

brew install -s opam

-s, --build-from-source
Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available.

3
  • I tried the "brew install -s opam", still got "Downloading github.com/ocaml/opam/releases/download/2.0.7/opa curl: (35) Recv failure: Connection reset by peer". Maybe it has something to do with the internet regulation. How frustrating!
    – arslan
    Commented Apr 23 at 4:43
  • You are getting network blockages @arslan - this article has some great advice on timing and selecting other mirrors in case you have a geographical blockage or restriction and not just a slow network connection to the source. mincong.io/en/chinese-software-mirrors
    – bmike
    Commented Apr 23 at 12:01
  • without your hint, I won't try mirrors. after setting up a mirror, i been able to update homebrew, and now installing opam, slow but working, Thanks! @bmike
    – arslan
    Commented Apr 26 at 4:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .