Mass conversion of setup_(dependent_)?environment (#13924)
* Mass conversion of setup_(dependent_)?environment * prefix -> self.prefix
This commit is contained in:
@@ -942,7 +942,7 @@ def mpi_setup_dependent_build_environment(
|
||||
for key, value in wrapper_vars.items():
|
||||
env.set(key, value)
|
||||
|
||||
debug_print("adding to spack_env:", wrapper_vars)
|
||||
debug_print("adding to build env:", wrapper_vars)
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# General support for child packages
|
||||
@@ -1054,7 +1054,7 @@ def _setup_dependent_env_callback(
|
||||
env.append_path('SPACK_COMPILER_EXTRA_RPATHS',
|
||||
env_mods['SPACK_COMPILER_EXTRA_RPATHS'])
|
||||
|
||||
debug_print("adding/modifying spack_env:", env_mods)
|
||||
debug_print("adding/modifying build env:", env_mods)
|
||||
|
||||
if '+mpi' in self.spec or self.provides('mpi'):
|
||||
if compilers_of_client:
|
||||
|
@@ -29,12 +29,11 @@ class OctavePackage(PackageBase):
|
||||
extends('octave')
|
||||
depends_on('octave', type=('build', 'run'))
|
||||
|
||||
def setup_environment(self, spack_env, run_env):
|
||||
"""Set up the compile and runtime environments for a package."""
|
||||
def setup_build_environment(self, env):
|
||||
# octave does not like those environment variables to be set:
|
||||
spack_env.unset('CC')
|
||||
spack_env.unset('CXX')
|
||||
spack_env.unset('FC')
|
||||
env.unset('CC')
|
||||
env.unset('CXX')
|
||||
env.unset('FC')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
"""Install the package from the archive file"""
|
||||
|
@@ -141,7 +141,6 @@ def invalid_sha256_digest(fetcher):
|
||||
assert [] == errors
|
||||
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_api_for_build_and_run_environment():
|
||||
"""Ensure that every package uses the correct API to set build and
|
||||
run environment, and not the old one.
|
||||
@@ -154,7 +153,7 @@ def test_api_for_build_and_run_environment():
|
||||
failing.append(pkg)
|
||||
|
||||
msg = ('there are {0} packages using the old API to set build '
|
||||
'and run environment [{1}], for further information see'
|
||||
'and run environment [{1}], for further information see '
|
||||
'https://github.com/spack/spack/pull/11115')
|
||||
assert not failing, msg.format(
|
||||
len(failing), ','.join(x.name for x in failing)
|
||||
@@ -182,7 +181,9 @@ def test_prs_update_old_api():
|
||||
if failed:
|
||||
failing.append(name)
|
||||
|
||||
msg = 'there are {0} packages still using old APIs in this PR [{1}]'
|
||||
msg = ('there are {0} packages using the old API to set build '
|
||||
'and run environment [{1}], for further information see '
|
||||
'https://github.com/spack/spack/pull/11115')
|
||||
assert not failing, msg.format(
|
||||
len(failing), ','.join(failing)
|
||||
)
|
||||
|
Reference in New Issue
Block a user