spack/lib/spack/docs/build_systems
Harmen Stoppels 125206d44d
python: always use a venv (#40773)
This commit adds a layer of indirection to improve build isolation with 
and without external Python, as well as usability of environment views.

It adds `python-venv` as a dependency to all packages that `extends("python")`, 
which has the following advantages:

1. Build isolation: only `PYTHONPATH` is considered in builds, not 
   user / system packages
2. Stable install layout: fixes the problem on Debian, RHEL and Fedora where 
   external / system python produces `bin/local` subdirs in Spack install prefixes. 
3. Environment views are Python virtual environments (and if you add 
   `py-pip` things like `pip list` work)

Views work whether they're symlink, hardlink or copy type.

This commit additionally makes `spec["python"].command` return 
`spec["python-venv"].command`. The rationale is that packages in repos we do 
not own do not pass the underlying python to the build system, which could still 
result in incorrectly computed install layouts.

Other attributes like `libs`, `headers` should be on `python` anyways and need no change.
2024-05-06 16:17:35 +02:00
..
Autoconf-automake-process.svg
autotoolspackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
bundlepackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
cachedcmakepackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
cmakepackage.rst Fix CMake generator documentation (#43232) 2024-03-18 10:02:33 +01:00
cudapackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
custompackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
inteloneapipackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
intelpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
luapackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
makefilepackage.rst Improve "makefile" build system documentation (#41781) 2024-01-09 15:44:21 +00:00
mavenpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
mesonpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
octavepackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
perlpackage.rst perl testing: refactor stand-alone testing into base class (#43044) 2024-03-12 15:39:18 +01:00
pythonpackage.rst python: always use a venv (#40773) 2024-05-06 16:17:35 +02:00
qmakepackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
racketpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
rocmpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
rpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
rubypackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
sconspackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
sippackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
sourceforgepackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
wafpackage.rst Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00