From 86be4666fcd5c036e90a335be68b0641a4b5cf3a Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Sat, 6 Aug 2022 13:05:29 -0600 Subject: flux packages used in a spack view will already be unshallow (#31955) * flux packages used in a spack view will already be unshallow and this particular command will error and break the entire build. Instead we want to catch the ProcessError and allow for a regular fetch. * final tweaks to add missing sqlite and fallback to fetch Signed-off-by: vsoch --- var/spack/repos/builtin/packages/flux-core/package.py | 12 +++++++++--- var/spack/repos/builtin/packages/flux-sched/package.py | 11 ++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/flux-core/package.py b/var/spack/repos/builtin/packages/flux-core/package.py index 6f8266770f..19551e99a2 100644 --- a/var/spack/repos/builtin/packages/flux-core/package.py +++ b/var/spack/repos/builtin/packages/flux-core/package.py @@ -5,6 +5,7 @@ import os +import spack.util.executable from spack.package import * @@ -130,6 +131,7 @@ class FluxCore(AutotoolsPackage): depends_on("jansson@2.10:", when="@0.21.0:") depends_on("pkgconfig") depends_on("lz4") + depends_on("sqlite") depends_on("asciidoc", type="build", when="+docs") depends_on("py-docutils", type="build", when="@0.32.0:") @@ -173,9 +175,13 @@ class FluxCore(AutotoolsPackage): with working_dir(self.stage.source_path): # Allow git-describe to get last tag so flux-version works: git = which("git") - git("fetch", "--unshallow") - git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") - git("fetch", "origin") + # When using spack develop, this will already be unshallow + try: + git("fetch", "--unshallow") + git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") + git("fetch", "origin") + except spack.util.executable.ProcessError: + git("fetch") def autoreconf(self, spec, prefix): self.setup() diff --git a/var/spack/repos/builtin/packages/flux-sched/package.py b/var/spack/repos/builtin/packages/flux-sched/package.py index 9d4a4caa19..337abf5faf 100644 --- a/var/spack/repos/builtin/packages/flux-sched/package.py +++ b/var/spack/repos/builtin/packages/flux-sched/package.py @@ -5,6 +5,7 @@ import os +import spack.util.executable from spack.package import * @@ -107,9 +108,13 @@ class FluxSched(AutotoolsPackage): with working_dir(self.stage.source_path): # Allow git-describe to get last tag so flux-version works: git = which("git") - git("fetch", "--unshallow") - git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") - git("fetch", "origin") + # When using spack develop, this will already be unshallow + try: + git("fetch", "--unshallow") + git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") + git("fetch", "origin") + except spack.util.executable.ProcessError: + git("fetch") def autoreconf(self, spec, prefix): self.setup() -- cgit v1.2.3-60-g2f50