diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2024-06-04 17:52:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 09:52:21 -0600 |
commit | 278f5818b7bf67a7544a4d9733fc9c0eb605f6c6 (patch) | |
tree | 687e602ed873aafcd87c6e771643bbd0a3b60d70 /COPYRIGHT | |
parent | c2e85202c7d2692cd3384bbfde88c6af7499d312 (diff) | |
download | spack-278f5818b7bf67a7544a4d9733fc9c0eb605f6c6.tar.gz spack-278f5818b7bf67a7544a4d9733fc9c0eb605f6c6.tar.bz2 spack-278f5818b7bf67a7544a4d9733fc9c0eb605f6c6.tar.xz spack-278f5818b7bf67a7544a4d9733fc9c0eb605f6c6.zip |
python: make every view a `venv` (#44382)
#40773 introduced python-venv, which improved build isolation and avoids issues with,
e.g., `ubuntu`'s system python modifying `sysconfig` to include a (very unwanted)
`local` directory within the default install layout.
This addresses a few cases where #40773 removed functionality, without harming the
default cases where we use `python-venv`.
Traditionally, *every* view with `python` in it was essentially a virtual environment,
because we would copy the `python` interpreter and `os.py` into every view when linking.
We now rely on `python-venv` to do that, but only when it's used (i.e. new builds) and
only for packages that have an `extends("python")` directive.
This again makes every view with `python` in it a virtual environment, but only
if we're not already using a package like `python-venv`. This uses a different
mechanism from before -- instead of using the `virtualenv` trick of copying `python`
into the prefix, we instead create a `pyvenv.cfg` like `venv` (the more modern way
to do it).
This fixes two things:
1. If you already had an environment before Spack `v0.22` that worked, it would
stop working without a reconcretize and rebuild in `v0.22`, because we no longer
copy the python interpreter on link. Adding `pyvenv.cfg` fixes this in a more
modern way, so old views will keep working.
2. If you have an env that only includes python packages that use `depends_on("python")`
instead of `extends("python")`, those packages will now be importable as before,
though they won't have the same level of build isolation you'd get with `extends`
and `python-venv`.
* views: avoid making client code deal with link functions
Users of views and ViewDescriptors shouldn't have to deal with link functions -- they
should just say what type of linking they want.
- [x] views take a link_type, not a link function
- [x] views work out the link function from the link type
- [x] view descriptors and commands now just tell the view what they want.
* python: simplify logic for avoiding pyvenv.cfg in copy views
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'COPYRIGHT')
0 files changed, 0 insertions, 0 deletions