From 1b14170bd1cf259d56527cd430076f3cb9b8bc78 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Mon, 20 May 2024 18:56:48 -0600 Subject: [PATCH] gitlab ci: fix untouched spec pruning on windows (#44279) Use correct path separator in get_all_package_diffs for all platforms. Ensures correct package change computation on Windows when pruning unchanged specs in Gitlab CI --- lib/spack/spack/repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index 9b6f104fe5..743f5a18e8 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -241,7 +241,7 @@ def get_all_package_diffs(type, rev1="HEAD^1", rev2="HEAD"): Arguments: - type (str): String containing one or more of 'A', 'B', 'C' + type (str): String containing one or more of 'A', 'R', 'C' rev1 (str): Revision to compare against, default is 'HEAD^' rev2 (str): Revision to compare to rev1, default is 'HEAD' @@ -264,7 +264,7 @@ def get_all_package_diffs(type, rev1="HEAD^1", rev2="HEAD"): lines = [] if not out else re.split(r"\s+", out) changed = set() for path in lines: - pkg_name, _, _ = path.partition(os.sep) + pkg_name, _, _ = path.partition("/") if pkg_name not in added and pkg_name not in removed: changed.add(pkg_name)