spack/share/spack/templates
Harmen Stoppels f050b1cf78
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/
``
2023-01-18 19:19:46 +01:00
..
bootstrap Bootstrap most of Spack dependencies using environments (#34029) 2022-12-06 11:54:02 +01:00
container Update Spack Dockerfiles (#33500) 2022-10-25 11:46:47 +00:00
depfile depfile: variable with all identifiers (#34678) 2023-01-18 19:19:46 +01:00
misc spack graph: rework to use Jinja templates and builders (#34637) 2022-12-27 15:25:53 +01:00
mock-repository Refactor a few classes related to package repositories (#32273) 2022-10-11 19:28:27 +02:00
modules tcl module template: automatically unload automatically loaded modules (#32853) 2022-10-06 20:15:28 +02:00
reports spack ci: add support for running stand-alone tests (#27877) 2022-08-23 00:52:48 -07:00