From 8e7489bc172442a49ac03263a3032c6829c96f21 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 28 Feb 2025 23:33:02 +0100 Subject: [PATCH] Revert "Honor `cmake_prefix_paths` property if available (#42569)" (#49237) This reverts commit fe171a560b4f7b55a4e40feaebaf5c0bc9ff8193. --- lib/spack/spack/build_environment.py | 4 ---- lib/spack/spack/test/cmd/load.py | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index e44cc40d553..3e1663131c0 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -1234,10 +1234,6 @@ def _make_runnable(self, dep: spack.spec.Spec, env: EnvironmentModifications): if os.path.isdir(bin_dir): env.prepend_path("PATH", bin_dir) - for cp_dir in spack.build_systems.cmake.get_cmake_prefix_path(dep.package): - env.append_path("CMAKE_PREFIX_PATH", cp_dir) - env.prune_duplicate_paths("CMAKE_PREFIX_PATH") - def _setup_pkg_and_run( serialized_pkg: "spack.subprocess_context.PackageInstallContext", diff --git a/lib/spack/spack/test/cmd/load.py b/lib/spack/spack/test/cmd/load.py index 58fc8a2b4c1..125a8ed0325 100644 --- a/lib/spack/spack/test/cmd/load.py +++ b/lib/spack/spack/test/cmd/load.py @@ -52,8 +52,7 @@ def test_load_shell(shell, set_command): mpileaks_spec = spack.concretize.concretize_one("mpileaks") # Ensure our reference variable is clean. - hello_world_paths = [os.path.normpath(p) for p in ("/hello", "/world")] - os.environ["CMAKE_PREFIX_PATH"] = os.pathsep.join(hello_world_paths) + os.environ["CMAKE_PREFIX_PATH"] = "/hello" + os.pathsep + "/world" shell_out = load(shell, "mpileaks") @@ -70,7 +69,7 @@ def extract_value(output, variable): paths_shell = extract_value(shell_out, "CMAKE_PREFIX_PATH") # We should've prepended new paths, and keep old ones. - assert paths_shell[-2:] == hello_world_paths + assert paths_shell[-2:] == ["/hello", "/world"] # All but the last two paths are added by spack load; lookup what packages they're from. pkgs = [prefix_to_pkg(p) for p in paths_shell[:-2]]