From a6eed4a7c7cbf067c061f982b9ae6c2675c990bc Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sun, 13 Mar 2022 16:51:55 +0100 Subject: 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 --- var/spack/repos/builtin.mock/packages/callpath/package.py | 4 ++-- .../repos/builtin.mock/packages/cmake-client/package.py | 10 +++++----- var/spack/repos/builtin.mock/packages/cmake/package.py | 8 ++++---- .../repos/builtin.mock/packages/conflict-parent/package.py | 4 ++-- var/spack/repos/builtin.mock/packages/conflict/package.py | 4 ++-- .../repos/builtin.mock/packages/hash-test1/package.py | 2 +- .../repos/builtin.mock/packages/hash-test2/package.py | 2 +- .../repos/builtin.mock/packages/hash-test3/package.py | 2 +- .../builtin.mock/packages/module-path-separator/package.py | 14 +++++++------- var/spack/repos/builtin.mock/packages/mpileaks/package.py | 4 ++-- var/spack/repos/builtin/packages/metall/package.py | 5 ----- var/spack/repos/tutorial/packages/elpa/package.py | 2 +- var/spack/repos/tutorial/packages/mpich/package.py | 2 +- 13 files changed, 29 insertions(+), 34 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/callpath/package.py b/var/spack/repos/builtin.mock/packages/callpath/package.py index ac5122fafc..3f3da665a9 100644 --- a/var/spack/repos/builtin.mock/packages/callpath/package.py +++ b/var/spack/repos/builtin.mock/packages/callpath/package.py @@ -22,5 +22,5 @@ class Callpath(Package): 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) diff --git a/var/spack/repos/builtin.mock/packages/cmake-client/package.py b/var/spack/repos/builtin.mock/packages/cmake-client/package.py index 43037eb22e..09b445fd49 100644 --- a/var/spack/repos/builtin.mock/packages/cmake-client/package.py +++ b/var/spack/repos/builtin.mock/packages/cmake-client/package.py @@ -54,20 +54,20 @@ class CmakeClient(CMakePackage): 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 diff --git a/var/spack/repos/builtin.mock/packages/cmake/package.py b/var/spack/repos/builtin.mock/packages/cmake/package.py index aaa03b22f0..e5dd7057d1 100644 --- a/var/spack/repos/builtin.mock/packages/cmake/package.py +++ b/var/spack/repos/builtin.mock/packages/cmake/package.py @@ -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 diff --git a/var/spack/repos/builtin.mock/packages/conflict-parent/package.py b/var/spack/repos/builtin.mock/packages/conflict-parent/package.py index 2cd67ec177..64abfe3525 100644 --- a/var/spack/repos/builtin.mock/packages/conflict-parent/package.py +++ b/var/spack/repos/builtin.mock/packages/conflict-parent/package.py @@ -23,5 +23,5 @@ class ConflictParent(Package): 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) diff --git a/var/spack/repos/builtin.mock/packages/conflict/package.py b/var/spack/repos/builtin.mock/packages/conflict/package.py index b08da7606b..891a6c9ec2 100644 --- a/var/spack/repos/builtin.mock/packages/conflict/package.py +++ b/var/spack/repos/builtin.mock/packages/conflict/package.py @@ -23,5 +23,5 @@ class Conflict(Package): 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) diff --git a/var/spack/repos/builtin.mock/packages/hash-test1/package.py b/var/spack/repos/builtin.mock/packages/hash-test1/package.py index ec9a10091f..22ffae43d1 100644 --- a/var/spack/repos/builtin.mock/packages/hash-test1/package.py +++ b/var/spack/repos/builtin.mock/packages/hash-test1/package.py @@ -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') diff --git a/var/spack/repos/builtin.mock/packages/hash-test2/package.py b/var/spack/repos/builtin.mock/packages/hash-test2/package.py index 4623fb1134..fffcc22274 100644 --- a/var/spack/repos/builtin.mock/packages/hash-test2/package.py +++ b/var/spack/repos/builtin.mock/packages/hash-test2/package.py @@ -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): diff --git a/var/spack/repos/builtin.mock/packages/hash-test3/package.py b/var/spack/repos/builtin.mock/packages/hash-test3/package.py index fc97d59284..69e9922b79 100644 --- a/var/spack/repos/builtin.mock/packages/hash-test3/package.py +++ b/var/spack/repos/builtin.mock/packages/hash-test3/package.py @@ -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') diff --git a/var/spack/repos/builtin.mock/packages/module-path-separator/package.py b/var/spack/repos/builtin.mock/packages/module-path-separator/package.py index 18254babf4..6029853531 100644 --- a/var/spack/repos/builtin.mock/packages/module-path-separator/package.py +++ b/var/spack/repos/builtin.mock/packages/module-path-separator/package.py @@ -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=";") diff --git a/var/spack/repos/builtin.mock/packages/mpileaks/package.py b/var/spack/repos/builtin.mock/packages/mpileaks/package.py index 91ea1980f6..0fe96b419d 100644 --- a/var/spack/repos/builtin.mock/packages/mpileaks/package.py +++ b/var/spack/repos/builtin.mock/packages/mpileaks/package.py @@ -30,5 +30,5 @@ class Mpileaks(Package): 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) diff --git a/var/spack/repos/builtin/packages/metall/package.py b/var/spack/repos/builtin/packages/metall/package.py index ffad5e2822..9c7ec1644d 100644 --- a/var/spack/repos/builtin/packages/metall/package.py +++ b/var/spack/repos/builtin/packages/metall/package.py @@ -45,11 +45,6 @@ class Metall(CMakePackage): 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: diff --git a/var/spack/repos/tutorial/packages/elpa/package.py b/var/spack/repos/tutorial/packages/elpa/package.py index a6c7ea6260..6d7dc82b20 100644 --- a/var/spack/repos/tutorial/packages/elpa/package.py +++ b/var/spack/repos/tutorial/packages/elpa/package.py @@ -44,7 +44,7 @@ class Elpa(AutotoolsPackage): 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 diff --git a/var/spack/repos/tutorial/packages/mpich/package.py b/var/spack/repos/tutorial/packages/mpich/package.py index 10a5381095..b5befe995d 100644 --- a/var/spack/repos/tutorial/packages/mpich/package.py +++ b/var/spack/repos/tutorial/packages/mpich/package.py @@ -75,7 +75,7 @@ spack package at this time.''', 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') -- cgit v1.2.3-70-g09d2