[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
13/13: maint: Ensure generated file reproducibility for dist.
From: |
guix-commits |
Subject: |
13/13: maint: Ensure generated file reproducibility for dist. |
Date: |
Sat, 13 Apr 2024 05:44:51 -0400 (EDT) |
janneke pushed a commit to branch wip-tarball
in repository guix.
commit 02ee3ff7e3c67ed49a4952866834a28b783fd50b
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Fri Sep 8 10:46:30 2023 +0200
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 +++++++++++++++++++++++++---
doc/local.mk | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 3 deletions(-)
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
diff --git a/doc/local.mk b/doc/local.mk
index ad6855d91c..e18270cebf 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -291,3 +291,38 @@ $(eval $(call version.texi-from-git,vti,doc/guix.texi,))
$(foreach lang, $(MANUAL_LANGUAGES),
\
$(eval i=$(shell echo $$(($(i)+1))))
\
$(eval $(call
version.texi-from-git,$(i),po/doc/guix-manual.$(lang).po,-$(lang))))
+
+DIST_CONFIGURE_FLAGS = \
+ --localstatedir=/var \
+ --sysconfdir=/etc
+
+# Delete all Autotools-generated files and rerun configure to ensure
+# a clean cache and distributing reproducible versions.
+auto-clean: maintainer-clean-vti doc-clean
+ rm -f ABOUT-NLS INSTALL
+ rm -f aclocal.m4 configure libtool Makefile.in
+ if test -e .git; then \
+ git clean -fdx -- '.am*' build-aux m4 po; \
+ else \
+ rm -rf .am*; \
+ $(MAKE) -C po/guix maintainer-clean; \
+ $(MAKE) -C po/packages maintainer-clean; \
+ fi
+ rm -f guile
+ rm -f guix-daemon nix/nix-daemon/guix_daemon-guix-daemon.o
+# Automake fails if guix-cookbook-LANG.texi stubs are missing; running
+# autoreconf -vif is not enough.
+ ./bootstrap
+# The dependency chain for the guix-cookbook-LANG.texi was cut on purpose;
+# they must be deleted to ensure a rebuild.
+ rm -f $(filter-out %D%/guix.texi %D%/guix-cookbook.texi,
$(info_TEXINFOS))
+ ./configure $(DIST_CONFIGURE_FLAGS)
+
+# Delete all generated doc files to ensure a clean cache and distributing
+# reproducible versions.
+doc-clean:
+ rm -f $(srcdir)/doc/*.1
+ rm -f $(srcdir)/doc/stamp*
+ rm -f $(DOT_FILES:%.dot=%.png)
+ rm -f $(DOT_VECTOR_GRAPHICS)
+ rm -f doc/images/coreutils-size-map.eps
- branch wip-tarball created (now 02ee3ff7e3), guix-commits, 2024/04/13
- 02/13: maint: Cater for running `make dist' from a worktree., guix-commits, 2024/04/13
- 04/13: maint: Generate 'doc/version.texi' reproducibly., guix-commits, 2024/04/13
- 08/13: maint: Use xgettext.scm wrapper to create .PO files reproducibly., guix-commits, 2024/04/13
- 10/13: maint: Avoid EPS generation to fail silently, ensure reproducibility., guix-commits, 2024/04/13
- 13/13: maint: Ensure generated file reproducibility for dist.,
guix-commits <=
- 01/13: doc: Use "dejavu sans" instead of "Helvetica" or "sans" in dot images., guix-commits, 2024/04/13
- 06/13: maint: Generate AUTHORS and ChangeLog reproducibly., guix-commits, 2024/04/13
- 03/13: maint: Use reproducible timestamps and name for tarball., guix-commits, 2024/04/13
- 07/13: maint: Generate 'doc/version-LANG.texi' reproducibly., guix-commits, 2024/04/13
- 09/13: maint: Use reproducible Git timestamp for POT-Creation-Date., guix-commits, 2024/04/13
- 12/13: maint: Reset CreationDate metadata on generated PDFs., guix-commits, 2024/04/13
- 11/13: maint: Avoid PNG and PDF generation to fail silently., guix-commits, 2024/04/13
- 05/13: maint: Help help2man generate reproducible man-pages., guix-commits, 2024/04/13