Remove "setup_environment" and "setup_dependent_environment" (#29463)
fixes #29446 The new setup_*_environment functions have been falling back to calling the old functions and warn the user since #11115. This commit removes the fallback behavior and any use of: - setup_environment - setup_dependent_environment in the codebase
This commit is contained in:

committed by
GitHub

parent
406939f485
commit
a6eed4a7c7
@@ -22,5 +22,5 @@ def install(self, spec, prefix):
|
||||
make()
|
||||
make("install")
|
||||
|
||||
def setup_environment(self, senv, renv):
|
||||
renv.set('FOOBAR', self.name)
|
||||
def setup_run_environment(self, env):
|
||||
env.set('FOOBAR', self.name)
|
||||
|
@@ -54,20 +54,20 @@ def do_not_execute(self):
|
||||
def setup_build_environment(self, spack_env):
|
||||
spack_cc # Ensure spack module-scope variable is avaiabl
|
||||
check(from_cmake == "from_cmake",
|
||||
"setup_environment couldn't read global set by cmake.")
|
||||
"setup_build_environment couldn't read global set by cmake.")
|
||||
|
||||
check(self.spec['cmake'].link_arg == "test link arg",
|
||||
"link arg on dependency spec not readable from "
|
||||
"setup_environment.")
|
||||
"setup_build_environment.")
|
||||
|
||||
def setup_dependent_build_environment(self, spack_env, dspec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
spack_cc # Ensure spack module-scope variable is avaiable
|
||||
check(from_cmake == "from_cmake",
|
||||
"setup_dependent_environment couldn't read global set by cmake.")
|
||||
"setup_dependent_build_environment couldn't read global set by cmake.")
|
||||
|
||||
check(self.spec['cmake'].link_arg == "test link arg",
|
||||
"link arg on dependency spec not readable from "
|
||||
"setup_dependent_environment.")
|
||||
"setup_dependent_build_environment.")
|
||||
|
||||
def setup_dependent_package(self, module, dspec):
|
||||
spack_cc # Ensure spack module-scope variable is avaiable
|
||||
|
@@ -22,13 +22,13 @@ class Cmake(Package):
|
||||
version('3.4.3', '4cb3ff35b2472aae70f542116d616e63',
|
||||
url='https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz')
|
||||
|
||||
def setup_environment(self, spack_env, run_env):
|
||||
def setup_build_environment(self, env):
|
||||
spack_cc # Ensure spack module-scope variable is avaiable
|
||||
spack_env.set('for_install', 'for_install')
|
||||
env.set('for_install', 'for_install')
|
||||
|
||||
def setup_dependent_environment(self, spack_env, run_env, dspec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
spack_cc # Ensure spack module-scope variable is avaiable
|
||||
spack_env.set('from_cmake', 'from_cmake')
|
||||
env.set('from_cmake', 'from_cmake')
|
||||
|
||||
def setup_dependent_package(self, module, dspec):
|
||||
spack_cc # Ensure spack module-scope variable is avaiable
|
||||
|
@@ -23,5 +23,5 @@ def install(self, spec, prefix):
|
||||
make()
|
||||
make("install")
|
||||
|
||||
def setup_environment(self, senv, renv):
|
||||
renv.set('FOOBAR', self.name)
|
||||
def setup_run_environment(self, env):
|
||||
env.set('FOOBAR', self.name)
|
||||
|
@@ -23,5 +23,5 @@ def install(self, spec, prefix):
|
||||
make()
|
||||
make("install")
|
||||
|
||||
def setup_environment(self, senv, renv):
|
||||
renv.set('FOOBAR', self.name)
|
||||
def setup_run_environment(self, env):
|
||||
env.set('FOOBAR', self.name)
|
||||
|
@@ -29,7 +29,7 @@ class HashTest1(Package):
|
||||
variant('variantx', default=False, description='Test variant X')
|
||||
variant('varianty', default=False, description='Test variant Y')
|
||||
|
||||
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
pass
|
||||
|
||||
@when('@:1.4')
|
||||
|
@@ -25,7 +25,7 @@ class HashTest2(Package):
|
||||
variant('variantx', default=False, description='Test variant X')
|
||||
variant('varianty', default=False, description='Test variant Y')
|
||||
|
||||
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
pass
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
@@ -24,7 +24,7 @@ class HashTest3(Package):
|
||||
variant('variantx', default=False, description='Test variant X')
|
||||
variant('varianty', default=False, description='Test variant Y')
|
||||
|
||||
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
pass
|
||||
|
||||
@when('@:1.4')
|
||||
|
@@ -12,11 +12,11 @@ class ModulePathSeparator(Package):
|
||||
|
||||
version(1.0, '0123456789abcdef0123456789abcdef')
|
||||
|
||||
def setup_environment(self, senv, renv):
|
||||
renv.append_path("COLON", "foo")
|
||||
renv.prepend_path("COLON", "foo")
|
||||
renv.remove_path("COLON", "foo")
|
||||
def setup_run_environment(self, env):
|
||||
env.append_path("COLON", "foo")
|
||||
env.prepend_path("COLON", "foo")
|
||||
env.remove_path("COLON", "foo")
|
||||
|
||||
renv.append_path("SEMICOLON", "bar", separator=";")
|
||||
renv.prepend_path("SEMICOLON", "bar", separator=";")
|
||||
renv.remove_path("SEMICOLON", "bar", separator=";")
|
||||
env.append_path("SEMICOLON", "bar", separator=";")
|
||||
env.prepend_path("SEMICOLON", "bar", separator=";")
|
||||
env.remove_path("SEMICOLON", "bar", separator=";")
|
||||
|
@@ -30,5 +30,5 @@ def install(self, spec, prefix):
|
||||
touch(prefix.mpileaks)
|
||||
mkdirp(prefix.man)
|
||||
|
||||
def setup_environment(self, senv, renv):
|
||||
renv.set('FOOBAR', self.name)
|
||||
def setup_run_environment(self, env):
|
||||
env.set('FOOBAR', self.name)
|
||||
|
@@ -45,11 +45,6 @@ def cmake_args(self):
|
||||
args = ['-DINSTALL_HEADER_ONLY=ON']
|
||||
return args
|
||||
|
||||
# Set environmental variables for the build step
|
||||
# setup_environment() was replaced by setup_build_environment()?
|
||||
# (https://github.com/spack/spack/pull/11115)
|
||||
# This page has not been updated?
|
||||
# https://spack-tutorial.readthedocs.io/en/latest/tutorial_advanced_packaging.html
|
||||
def setup_build_environment(self, env):
|
||||
# Configure the directories for test
|
||||
if self.run_tests:
|
||||
|
@@ -44,7 +44,7 @@ def libs(self):
|
||||
|
||||
build_directory = 'spack-build'
|
||||
|
||||
def setup_environment(self, spack_env, run_env):
|
||||
def setup_run_environment(self, env):
|
||||
# TUTORIAL: set the following environment variables:
|
||||
#
|
||||
# CC=spec['mpi'].mpicc
|
||||
|
@@ -75,7 +75,7 @@ class Mpich(AutotoolsPackage):
|
||||
conflicts('netmod=mxm', when='@:3.1.3')
|
||||
conflicts('netmod=tcp', when='device=ch4')
|
||||
|
||||
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
# TUTORIAL: set the following variables for dependents:
|
||||
#
|
||||
# MPICC=join_path(self.prefix.bin, 'mpicc')
|
||||
|
Reference in New Issue
Block a user