Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override sys.prefix only if it hasn't been changed
The purpose of the sitecustomize here is to make setuptools install stuff to our prefix instead of the global prefix, and to appear enough like a virtual environment that platform-specific patches to sysconfig don't interfere with that effort. It isn't inconceivable that there may be subprocesses involved in the build, and we want any installation happening in those subprocesses to also get the redirect, and that currently works as expected as long as the sitecustomize directory remains on PYTHONPATH somewhere. However, if some subprocess is also modifying sys.path, as would be the case if a subprocess was using a new virtual environment, we don't want to override those changes. Since we know what sys.prefix was when colcon was invoked, we can just check to see if it changed.
- Loading branch information