Problems installing num to system switches

There have been some issues recently with the num package which, as of OCaml 4.06.0, now lives on as an independent library. In order to maintain as much compatibility as possible, the num package installs its files to OCaml’s lib directory, rather than to site-lib/num or $OPAMROOT/$OPAMSWITCH/lib/num.

This was a problem for opam system switches, since opam shouldn’t write things outside $OPAMROOT.

I’ve written a more complete explanation of the problem on my blog - Homebrew users in particular may like to clean up their /usr/local/lib/ocaml directory now, rather than waiting for a new version of ocamlfind to cause num-related pain.

1 Like

Many thanks for the comprehensive writeup, David!

It does increasingly strike me as a poor default that Homebrew encourages a user-writeable /usr/local. I’m going to try and change mine to be read-only, except that creating new users on macOS seems to be getting more difficult thanks to System Integrity Protection kicking in…