Skip to content

Commit

Permalink
Merge branch 'main' into dholladay00/release_190
Browse files Browse the repository at this point in the history
  • Loading branch information
dholladay00 committed Jul 29, 2024
2 parents a51e9a3 + 864c674 commit a058975
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ detail. Why is this change required? What problem does it solve?-->
If preparing for a new release, in addition please check the following:
- [ ] Update the version in cmake.
- [ ] Move the changes in the CHANGELOG.md file under a new header for the new release, and reset the categories.
- [ ] Ensure that any `when='@main'` dependencies are updated to the release version in the package.py
34 changes: 23 additions & 11 deletions spack-repo/packages/singularity-eos/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@


@directive("singularity_eos_plugins")
def singularity_eos_plugin(name, path):
def singularity_eos_plugin(name, spackage, relpath):
def _execute_register(pkg):
pkg.plugins[name] = path
pkg.plugins[name] = (spackage, relpath)

return _execute_register

Expand Down Expand Up @@ -82,22 +82,22 @@ class SingularityEos(CMakePackage, CudaPackage):

plugins = {}

singularity_eos_plugin("dust", "example/plugin")
singularity_eos_plugin("dust", "self", "example/plugin")

variant(
"plugins",
multi=True,
default="none",
validator=plugin_validator,
description="list of plugins to build",
when="@main"
when="@1.9.0:"
)
variant("variant", default="default", description="include path used for variant header", when="@main")
variant("variant", default="default", description="include path used for variant header", when="@1.9.0:")

# building/testing/docs
depends_on("[email protected]:")
depends_on("[email protected]:", when="@main +tests")
depends_on("[email protected]", when="@:1.8.0 +tests")
depends_on("[email protected]:", when="@1.9.0: +tests")
depends_on("python@3:", when="+python")
depends_on("py-numpy", when="+python+tests")
depends_on("[email protected]:", when="+python")
Expand All @@ -112,7 +112,7 @@ class SingularityEos(CMakePackage, CudaPackage):

depends_on("[email protected],1.5.2:", when="@:1.7.0")
depends_on("[email protected]:", when="@1.7.1:")
depends_on("[email protected]:", when="@1.8.1:")
depends_on("[email protected]:", when="@1.9.0:")
# request HEAD of main branch
depends_on("ports-of-call@main", when="@main")

Expand Down Expand Up @@ -216,13 +216,25 @@ def cmake_args(self):
self.define("SINGULARITY_USE_EOSPAC", "^eospac" in self.spec),
]

if self.spec.satisfies("@main"):
if self.spec.satisfies("@1.9.0:"):
if "none" not in self.spec.variants["plugins"].value:
pdirs = [join_path(self.stage.source_path, self.plugins[p]) for p in self.spec.variants["plugins"].value]
pdirs = []
for p in self.spec.variants["plugins"].value:
spackage, path = self.plugins[p]
if spackage == "self":
pdirs.append(join_path(self.stage.source_path, path))
else:
pdirs.append(join_path(self.spec[spackage].prefix, path))
args.append(self.define("SINGULARITY_PLUGINS", ";".join(pdirs)))

if self.spec.variants["variant"].value != "default":
args.append(self.define_from_variant("SINGULARITY_VARIANT", "variant"))
variant_path = self.spec.variants["variant"].value
if variant_path != "default":
parts = os.path.normpath('variant_path').split(os.sep)
if parts[0] in self.plugins.keys():
spackage, path = self.plugins[parts[0]]
parts[0] = self.spec[spackage].prefix
variant_path = join_path(*parts)
args.append(self.define("SINGULARITY_VARIANT", variant_path))

#TODO: do we need this?
if "+kokkos+cuda" in self.spec:
Expand Down

0 comments on commit a058975

Please sign in to comment.