summaryrefslogtreecommitdiff
path: root/share/spack/templates
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2023-01-18 19:19:46 +0100
committerGitHub <noreply@github.com>2023-01-18 19:19:46 +0100
commitf050b1cf7835fd31992b020e1061c52294ff7330 (patch)
tree150ca0a67be1b63d415146436e55b164f899f03d /share/spack/templates
parent6cf32110b912056201d5a901ee2e99979dc601bf (diff)
downloadspack-f050b1cf7835fd31992b020e1061c52294ff7330.tar.gz
spack-f050b1cf7835fd31992b020e1061c52294ff7330.tar.bz2
spack-f050b1cf7835fd31992b020e1061c52294ff7330.tar.xz
spack-f050b1cf7835fd31992b020e1061c52294ff7330.zip
depfile: variable with all identifiers (#34678)
With the new variable [prefix/]SPACK_PACKAGE_IDS you can conveniently execute things after each successful install. For example push just-built packages to a buildcache ``` SPACK ?= spack export SPACK_COLOR = always MAKEFLAGS += -Orecurse MY_BUILDCACHE := $(CURDIR)/cache .PHONY: all clean all: push ifeq (,$(filter clean,$(MAKECMDGOALS))) include env.mk endif # the relevant part: push has *all* example/push/<pkg identifier> as prereqs push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS)) $(SPACK) -e . buildcache update-index --directory $(MY_BUILDCACHE) $(info Pushed everything, yay!) # and each example/push/<pkg identifier> has the install target as prereq, # and the body can use target local $(HASH) and $(SPEC) variables to do # things, such as pushing to a build cache example/push/%: example/install/% @mkdir -p $(dir $@) $(SPACK) -e . buildcache create --allow-root --only=package --unsigned --directory $(MY_BUILDCACHE) /$(HASH) # push $(SPEC) @touch $@ spack.lock: spack.yaml $(SPACK) -e . concretize -f env.mk: spack.lock $(SPACK) -e . env depfile -o $@ --make-target-prefix example clean: rm -rf spack.lock env.mk example/ ``
Diffstat (limited to 'share/spack/templates')
-rw-r--r--share/spack/templates/depfile/Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/share/spack/templates/depfile/Makefile b/share/spack/templates/depfile/Makefile
index 4ff7fff0a3..3e844176bc 100644
--- a/share/spack/templates/depfile/Makefile
+++ b/share/spack/templates/depfile/Makefile
@@ -1,6 +1,9 @@
SPACK ?= spack
SPACK_INSTALL_FLAGS ?=
+# This variable can be used to add post install hooks
+{{ pkg_ids_variable }} := {{ pkg_ids }}
+
.PHONY: {{ all_target }} {{ clean_target }}
{{ all_target }}: {{ env_target }}