summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/depends-on-manyvariants/package.py25
-rw-r--r--var/spack/repos/builtin.mock/packages/depends-on-virtual-with-abi/package.py19
-rw-r--r--var/spack/repos/builtin.mock/packages/manyvariants/package.py33
-rw-r--r--var/spack/repos/builtin.mock/packages/splice-h/package.py9
-rw-r--r--var/spack/repos/builtin.mock/packages/splice-z/package.py8
-rw-r--r--var/spack/repos/builtin.mock/packages/virtual-abi-1/package.py25
-rw-r--r--var/spack/repos/builtin.mock/packages/virtual-abi-2/package.py25
-rw-r--r--var/spack/repos/builtin.mock/packages/virtual-abi-multi/package.py29
-rw-r--r--var/spack/repos/builtin.mock/packages/virtual-with-abi/package.py16
9 files changed, 187 insertions, 2 deletions
diff --git a/var/spack/repos/builtin.mock/packages/depends-on-manyvariants/package.py b/var/spack/repos/builtin.mock/packages/depends-on-manyvariants/package.py
new file mode 100644
index 0000000000..f1314471f9
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/depends-on-manyvariants/package.py
@@ -0,0 +1,25 @@
+# Copyright 2013-2024 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 DependsOnManyvariants(Package):
+ """
+ A package with a dependency on `manyvariants`, so that `manyvariants` can
+ be spliced in tests.
+ """
+
+ homepage = "https://www.test.com"
+ has_code = False
+
+ version("1.0")
+ version("2.0")
+
+ depends_on("manyvariants@1.0", when="@1.0")
+ depends_on("manyvariants@2.0", when="@2.0")
+
+ def install(self, spec, prefix):
+ touch(prefix.bar)
diff --git a/var/spack/repos/builtin.mock/packages/depends-on-virtual-with-abi/package.py b/var/spack/repos/builtin.mock/packages/depends-on-virtual-with-abi/package.py
new file mode 100644
index 0000000000..9f281f337b
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/depends-on-virtual-with-abi/package.py
@@ -0,0 +1,19 @@
+# Copyright 2013-2024 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 DependsOnVirtualWithAbi(Package):
+ """
+ This has a virtual dependency on `virtual-with-abi`, mostly for testing
+ automatic splicing of providers.
+ """
+
+ homepage = "https://www.example.com"
+ has_code = False
+
+ version("1.0")
+ depends_on("virtual-with-abi")
diff --git a/var/spack/repos/builtin.mock/packages/manyvariants/package.py b/var/spack/repos/builtin.mock/packages/manyvariants/package.py
new file mode 100644
index 0000000000..4747fab53f
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/manyvariants/package.py
@@ -0,0 +1,33 @@
+# Copyright 2013-2024 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 Manyvariants(Package):
+ """
+ A package with 4 different variants of different arities to test the
+ `match_variants` argument to `can_splice`
+ """
+
+ homepage = "https://www.test.com"
+ has_code = False
+
+ version("2.0.1")
+ version("2.0.0")
+ version("1.0.1")
+ version("1.0.0")
+
+ variant("a", default=True)
+ variant("b", default=False)
+ variant("c", values=("v1", "v2", "v3"), multi=False, default="v1")
+ variant("d", values=("v1", "v2", "v3"), multi=False, default="v1")
+
+ can_splice("manyvariants@1.0.0", when="@1.0.1", match_variants="*")
+ can_splice("manyvariants@2.0.0+a~b", when="@2.0.1~a+b", match_variants=["c", "d"])
+ can_splice("manyvariants@2.0.0 c=v1 d=v1", when="@2.0.1+a+b")
+
+ def install(self, spec, prefix):
+ touch(prefix.bar)
diff --git a/var/spack/repos/builtin.mock/packages/splice-h/package.py b/var/spack/repos/builtin.mock/packages/splice-h/package.py
index a54f1e7f7d..6f86f09f92 100644
--- a/var/spack/repos/builtin.mock/packages/splice-h/package.py
+++ b/var/spack/repos/builtin.mock/packages/splice-h/package.py
@@ -12,17 +12,24 @@ class SpliceH(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/splice-h-1.0.tar.gz"
- version("1.0", md5="0123456789abcdef0123456789abcdef")
+ version("1.0.2")
+ version("1.0.1")
+ version("1.0.0")
variant("foo", default=False, description="nope")
variant("bar", default=False, description="nope")
variant("baz", default=False, description="nope")
+ variant("compat", default=True, description="nope")
depends_on("splice-z")
depends_on("splice-z+foo", when="+foo")
provides("something")
provides("somethingelse")
+ provides("virtual-abi")
+
+ can_splice("splice-h@1.0.0 +compat", when="@1.0.1 +compat")
+ can_splice("splice-h@1.0.0:1.0.1 +compat", when="@1.0.2 +compat")
def install(self, spec, prefix):
with open(prefix.join("splice-h"), "w") as f:
diff --git a/var/spack/repos/builtin.mock/packages/splice-z/package.py b/var/spack/repos/builtin.mock/packages/splice-z/package.py
index ff73fbaa03..bac33be600 100644
--- a/var/spack/repos/builtin.mock/packages/splice-z/package.py
+++ b/var/spack/repos/builtin.mock/packages/splice-z/package.py
@@ -12,10 +12,16 @@ class SpliceZ(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/splice-z-1.0.tar.gz"
- version("1.0", md5="0123456789abcdef0123456789abcdef")
+ version("1.0.2")
+ version("1.0.1")
+ version("1.0.0")
variant("foo", default=False, description="nope")
variant("bar", default=False, description="nope")
+ variant("compat", default=True, description="nope")
+
+ can_splice("splice-z@1.0.0 +compat", when="@1.0.1 +compat")
+ can_splice("splice-z@1.0.0:1.0.1 +compat", when="@1.0.2 +compat")
def install(self, spec, prefix):
with open(prefix.join("splice-z"), "w") as f:
diff --git a/var/spack/repos/builtin.mock/packages/virtual-abi-1/package.py b/var/spack/repos/builtin.mock/packages/virtual-abi-1/package.py
new file mode 100644
index 0000000000..60a4c64f9e
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/virtual-abi-1/package.py
@@ -0,0 +1,25 @@
+# Copyright 2013-2024 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 VirtualAbi1(Package):
+ """
+ This package provides `virtual-with-abi` and is conditionally ABI
+ compatible with `virtual-abi-multi`
+ """
+
+ homepage = "https://www.example.com"
+ has_code = False
+
+ version("1.0")
+
+ provides("virtual-with-abi")
+
+ can_splice("virtual-abi-multi@1.0 abi=one", when="@1.0")
+
+ def install(self, spec, prefix):
+ touch(prefix.foo)
diff --git a/var/spack/repos/builtin.mock/packages/virtual-abi-2/package.py b/var/spack/repos/builtin.mock/packages/virtual-abi-2/package.py
new file mode 100644
index 0000000000..5725bf504c
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/virtual-abi-2/package.py
@@ -0,0 +1,25 @@
+# Copyright 2013-2024 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 VirtualAbi2(Package):
+ """
+ This package provides `virtual-with-abi` and is conditionally ABI
+ compatible with `virtual-abi-multi`
+ """
+
+ homepage = "https://www.example.com"
+ has_code = False
+
+ version("1.0")
+
+ provides("virtual-with-abi")
+
+ can_splice("virtual-abi-multi@1.0 abi=two", when="@1.0")
+
+ def install(self, spec, prefix):
+ touch(prefix.foo)
diff --git a/var/spack/repos/builtin.mock/packages/virtual-abi-multi/package.py b/var/spack/repos/builtin.mock/packages/virtual-abi-multi/package.py
new file mode 100644
index 0000000000..87cfd31544
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/virtual-abi-multi/package.py
@@ -0,0 +1,29 @@
+# Copyright 2013-2024 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 VirtualAbiMulti(Package):
+ """
+ This package provides `virtual-with-abi` is ABI compatible with either
+ `virtual-abi-1` or `virtual-abi-2` depending on the value of its `abi`
+ variant
+ """
+
+ homepage = "https://www.example.com"
+ has_code = False
+
+ version("1.0")
+
+ variant("abi", default="custom", multi=False, values=("one", "two", "custom"))
+
+ provides("virtual-with-abi")
+
+ can_splice("virtual-abi-1@1.0", when="@1.0 abi=one")
+ can_splice("virtual-abi-2@1.0", when="@1.0 abi=two")
+
+ def install(self, spec, prefix):
+ touch(prefix.foo)
diff --git a/var/spack/repos/builtin.mock/packages/virtual-with-abi/package.py b/var/spack/repos/builtin.mock/packages/virtual-with-abi/package.py
new file mode 100644
index 0000000000..1147efd202
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/virtual-with-abi/package.py
@@ -0,0 +1,16 @@
+# Copyright 2013-2024 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 VirtualWithAbi(Package):
+ """Virtual package for mocking an interface with stable ABI ."""
+
+ homepage = "https://www.abi.org/"
+ virtual = True
+
+ def test_hello(self):
+ print("Hello there!")