From b79761b7eb5eb2e2d6b8174c3043524462772bf6 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Thu, 9 May 2024 11:50:42 -0700 Subject: flux-sched: set the version if the ver file is missing (#44068) * flux-sched: set the version if the ver file is missing problem: flux-sched needs a version, it normally gets this from a release tarball or from git tags, but if using a source archive or a git clone without tags the version is missing solution: set the version through cmake based on the version spack sees when the version file is missing * Update var/spack/repos/builtin/packages/flux-sched/package.py Co-authored-by: Alec Scott --------- Co-authored-by: Alec Scott --- var/spack/repos/builtin/packages/flux-sched/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/flux-sched/package.py b/var/spack/repos/builtin/packages/flux-sched/package.py index eb449cad1a..679e26ac7c 100644 --- a/var/spack/repos/builtin/packages/flux-sched/package.py +++ b/var/spack/repos/builtin/packages/flux-sched/package.py @@ -186,6 +186,10 @@ class FluxSched(CMakePackage, AutotoolsPackage): class CMakeBuilder(CMakeBuilder): def cmake_args(self): + ver_in_src = os.path.exists(os.path.join(self.stage.source_path, "flux-sched.ver")) + # flux-sched before v0.33 does not correctly set the version even when the file is present. + if self.spec.satisfies("@:0.33") or not ver_in_src: + return [self.define("FLUX_SCHED_VER", self.spec.version)] return [] -- cgit v1.2.3-70-g09d2