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 <vsoch@users.noreply.github.com>
This commit is contained in:
Vanessasaurus 2022-08-06 13:05:29 -06:00 committed by GitHub
parent 75d1cb469f
commit 86be4666fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View file

@ -5,6 +5,7 @@
import os import os
import spack.util.executable
from spack.package import * from spack.package import *
@ -130,6 +131,7 @@ class FluxCore(AutotoolsPackage):
depends_on("jansson@2.10:", when="@0.21.0:") depends_on("jansson@2.10:", when="@0.21.0:")
depends_on("pkgconfig") depends_on("pkgconfig")
depends_on("lz4") depends_on("lz4")
depends_on("sqlite")
depends_on("asciidoc", type="build", when="+docs") depends_on("asciidoc", type="build", when="+docs")
depends_on("py-docutils", type="build", when="@0.32.0:") depends_on("py-docutils", type="build", when="@0.32.0:")
@ -173,9 +175,13 @@ def setup(self):
with working_dir(self.stage.source_path): with working_dir(self.stage.source_path):
# Allow git-describe to get last tag so flux-version works: # Allow git-describe to get last tag so flux-version works:
git = which("git") git = which("git")
git("fetch", "--unshallow") # When using spack develop, this will already be unshallow
git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") try:
git("fetch", "origin") 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): def autoreconf(self, spec, prefix):
self.setup() self.setup()

View file

@ -5,6 +5,7 @@
import os import os
import spack.util.executable
from spack.package import * from spack.package import *
@ -107,9 +108,13 @@ def setup(self):
with working_dir(self.stage.source_path): with working_dir(self.stage.source_path):
# Allow git-describe to get last tag so flux-version works: # Allow git-describe to get last tag so flux-version works:
git = which("git") git = which("git")
git("fetch", "--unshallow") # When using spack develop, this will already be unshallow
git("config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*") try:
git("fetch", "origin") 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): def autoreconf(self, spec, prefix):
self.setup() self.setup()