Ci: ensure file path comparsion uses posix paths (#47033)

Git always produces posix paths, ensure we're always comparsing apples to apples by normalizing paths compared to git output to posix.
This commit is contained in:
John W. Parent 2025-02-12 14:14:16 -05:00 committed by GitHub
parent 0172208c52
commit fd59d3e589
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@
from typing import Callable, Dict, List, Set from typing import Callable, Dict, List, Set
from urllib.request import Request from urllib.request import Request
import llnl.path
import llnl.util.filesystem as fs import llnl.util.filesystem as fs
import llnl.util.tty as tty import llnl.util.tty as tty
from llnl.util.tty.color import cescape, colorize from llnl.util.tty.color import cescape, colorize
@ -83,6 +84,9 @@ def get_stack_changed(env_path, rev1="HEAD^", rev2="HEAD"):
whether or not the stack was changed. Returns True if the environment whether or not the stack was changed. Returns True if the environment
manifest changed between the provided revisions (or additionally if the manifest changed between the provided revisions (or additionally if the
`.gitlab-ci.yml` file itself changed). Returns False otherwise.""" `.gitlab-ci.yml` file itself changed). Returns False otherwise."""
# git returns posix paths always, normalize input to be comptaible
# with that
env_path = llnl.path.convert_to_posix_path(env_path)
git = spack.util.git.git() git = spack.util.git.git()
if git: if git:
with fs.working_dir(spack.paths.prefix): with fs.working_dir(spack.paths.prefix):