Updating OCaml in brew broke all the binaries in my switch

After updating my system OCaml using homebrew to 4.06.1, all the of the binaries in my 4.05 broke. Here’s the error that I’m getting whenever I run anything in 4.05.0 (e.g. topkg):

Cannot load required shared library dllunix.
Reason: /usr/local/lib/ocaml/stublibs/dllunix.so: dlopen(/usr/local/lib/ocaml/stublibs/dllunix.so, 138): Symbol not found: _caml_ba_compare
  Referenced from: /usr/local/lib/ocaml/stublibs/dllunix.so
  Expected in: flat namespace
 in /usr/local/lib/ocaml/stublibs/dllunix.so.

Anyone have an explanation why this is occuring? Why are the binaries in my switch even looking for a system dllunix.so? Shouldn’t there be a per switch one.

Hmm, I have the same version of OCaml from homebrew but no such issue. I assume you ran:

eval $(opam config env)

Nope, I did not forget eval.

Could you put down the exact steps you did?