Hello when I do a opam update on my computer I see this
[WARNING] Invalid patch utility. Please install GNU patch
Now run ‘opam upgrade’ to apply any package updates.
% opam upgrade
The following actions will be performed:
∗ install ocaml 5.2.0
∗ install base-domains base
∗ install base-nnp base
===== ∗ 3 =====
Do you want to continue? [Y/n] Y
I have no idea what sort of machine you’re on: can you provide that information? OS, machine architecture, possibly the output of lsb_release -a, etc?
o.i.c. macos.
the warning message suggests that the program patch is not what is expected. Have you looked into that? patch is a pretty fundamental program for development.
ETA: Have you previously been able to install OCaml versions using opam on this machine?
first thing I would do in your situation, is to nuke one of the switches you’d previously created, and recreate it. Ideally, you would do that with the most up-to-date switch you’d successfully created (e.g. 5.1.0 maybe?) If that works, then perhaps there’s something weird going on with the new release.
If you cannot recreate that switch you’d previously created, then yeah, I’d nuke the entire OPAM installation and recreate it.
Instead of “nuking” the OPAM installation, you could just rename it to another directory (e.g. if you have it in ~/.opam then maybe move that to ~/dot.opam.MOVED (so you’ll remember it) and then recreate as if you’re installing OPAM from-scratch
ALTERNATIVE: set your OPAMROOT environment variable to some alternative directory – that will allow you to do the step #2 without having to move your ~/.opam directory.
If you cannot recreate your OPAM environment from-scratch, then yeah, you’ve probably messed-up your Mac env somehow.
I was having a different problem (opam update won’t actually update, preventing me to upgrade to 5.3.0), and this fixed the issue! What might have been the issue?
Without seeing the actual error message i can only speculate, but maybe something akin to ocam/setup-ocaml#933? If so, this should be fixed for good in opam 2.4 (currently available in alpha2), which moved to its own OCaml implementation of GNU patch.