1

I need to build a redistributable, self-contained Python environment using pyenv on macOS.

The problem I'm running into is that there are dependencies on dynamic libraries. These dependencies include the full path of the dynamic library (e.g., libssl.1.0.0.dylib under /usr/local/opt/). For example, one of the dependencies of the Python ssl module is lib-dynload/_ssl.cpython-37m-darwin.so which references the system libssl.

I cannot redistribute this because users don't always have openssl in the same directory as my build machine. I cannot control the location where users will install my bundle because it will be in their home directory. So absolute paths are right now.

I considered using rpath, which lets dynamic libraries specify their dependencies with relative paths. That appears to have security issues, so I'd prefer not to use it.

Is it possible to configure pyenv to use static libraries when possible, such as for openssl?

2
  • Have you seen stackoverflow.com/questions/48796014/…? Commented Oct 13, 2019 at 19:44
  • @MattW. If I were compiling just Python it would be easier because I'd have direct control over the command line. I need to use pyenv for backward compatibility, so my question is specifically about configuring or tricking pyenv into doing this. Also, you can't build static binaries on macOS. Commented Oct 14, 2019 at 5:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.