depot/build_bin_archive: keep hash of ingredients

This patch records the content hashes of the src and api ingredients
used for creating a bin archive. This information allows for the
detection of possible inconsistencies between a bin archive and its
corresponding src archive within the depot.

Issue #5379
This commit is contained in:
Norman Feske 2024-11-08 15:02:19 +01:00 committed by Christian Helmuth
parent 4a5f80ddbf
commit b510394a6d

View File

@ -125,6 +125,7 @@ endif
DEPOT_BIN_ARCHIVE_DIR := $(DEPOT_BIN_DIR)/$(SPEC)/$(VERSIONED_ARCHIVE)
DEPOT_DBG_ARCHIVE_DIR := $(DEPOT_DBG_DIR)/$(SPEC)/$(VERSIONED_ARCHIVE)
DEPOT_ARCHIVE_BUILD_DIR := $(addsuffix .build,$(DEPOT_BIN_ARCHIVE_DIR))
DEPOT_BIN_HASH_FILE := $(addsuffix .hash,$(DEPOT_BIN_ARCHIVE_DIR))
#
@ -230,7 +231,13 @@ $(DEPOT_DBG_ARCHIVE_DIR): $(DEPOT_ARCHIVE_BUILD_DIR)/debug
$(VERBOSE)find $< -name *.debug -exec cp {} $@/ \;
@$(ECHO) "$(DARK_COL)created$(DEFAULT_COL) $(USER)/dbg/$(SPEC)/$(VERSIONED_ARCHIVE)"
$(TARGET): $(DEPOT_BIN_ARCHIVE_DIR)
INGREDIENTS := $(addprefix src/,$(ARCHIVE)) $(addprefix api/,$(USED_APIS))
INGREDIENTS_HASHES := $(foreach I,$(INGREDIENTS),$(call file_content,$(DEPOT_DIR)/$(USER)/$I.hash))
$(DEPOT_BIN_HASH_FILE): $(DEPOT_BIN_ARCHIVE_DIR)
$(VERBOSE)echo "$(INGREDIENTS_HASHES)" > $@
$(TARGET): $(DEPOT_BIN_HASH_FILE)
ifneq ($(DBG),)
$(TARGET): $(DEPOT_DBG_ARCHIVE_DIR)