summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smillie <83249606+jamessmillie@users.noreply.github.com>2024-10-18 15:37:41 -0600
committerGitHub <noreply@github.com>2024-10-18 14:37:41 -0700
commit899004e29a733a0a741e7e3c80fd706cb3e03b3c (patch)
tree3b59cfc049e1fe935124c15782c4f3bc9b576e34
parentdf6427d2598cf573651acbef90aa87c3db8bfd9f (diff)
downloadspack-899004e29a733a0a741e7e3c80fd706cb3e03b3c.tar.gz
spack-899004e29a733a0a741e7e3c80fd706cb3e03b3c.tar.bz2
spack-899004e29a733a0a741e7e3c80fd706cb3e03b3c.tar.xz
spack-899004e29a733a0a741e7e3c80fd706cb3e03b3c.zip
Boost: fix logic for controlling which libs build on Windows (#46414)
Older builds of Boost were failing on Windows because they were adding --without-... flags for libraries that did not exist in those versions. So: * lib variants are updated with version range info (current range info for libs is not comprehensive, but represents changes over the last few minor versions up to 1.85) * On Windows, --without-... options are omitted for libraries when they don't exist for the version of boost being built. Non-Windows uses a different approach, which was not affected because the new libraries were not activated by default. It would benefit from similar attention though to avoid potential future issues.
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index 50cd7d5a46..908ea40a89 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -154,8 +154,12 @@ class Boost(Package):
"wave",
]
+ # Add any extra requirements for specific
+ all_libs_opts = {"charconv": {"when": "@1.85.0:"}, "cobalt": {"when": "@1.84.0:"}}
+
for lib in all_libs:
- variant(lib, default=False, description="Compile with {0} library".format(lib))
+ lib_opts = all_libs_opts.get(lib, {})
+ variant(lib, default=False, description="Compile with {0} library".format(lib), **lib_opts)
@property
def libs(self):
@@ -624,9 +628,13 @@ class Boost(Package):
options.append("runtime-link=shared")
else:
options.append("runtime-link=static")
+
+ # Any lib that is in self.all_libs AND in the variants dictionary
+ # AND is set to False should be added to options in a --without flag
for lib in self.all_libs:
- if f"+{lib}" not in spec:
- options.append(f"--without-{lib}")
+ if lib not in self.spec.variants.dict or self.spec.satisfies(f"+{lib}"):
+ continue
+ options.append(f"--without-{lib}")
if not spec.satisfies("@:1.75 %intel") and not spec.satisfies("platform=windows"):
# When building any version >= 1.76, the toolset must be specified.