conda-forge / compilers-feedstock

A conda-smithy repository for compilers.
BSD 3-Clause "New" or "Revised" License
9 stars 17 forks source link

set DYLD_FALLBACK_LIBRARY_PATH on activation for osx? #7

Closed beckermr closed 5 years ago

beckermr commented 5 years ago

Some build tools ignore the builtin linking flags. Setting this env var can fix linking problems in these cases. Given that this package is for convenience in a conda env, this seems like it would be ok.

Thoughts @conda-forge/compilers?

chrisburr commented 5 years ago

So the idea behind this is that some user built binaries won't have the run path set correctly for finding libraries? Using DYLD_FALLBACK_LIBRARY_PATH will make it "magically" work in these cases?

beckermr commented 5 years ago

Yup! You point it at the current env lib dir.

chrisburr commented 5 years ago

That seems reasonable to me if nobody has objections.

scopatz commented 5 years ago

I think that conda really doesn't want you doing this kind of thing. @jjhelmus @mingwandroid @msarahan may be able to give a deeper opinion.

msarahan commented 5 years ago

That env var is a pain to work with. Apple in their infinite wisdom have given it very special behavior. https://github.com/jupyterlab/jupyterlab/issues/4918 for example. It's not a good thing to depend on. It's better to figure out the correct RPATH changes and not depend on that env var.

beckermr commented 5 years ago

Ohhhhh fun. The idea was to do this in case your build tool is ignoring the RPATHs that are needed to link against libs in a non-standard spot. I wonder if DYLD_LIBRARY_PATH is any better.

mingwandroid commented 5 years ago

All DYLD_* vars are removed from called processes when SIP is active. This is the case since 10.12 (I think).

The risk is, by enabling this flag, you end up making software that also needs it to be set.

Of course that risk can be mitigated in testing. However, while you may be able to avoid SIP on some CI systems (verify with csr status) at present, don't expect that to continue. If I ran a farm of macOS machines or VMs that random people on the internet could spin-up, I'd definitely want SIP enabled on them all.

beckermr commented 5 years ago

Right. This feedstock is for using the conda build tools locally as compilers, not for building packages, but point well taken. I guess people just have to not ignore the env vars for things like linking flags.

mingwandroid commented 5 years ago

It will be in any upstreams' interest to fix their build systems in the face of SIP. Most already have, and I think a PR would probably be helpful for those that have not.

beckermr commented 5 years ago

Agreed. I am more thinking of me writing a dumb makefile, but I probably should fix it as well! ;p

beckermr commented 5 years ago

I am closing this issue for now. Thanks everyone!