From 416f11f1d4b2e12d8db2687e753d760f148cfc2d Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Fri, 8 Sep 2023 10:46:30 +0200 Subject: maint: Ensure generated file reproducibility for dist. * doc/local.mk (doc-clean): New target. (DIST_CONFIGURE_FLAGS): New variable. (auto-clean): Use them in new target. * Makefile.am (dist-doc-pot-update): Use it in new target. (dist): Change to depend on it to clean possibly stale files, instead of doc-pot-update directly. Add a toplevel check to ensure that Autotools cache is up to date. Change-Id: I2ff2d88db9fe1e708ab65e33e1f3d7ecee882cb4 --- Makefile.am | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 7af88b2988..5f0809ee00 100644 --- a/Makefile.am +++ b/Makefile.am @@ -954,9 +954,31 @@ guix-binary.%.tar.xz: cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" -# The dependency on doc-pot-update is to generate the .pot files, which are -# not checked in. -dist: doc-pot-update +# Assert that Autotools cache is up to date with Git, by checking +# PACKAGE_VERSION against HEAD. Indented to get past Automake. + ifeq ($(MAKECMDGOALS),dist) + git_version = $(shell build-aux/git-version-gen .tarball-version) + ifneq ($(PACKAGE_VERSION),$(git_version)) + $(warning Autotools cache out of date.) + $(info Autotools cache version: $(PACKAGE_VERSION).) + $(info Git version: $(git_version).) + $(info Please run ./bootstrap && ./configure $(DIST_CONFIGURE_FLAGS)) + ifneq ($(GUIX_ALLOW_IRREPRODUCIBLE_TARBALL),yes) + $(error Cannot create reproducible tarball) + else + $(warning Tarball will be irreproducible; distdir will not get removed!) + endif + endif + endif + +# The dependency on dist-doc-pot-update is to clean possibly stale doc and po +# files and only then generate the .pot files, which are not checked in. +dist: dist-doc-pot-update +dist-doc-pot-update: auto-clean + $(MAKE) guile$(EXEEXT) + $(MAKE) -C po/guix all + $(MAKE) -C po/packages all + $(MAKE) doc-pot-update dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version dist-hook: assert-no-store-file-names -- cgit v1.2.3