-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issues with automake based opam packages on OpenSuse cause of default site configure file #4423
Comments
I think this affects opam-repository, rather than opam itself? i.e. we want to change packages rather than opam? If you agree, I'll do a GH transfer of the issue. |
No, the idea is that opam should sanitize the environment when executing package configure / build code. Opam has features like a sandbox but then passes an environment to build code which leads to paths outside of the sandbox. |
Hmm, I fear one person's feature may be another person's poison! opam's sandbox is designed to protect your system, not control how the build runs. Once opam mandates doing this, what happens if you have a package which wants that to work? |
Yes, I am also afraid that this is not so easy to solve. I opened this issue mostly to discuss the options and also to make you aware of the situation that packages might fail to build on some platforms because they have One option to avoid users running into this would be to test all packages that they don't suffer from this and work around the issue for packages which do. Another option would be to have flags in the opam file what level of environment sanitization the package expects. E.g. one could reduce the environment passed through to the package build to the bare minimum but have a per package and/or per site opam option to pass through additional variables. But I am not sure if this leads to a better user experience since it makes things more complicated. Maybe in the end testing and working around the problem is the best option from a users perspective. Btw.: I did extensive tests with CONFIG_SITE unset on various platforms (Ubuntu, Fedora, OpenSuse, CentOS, Windows (cygwin + MinGW), MacOS) and a medium size set of opam packages (~ 150) and didn't see issues. So requiring this doesn't seem to be common at least. |
For a specific environment variable, it would be possible to depend on a "scrubbing" package, yes - the only nuisance is that once installed that scrubs it for everything. There would be potential for a list of environment variables to be scrubbed in an |
I think we still don't fully understand each other. What I propose is this:
My assumption is that this enhances the stability / portability of the build process because it reduces the amount of uncontrolled influence. I think it might be worthwhile to try it and see how many packages break in CI. I understand that there are various ways to get around the issues in case it is decided against this. |
We mused on this again yesterday:
|
Thanks for the update! In case it is not agreeable to do this by default, I would very much appreciate a way to configure this for a specific switch, as you suggest. Of course I can also handle this at the Coq Platform script level, but I would like that people can call |
OpenSuse 15.2. Leap has a default site configure script, that is it sets:
The referenced script sets among other things the
libdir
environment variable to a global system path unless it is already set. automake generated configure scripts always read a file pointed to byCONFIG_SITE
and this way get alibdir
variable which is not what it should be under opam.This might usually not be problematic because many opam packages set the prefix argument to configure scripts, which takes precednece over libdir. A notable exception are Coq opam files since they usually use
coqc -where
as prefix (rather thanocamlc -where
) and this default is sometimes embedded in the configure script rather than the opam file. In that case the system suppliedlibdir
path might take precedence.Anyway, I think opam should avoid that configure scripts get passed system libdir paths in any way. So I think opam should unset
CONFIG_SITE
. The alternative of settinglibdir
would not be favourable for Coq because, as mentioned, it needs a different libdir setting thanocamlc -where
, so this would break many Coq opam packages.Possibly this view is a bit Coq centric, so I am not sure one can say that this is an opam issue. There might be other possible solutions, but unsetting
CONFIG_SITE
would be (likely) the most favorable one for Coq.I am not sure if any depext packages would need
CONFIG_SITE
to be set.In the opam based Coq platform build scripts I unset
CONFIG_SITE
and this fixes the issues on OpenSuse.The text was updated successfully, but these errors were encountered: