summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2021-08-27 11:46:26 -0700
committerGitHub <noreply@github.com>2021-08-27 18:46:26 +0000
commitb5d3c488241e8fec1133aadea73d6bd0a6e244f5 (patch)
tree71ac95de9707b49d5dd492cf14d1d78240fbae5a /lib
parent9d17d474ff8d7a344a26b5de382682149684f4f2 (diff)
downloadspack-b5d3c488241e8fec1133aadea73d6bd0a6e244f5.tar.gz
spack-b5d3c488241e8fec1133aadea73d6bd0a6e244f5.tar.bz2
spack-b5d3c488241e8fec1133aadea73d6bd0a6e244f5.tar.xz
spack-b5d3c488241e8fec1133aadea73d6bd0a6e244f5.zip
Load package environment prior to stand-alone/smoke test execution (#25619)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 7e99dc6441..97903075e1 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -61,6 +61,7 @@ import spack.repo
import spack.schema.environment
import spack.store
import spack.subprocess_context
+import spack.user_environment
import spack.util.path
from spack.error import NoHeadersError, NoLibrariesError
from spack.util.cpus import cpus_available
@@ -69,6 +70,7 @@ from spack.util.environment import (
env_flag,
filter_system_paths,
get_path,
+ inspect_path,
is_system_path,
preserve_environment,
system_dirs,
@@ -781,6 +783,13 @@ def setup_package(pkg, dirty, context='build'):
"config to assume that the package is part of the system"
" includes and omit it when invoked with '--cflags'.")
elif context == 'test':
+ env.extend(
+ inspect_path(
+ pkg.spec.prefix,
+ spack.user_environment.prefix_inspections(pkg.spec.platform),
+ exclude=is_system_path
+ )
+ )
pkg.setup_run_environment(env)
env.prepend_path('PATH', '.')