From 4c8369ab1b4d0c116a7a29adaf456bf81d3e7f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 27 Jun 2019 12:00:46 +0200 Subject: [PATCH] tool/depot/publish: support multiple threads in xz Introduce 'XZ_THREADS' to override the default number of threads used for compression, which is still set to '1'. As using multiple threads will increase the amount of memory needed during the compression and potentially influences the size of the created archive, setting the variable limits the impact. Fixes #3431. --- tool/depot/publish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tool/depot/publish b/tool/depot/publish index c8479f390..90e6fa26c 100755 --- a/tool/depot/publish +++ b/tool/depot/publish @@ -30,6 +30,8 @@ export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..) PUBLIC_DIR ?= $(GENODE_DIR)/public +XZ_THREADS ?= 1 + include $(GENODE_DIR)/tool/depot/mk/front_end.inc @@ -101,13 +103,14 @@ $(PUBLIC_DIR)/%.xz.sig : $(PUBLIC_DIR)/%.xz $(PUBLIC_DIR)/%.tar.xz: $(DEPOT_DIR)/% @$(ECHO) "$(DARK_COL)publish$(DEFAULT_COL) $@" $(VERBOSE)test -e $(dir $@) || mkdir -p $(dir $@) - $(VERBOSE)tar cJf $@ -C $(dir $<) $(notdir $<) + $(VERBOSE)tar cf - -C $(dir $<) $(notdir $<) | \ + xz --threads=$(XZ_THREADS) > $@ # index file $(PUBLIC_DIR)/%.xz: $(DEPOT_DIR)/% @$(ECHO) "$(DARK_COL)publish$(DEFAULT_COL) $@" $(VERBOSE)test -e $(dir $@) || mkdir -p $(dir $@) - $(VERBOSE)xz <$< >$@ + $(VERBOSE)xz --threads=$(XZ_THREADS) <$< >$@ ifneq ($(MISSING_PUBKEY_FILES),) $(MAKECMDGOALS) $(TARGETS): missing_pubkey_files