summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-10-31 17:50:13 +0100
committerGitHub <noreply@github.com>2023-10-31 17:50:13 +0100
commit544a121248ff2f3b526b5c38cc4b14affb96ee57 (patch)
treec0597c9c6dd848a9410a5a8c7214783e0372a9b9 /var
parentcd6bb9e159ea18c46f399958558dfeb39bfb04a0 (diff)
downloadspack-544a121248ff2f3b526b5c38cc4b14affb96ee57.tar.gz
spack-544a121248ff2f3b526b5c38cc4b14affb96ee57.tar.bz2
spack-544a121248ff2f3b526b5c38cc4b14affb96ee57.tar.xz
spack-544a121248ff2f3b526b5c38cc4b14affb96ee57.zip
Fix interaction of spec literals that propagate variants with unify:false (#40789)
* Add tests to ensure variant propagation syntax can round-trip to/from string * Add a regression test for the bug in 35298 * Reconstruct the spec constraints in the worker process Specs do not preserve any information on propagation of variants when round-tripping to/from JSON (which we use to pickle), but preserve it when round-tripping to/from strings. Therefore, we pass a spec literal to the worker and reconstruct the Spec objects there.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/client-not-foo/package.py17
-rw-r--r--var/spack/repos/builtin.mock/packages/parent-foo/package.py21
2 files changed, 38 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/client-not-foo/package.py b/var/spack/repos/builtin.mock/packages/client-not-foo/package.py
new file mode 100644
index 0000000000..03c9374b3a
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/client-not-foo/package.py
@@ -0,0 +1,17 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack.package import *
+
+
+class ClientNotFoo(Package):
+ """This package has a variant "foo", which is False by default."""
+
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/c-1.0.tar.gz"
+
+ version("1.0", md5="0123456789abcdef0123456789abcdef")
+
+ variant("foo", default=False, description="")
diff --git a/var/spack/repos/builtin.mock/packages/parent-foo/package.py b/var/spack/repos/builtin.mock/packages/parent-foo/package.py
new file mode 100644
index 0000000000..61d15231f7
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/parent-foo/package.py
@@ -0,0 +1,21 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack.package import *
+
+
+class ParentFoo(Package):
+ """This package has a variant "foo", which is True by default, and depends on another
+ package which has the same variant defaulting to False.
+ """
+
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/c-1.0.tar.gz"
+
+ version("1.0", md5="0123456789abcdef0123456789abcdef")
+
+ variant("foo", default=True, description="")
+
+ depends_on("client-not-foo")