summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2023-10-20 01:29:38 -0500
committerGitHub <noreply@github.com>2023-10-20 00:29:38 -0600
commit0907d437838cd3392708d2e0a2053b51e63f45ee (patch)
tree2ca252dc89f1ae219118061518209a47499e3275
parentc9e5173bbd84558e580b0d13fdeb2dae54deb96d (diff)
downloadspack-0907d437838cd3392708d2e0a2053b51e63f45ee.tar.gz
spack-0907d437838cd3392708d2e0a2053b51e63f45ee.tar.bz2
spack-0907d437838cd3392708d2e0a2053b51e63f45ee.tar.xz
spack-0907d437838cd3392708d2e0a2053b51e63f45ee.zip
Drop support for external PythonX.Y (#40628)
On some systems, multiple pythonx.y are placed in the same prefix as pythonx (where only one of them is associated with that pythonx). Spack external detection for Python was willing to register all of these as external versions. Moreover, the `package.py` for Python was able to distinguish these. This can cause an issue for some build systems, which will just look for python3 for example, so if that python3 is actually python3.6, and the build system needs 3.7 (which spack may have found in the same prefix, and offered as a suitable external), it will fail when invoking python3. To avoid that issue, we simply avoid treating pythonx.y as external candidates. In the above case, Spack would only detect a Python 3.6 external, and the build would be forced to use a Spack-built Python 3.7 (which we consider a good thing).
-rw-r--r--var/spack/repos/builtin/packages/python/package.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 83dbfb382f..8253ef0f9a 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -326,7 +326,7 @@ class Python(Package):
# An in-source build with --enable-optimizations fails for python@3.X
build_directory = "spack-build"
- executables = [r"^python[\d.]*[mw]?$"]
+ executables = [r"^python\d?$"]
@classmethod
def determine_version(cls, exe):