build: Build gnu/packages/*.go in two passes.

This works around <https://issues.guix.gnu.org/59717>, whereby heap
usage would go beyond what's reasonable, preventing compilation of the
'guix' package on armhf-linux.

This is a followup to ef82ba9dd9.

* Makefile.am (MODULES_PACKAGES1, MODULES_PACKAGES): New variables.
(MODULES_PACKAGES): Define in terms of them and use :=.
(MODULES_CORE, MODULES_SYSTEM, MODULES_CLI, MODULES_PO): Define with :=.
This commit is contained in:
Ludovic Courtès 2022-11-30 17:18:42 +01:00
parent 1bc9d5222f
commit 1aa7ee52c6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -751,20 +751,35 @@ endef
# in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
# 'make-*-go' phony target that builds the corresponding subset.
MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
MODULES_PO = guix/build/po.scm
first_half := \
gnu/packages/a% gnu/packages/b% gnu/packages/c% gnu/packages/d% \
gnu/packages/e% gnu/packages/f% gnu/packages/g% gnu/packages/h% \
gnu/packages/i% gnu/packages/j% gnu/packages/k% gnu/packages/l%
MODULES_CORE := guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
MODULES_PACKAGES1 := $(filter $(first_half),$(MODULES))
MODULES_PACKAGES2 := $(filter-out $(first_half),$(filter gnu/packages/%,$(MODULES)))
MODULES_PACKAGES := $(MODULES_PACKAGES1) $(MODULES_PACKAGES2)
MODULES_SYSTEM := gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
MODULES_CLI := $(filter guix/scripts/%,$(MODULES))
MODULES_PO := guix/build/po.scm
$(eval $(call guile-compilation-rule,make-core-go, \
$(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
0))
.PHONY: make-core-go
$(eval $(call guile-compilation-rule,make-packages-go, \
$(MODULES_PACKAGES) make-core-go, \
$(eval $(call guile-compilation-rule,make-packages1-go, \
$(MODULES_PACKAGES1) make-core-go, \
$(words $(MODULES_CORE))))
.PHONY: make-packages1-go
$(eval $(call guile-compilation-rule,make-packages2-go, \
$(MODULES_PACKAGES2) make-core-go make-packages1-go, \
$(words $(MODULES_CORE) $(MODULES_PACKAGES1))))
.PHONY: make-packages2-go
make-packages-go: make-packages1-go make-packages2-go
.PHONY: make-packages-go
$(eval $(call guile-compilation-rule,make-system-go, \