Merge bitcoin/bitcoin#34239: depends: Hash included makefiles in package checksums

ec61a1af62 depends: Hash included makefiles in package checksums (Hennadii Stepanov)

Pull request description:

  This PR fixes an issue where modifications in included files (e.g. `packages/qt_details.mk`) do not trigger a rebuild of the parent packages (`native_qt` and `qt`).

  This addresses an oversight in 248613eb3e from https://github.com/bitcoin/bitcoin/pull/30997.

  ### Reproduction

  On master (@ 595504a432), modifying the included makefile does not change the build ID:
  ```
  $ cd depends
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=b2ce790473c
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=70e1e5164c5
  $ echo "" >> packages/qt_details.mk
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=b2ce790473c
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=70e1e5164c5
  ```

  ### With this patch

  The checksum calculation now parses `include` directives and adds those files to the hash. The IDs now update correctly:
  ```
  $ cd depends
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=9a6ebf79cb3
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=6ad78a3f644
  $ echo "" >> packages/qt_details.mk
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=ca820665c52
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=082e4cb2364
  ```

ACKs for top commit:
  sedited:
    ACK ec61a1af62

Tree-SHA512: 9425d606dcf003ef9342560a1d0def3d591279ed261a6af0cfb2bf7b2fb1864bf7937877a1119e4c694e6c74a46074eb5e84e6198a90f4d1cd49010088077f92
This commit is contained in:
merge-script
2026-08-19 14:20:24 +01:00

View File

@@ -60,7 +60,7 @@ endef
define int_get_build_recipe_hash
$(eval $(1)_patches_path?=$(PATCHES_PATH)/$(1))
$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $($(1)_patches_path)/,$($(1)_patches)) | cut -d" " -f1))
$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $$(grep "^include " packages/$(1).mk | cut -d' ' -f2 | xargs) $(addprefix $($(1)_patches_path)/,$($(1)_patches)) | cut -d" " -f1))
# If $(1)_local_dir is set, create a tarball of the local directory contents to
# use as the source of the package, and include a hash of the tarball in the
# package id, so if directory contents change, the package and packages