You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are certain environment variables that can affect OCaml builds that ideally should be ignored from the global environment and instead provided entirely by opam if they are really needed. These include:
The workarounds to these issues is to simply unset the env var in question, which indicates that the env var could have safely been ignored to begin with.
This simply wrap all build/install/remove command with the usual default sandbox followed by env -u of the right environment variables you want to get rid of.
Now for a proper fix to this issue we should probably aim to have a whitelist system for environment variables where most environment variables (except things like PATH and explicitly set variables) are removed and users could add or pass-through specific environment variables using e.g. opam env pass-through OCAMLPARAM. But this is a breakage from previous versions and there are many things to consider (e.g. which environment variables to whitelist by default)
We could also consider a blacklist system to start with but the annoying part is that opam is supposed to be language agnostic (except for select modules in opam-client) so we'd have to route the list of those blacklisted environment variables (i.e. OCAMLPATH and OCAMLFIND_DESTDIR) back through to opam-core somehow. But nothing impossible.
Side note: A similar issue can be traced back to 2012 in #164 which was marked as fixed for opam 0.7.0. The fix back then (155f7f9) consisted in displaying warnings in case select OCAMLFIND_* variables were present (OCAMLPATH wasn't part of it for some reason). Since 2012 this code was removed entirely as far as I can see, but for your case, displaying a warning wouldn't be a solution anyway as those variables are added automatically by Nix.
There are certain environment variables that can affect OCaml builds that ideally should be ignored from the global environment and instead provided entirely by opam if they are really needed. These include:
OCAMLPATH
coq-stdlib.8.17.0 is affected by OCAMLPATH opam-repository#23635OCAMLFIND_DESTDIR
zarith affected by OCAMLFIND_DESTDIR opam-repository#23636The workarounds to these issues is to simply unset the env var in question, which indicates that the env var could have safely been ignored to begin with.
cc @kit-ty-kate
The text was updated successfully, but these errors were encountered: