-
Notifications
You must be signed in to change notification settings - Fork 0
Python
If we use hardlinks, then Python will pick up site-packages from the profile. However, this may actually destroy how Python is intended to work -- if you use the system Python, you probably want to use the site-packages on the system as well. At any rate, relying on hardlinks for this doesn't work on clusters and seems overall fragile.
If we use symlinks, then we need to modify PYTHONPATH. Either by a) always have the user import a PYTHONPATH into the users environment, or b) by, per profile, compile a wrapper binary, as described below, so that only PATH (or the absolute path to the Python binary) is needed.
We could support the system Python by having a small C wrapper changing PYTHONPATH:
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
setenv("PYTHONPATH", "/foo/bar", 1);
execv("/usr/bin/python", argv);
}
This binary is debuggable, but gdb doesn't find debug information at startup. Hopefully we can find a way to transplant the debug information from the system Python to the Python wrapper...