summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-05-25 21:38:04 -0400
committerGitHub <noreply@github.com>2023-05-25 21:38:04 -0400
commit0b12a480eb7ccced87a153c1e89dfa7f3e307d84 (patch)
treeadcfb502738f46417471a70719d673c8844ef1cb
parent2d91a79af3fde9395cdfb04eb112b9f3fd9b66dc (diff)
downloadspack-0b12a480eb7ccced87a153c1e89dfa7f3e307d84.tar.gz
spack-0b12a480eb7ccced87a153c1e89dfa7f3e307d84.tar.bz2
spack-0b12a480eb7ccced87a153c1e89dfa7f3e307d84.tar.xz
spack-0b12a480eb7ccced87a153c1e89dfa7f3e307d84.zip
Windows MSVC: do not set sdk version if installing sdk (#37930)
Note the win-sdk package is not installable and reports an error which instructs the user how to add it. Without this fix, a (more confusing) error occurs before this message can be generated.
-rw-r--r--lib/spack/spack/compilers/msvc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index 54d159d6a7..6e9d1d0277 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -151,7 +151,11 @@ class Msvc(Compiler):
arch = arch.replace("-", "_")
# vcvars can target specific sdk versions, force it to pick up concretized sdk
# version, if needed by spec
- sdk_ver = "" if "win-sdk" not in pkg.spec else pkg.spec["win-sdk"].version.string + ".0"
+ sdk_ver = (
+ ""
+ if "win-sdk" not in pkg.spec or pkg.name == "win-sdk"
+ else pkg.spec["win-sdk"].version.string + ".0"
+ )
# provide vcvars with msvc version selected by concretization,
# not whatever it happens to pick up on the system (highest available version)
out = subprocess.check_output( # novermin