From 27557a133ba2ad5c1fd5c874006f264693b4716b Mon Sep 17 00:00:00 2001 From: "Nicole C." <48625123+nicolecheetham@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:50:51 -0400 Subject: [PATCH] debug: Update cmd and test for Windows (#45309) * debug: Update cmd and test for Windows * Add comment tar options not supported by Win tar --- lib/spack/spack/cmd/debug.py | 4 +++- lib/spack/spack/test/cmd/debug.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/cmd/debug.py b/lib/spack/spack/cmd/debug.py index c4b5b427ad0..b1d33eb67df 100644 --- a/lib/spack/spack/cmd/debug.py +++ b/lib/spack/spack/cmd/debug.py @@ -6,6 +6,7 @@ import os import platform import re +import sys from datetime import datetime from glob import glob @@ -62,9 +63,10 @@ def create_db_tarball(args): base = os.path.basename(str(spack.store.STORE.root)) transform_args = [] + # Currently --transform and -s are not supported by Windows native tar if "GNU" in tar("--version", output=str): transform_args = ["--transform", "s/^%s/%s/" % (base, tarball_name)] - else: + elif sys.platform != "win32": transform_args = ["-s", "/^%s/%s/" % (base, tarball_name)] wd = os.path.dirname(str(spack.store.STORE.root)) diff --git a/lib/spack/spack/test/cmd/debug.py b/lib/spack/spack/test/cmd/debug.py index 1d29f441681..55d0928fbde 100644 --- a/lib/spack/spack/test/cmd/debug.py +++ b/lib/spack/spack/test/cmd/debug.py @@ -16,8 +16,6 @@ debug = SpackCommand("debug") -pytestmark = pytest.mark.not_on_windows("does not run on windows") - @pytest.mark.db def test_create_db_tarball(tmpdir, database):