key4hep / key4hep-spack

A Spack recipe repository of Key4hep software.
10 stars 23 forks source link

Regression in k4fwcore due to gaudi +gaudialg when ^gaudi #591

Closed wdconinc closed 4 months ago

wdconinc commented 4 months ago

When using the current main branch of key4hep-spack, and using the current develop branch of spack:

$ docker run --rm -it spack/ubuntu-jammy:develop
git clone https://github.com/key4hep/key4hep-spack 
spack repo add key4hep-spack
spack spec k4fwcore

This returns:

==> Error: cannot load package 'k4fwcore' from the 'k4' repository: gaudi@37: cannot have multiple versions

I think the recursive depends_on clauses are not allowed anymore. I think this has to be expressed as a conflict.

wdconinc commented 4 months ago

Actually, it's simpler.

diff --git a/packages/k4fwcore/package.py b/packages/k4fwcore/package.py
index 80ff5da..3fb2571 100644
--- a/packages/k4fwcore/package.py
+++ b/packages/k4fwcore/package.py
@@ -23,7 +23,7 @@ class K4fwcore(CMakePackage, Ilcsoftpackage):
     )

     depends_on("gaudi")
-    depends_on("gaudi +gaudialg", when="^gaudi@37: @:1.0pre19")
+    depends_on("gaudi +gaudialg", when="@:1.0pre19 ^gaudi@37:")
     depends_on("root")
     depends_on("podio")
     depends_on("podio@0.14.1", when="@1.0pre14:1.0pre15")