diff options
| author | Janneke Nieuwenhuizen <janneke@gnu.org> | 2023-09-08 10:46:30 +0200 |
|---|---|---|
| committer | Janneke Nieuwenhuizen <janneke@gnu.org> | 2024-04-14 10:29:11 +0200 |
| commit | 416f11f1d4b2e12d8db2687e753d760f148cfc2d (patch) | |
| tree | 0c875d2d5caa0de696df1a650c34b66af93da254 | |
| parent | 3d8d0642da5e5982e17122ab35774f9d5dfca79b (diff) | |
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
| -rw-r--r-- | Makefile.am | 28 | ||||
| -rw-r--r-- | doc/local.mk | 35 |
2 files changed, 60 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index 7af88b29886..5f0809ee007 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -954,9 +954,31 @@ guix-binary.%.tar.xz: | |||
| 954 | cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" | 954 | cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" |
| 955 | 955 | ||
| 956 | 956 | ||
| 957 | # The dependency on doc-pot-update is to generate the .pot files, which are | 957 | # Assert that Autotools cache is up to date with Git, by checking |
| 958 | # not checked in. | 958 | # PACKAGE_VERSION against HEAD. Indented to get past Automake. |
| 959 | dist: doc-pot-update | 959 | ifeq ($(MAKECMDGOALS),dist) |
| 960 | git_version = $(shell build-aux/git-version-gen .tarball-version) | ||
| 961 | ifneq ($(PACKAGE_VERSION),$(git_version)) | ||
| 962 | $(warning Autotools cache out of date.) | ||
| 963 | $(info Autotools cache version: $(PACKAGE_VERSION).) | ||
| 964 | $(info Git version: $(git_version).) | ||
| 965 | $(info Please run ./bootstrap && ./configure $(DIST_CONFIGURE_FLAGS)) | ||
| 966 | ifneq ($(GUIX_ALLOW_IRREPRODUCIBLE_TARBALL),yes) | ||
| 967 | $(error Cannot create reproducible tarball) | ||
| 968 | else | ||
| 969 | $(warning Tarball will be irreproducible; distdir will not get removed!) | ||
| 970 | endif | ||
| 971 | endif | ||
| 972 | endif | ||
| 973 | |||
| 974 | # The dependency on dist-doc-pot-update is to clean possibly stale doc and po | ||
| 975 | # files and only then generate the .pot files, which are not checked in. | ||
| 976 | dist: dist-doc-pot-update | ||
| 977 | dist-doc-pot-update: auto-clean | ||
| 978 | $(MAKE) guile$(EXEEXT) | ||
| 979 | $(MAKE) -C po/guix all | ||
| 980 | $(MAKE) -C po/packages all | ||
| 981 | $(MAKE) doc-pot-update | ||
| 960 | 982 | ||
| 961 | dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version | 983 | dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version |
| 962 | dist-hook: assert-no-store-file-names | 984 | dist-hook: assert-no-store-file-names |
diff --git a/doc/local.mk b/doc/local.mk index d18cdf3e5fa..130f40ece99 100644 --- a/doc/local.mk +++ b/doc/local.mk | |||
| @@ -291,3 +291,38 @@ $(eval $(call version.texi-from-git,vti,doc/guix.texi,)) | |||
| 291 | $(foreach lang, $(MANUAL_LANGUAGES), \ | 291 | $(foreach lang, $(MANUAL_LANGUAGES), \ |
| 292 | $(eval i=$(shell echo $$(($(i)+1)))) \ | 292 | $(eval i=$(shell echo $$(($(i)+1)))) \ |
| 293 | $(eval $(call version.texi-from-git,$(i),po/doc/guix-manual.$(lang).po,-$(lang)))) | 293 | $(eval $(call version.texi-from-git,$(i),po/doc/guix-manual.$(lang).po,-$(lang)))) |
| 294 | |||
| 295 | DIST_CONFIGURE_FLAGS = \ | ||
| 296 | --localstatedir=/var \ | ||
| 297 | --sysconfdir=/etc | ||
| 298 | |||
| 299 | # Delete all Autotools-generated files and rerun configure to ensure | ||
| 300 | # a clean cache and distributing reproducible versions. | ||
| 301 | auto-clean: maintainer-clean-vti doc-clean | ||
| 302 | rm -f ABOUT-NLS INSTALL | ||
| 303 | rm -f aclocal.m4 configure libtool Makefile.in | ||
| 304 | if test -e .git; then \ | ||
| 305 | git clean -fdx -- '.am*' build-aux m4 po; \ | ||
| 306 | else \ | ||
| 307 | rm -rf .am*; \ | ||
| 308 | $(MAKE) -C po/guix maintainer-clean; \ | ||
| 309 | $(MAKE) -C po/packages maintainer-clean; \ | ||
| 310 | fi | ||
| 311 | rm -f guile | ||
| 312 | rm -f guix-daemon nix/nix-daemon/guix_daemon-guix-daemon.o | ||
| 313 | # Automake fails if guix-cookbook-LANG.texi stubs are missing; running | ||
| 314 | # autoreconf -vif is not enough. | ||
| 315 | ./bootstrap | ||
| 316 | # The dependency chain for the guix-cookbook-LANG.texi was cut on purpose; | ||
| 317 | # they must be deleted to ensure a rebuild. | ||
| 318 | rm -f $(filter-out %D%/guix.texi %D%/guix-cookbook.texi, $(info_TEXINFOS)) | ||
| 319 | ./configure $(DIST_CONFIGURE_FLAGS) | ||
| 320 | |||
| 321 | # Delete all generated doc files to ensure a clean cache and distributing | ||
| 322 | # reproducible versions. | ||
| 323 | doc-clean: | ||
| 324 | rm -f $(srcdir)/doc/*.1 | ||
| 325 | rm -f $(srcdir)/doc/stamp* | ||
| 326 | rm -f $(DOT_FILES:%.dot=%.png) | ||
| 327 | rm -f $(DOT_VECTOR_GRAPHICS) | ||
| 328 | rm -f doc/images/coreutils-size-map.eps | ||
