From 6f0829cfb9d6402696b1919e7537b7d65d1e6009 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 18 Mar 2023 12:25:48 +0100 Subject: [PATCH] guix: add debug output --- contrib/depends/Makefile | 4 +++- contrib/depends/funcs.mk | 2 ++ contrib/depends/gen_id | 2 +- contrib/guix/libexec/build.sh | 6 ++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile index 26e4397..7649953 100644 --- a/contrib/depends/Makefile +++ b/contrib/depends/Makefile @@ -150,7 +150,9 @@ include packages/packages.mk # build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') $(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') - +ifneq ($(OUTDIR),) + $(file >> $(OUTDIR)/build-hashes.txt,$(host_arch)_$(host_os)_id=$($(host_arch)_$(host_os)_id)) +endif qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_) tor_packages_$(NO_TOR) = $(tor_packages) $(tor_$(host_os)_packages) diff --git a/contrib/depends/funcs.mk b/contrib/depends/funcs.mk index 15bbf1a..e39280f 100644 --- a/contrib/depends/funcs.mk +++ b/contrib/depends/funcs.mk @@ -43,6 +43,7 @@ endef define int_get_build_recipe_hash $(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) +$(if $(OUTDIR), $(file >> $(OUTDIR)/build-hashes.txt,$(1)_all_file_checksums=$($(1)_all_file_checksums))) $(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) endef @@ -51,6 +52,7 @@ $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_ $(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies))) $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id)) +$(if $(OUTDIR), $(file >> $(OUTDIR)/build-hashes.txt,$(1)_build_id_long=$($(1)_build_id_long))) $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) final_build_id_long+=$($(package)_build_id_long) diff --git a/contrib/depends/gen_id b/contrib/depends/gen_id index 6ecbcd9..95743eb 100755 --- a/contrib/depends/gen_id +++ b/contrib/depends/gen_id @@ -67,7 +67,7 @@ echo "END STRIP" echo "END ALL" -) | if [ -n "$DEBUG" ] && command -v tee > /dev/null 2>&1; then +) | if [ -n "$DEBUG_GENID" ] && command -v tee > /dev/null 2>&1; then # When debugging and `tee` is available, output the preimage to stderr # in addition to passing through stdin to stdout tee >(cat 1>&2) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index faa6d34..4ad1bb8 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -6,6 +6,7 @@ export LC_ALL=C set -e -o pipefail export TZ=UTC +export DEBUG_GENID=1 # shellcheck source=contrib/shell/git-utils.bash source contrib/shell/git-utils.bash @@ -197,12 +198,15 @@ case "$HOST" in *mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;; esac +mkdir -p "$OUTDIR" + # Build the depends tree, overriding variables that assume multilib gcc make -C contrib/depends --jobs="$JOBS" HOST="$HOST" \ ${V:+V=1} \ ${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \ ${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \ ${SDK_PATH+SDK_PATH="$SDK_PATH"} \ + OUTDIR="$OUTDIR" \ x86_64_linux_CC=x86_64-linux-gnu-gcc \ x86_64_linux_CXX=x86_64-linux-gnu-g++ \ x86_64_linux_AR=x86_64-linux-gnu-ar \ @@ -228,8 +232,6 @@ if [ ! -e "$GIT_ARCHIVE" ]; then sha256sum "$GIT_ARCHIVE" fi -mkdir -p "$OUTDIR" - ########################### # Binary Tarball Building # ###########################