bazel: python executable required (#28286)

* bazel: python executable required

* python: add autodetection of +pythoncmd
This commit is contained in:
Adam J. Stewart 2022-01-06 15:16:43 -06:00 committed by GitHub
parent 6e31094d77
commit 186730a284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -110,7 +110,7 @@ class Bazel(Package):
variant('nodepfail', default=True, description='Disable failing dependency checks due to injected absolute paths - required for most builds using bazel with spack')
depends_on('java', type=('build', 'run'))
depends_on('python', type=('build', 'run'))
depends_on('python+pythoncmd', type=('build', 'run'))
depends_on('zip', when='platform=linux', type=('build', 'run'))
# make work on power9 (2x commits)

View File

@ -271,6 +271,13 @@ def determine_variants(cls, exes, version_str):
python = Executable(exes[0])
variants = ''
for exe in exes:
if os.path.basename(exe) == 'python':
variants += '+pythoncmd'
break
else:
variants += '~pythoncmd'
for module in ['readline', 'sqlite3', 'dbm', 'nis',
'zlib', 'bz2', 'lzma', 'ctypes', 'uuid']:
try: