From patchwork Sat Apr 6 21:18:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 62797 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 885FA27BBEA; Sat, 6 Apr 2024 22:19:54 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BD80F27BBE2 for ; Sat, 6 Apr 2024 22:19:53 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtDRN-0000Se-Cv; Sat, 06 Apr 2024 17:19:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtDRI-0000Ph-Tl for guix-patches@gnu.org; Sat, 06 Apr 2024 17:19:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtDRH-0004Ux-UK for guix-patches@gnu.org; Sat, 06 Apr 2024 17:19:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtDRO-0000b8-A9 for guix-patches@gnu.org; Sat, 06 Apr 2024 17:19:10 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70169] [PATCH v2 12/12] maint: Ensure generated file reproducibility for dist. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 Apr 2024 21:19:10 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70169 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70169@debbugs.gnu.org Received: via spool by 70169-submit@debbugs.gnu.org id=B70169.17124383252038 (code B ref 70169); Sat, 06 Apr 2024 21:19:10 +0000 Received: (at 70169) by debbugs.gnu.org; 6 Apr 2024 21:18:45 +0000 Received: from localhost ([127.0.0.1]:41145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtDQy-0000Wi-AW for submit@debbugs.gnu.org; Sat, 06 Apr 2024 17:18:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtDQp-0000Ta-B2 for 70169@debbugs.gnu.org; Sat, 06 Apr 2024 17:18:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtDQd-0004Mw-LV; Sat, 06 Apr 2024 17:18:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=0LayddsJYEg/1OFPCcqnJJ0ln/UqLcIBQbDqggSMilU=; b=ii5m947EyLKwC5ZdzNpc RuTuZOMj61KotiWisA2hzq4F+M8fO6k7vqhnrpBD5elS/7LQ/9qNCvEW5wNAdwe909bkAvYUQm6EG t7De7w/qs0yzE3qV/wdiqjm8msVR2y2S4bTuBKaSlxLHNONhH5I+j1DExud9PVt+Ci6RTDM7t1uaa QhZ6oG7U7RGK8WeGsHJm71Xntd0AyI84AKEv4tkmvZD9sVEDk4Aj0ETeLjhZ/Txzwh5pSA+Y8j//b splNhluaoyHi4x9lANnX6P8Gh38OOzOxtJddllazD8nL/4PF+5jr0H1KN7xRs27Sc+R0yNpJdmUue 5XNKbrQLH1XLgw==; From: Janneke Nieuwenhuizen Date: Sat, 6 Apr 2024 23:18:04 +0200 Message-ID: <933766d5b3574d509b917b80743b127370a61676.1712437365.git.janneke@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 | 29 ++++++++++++++++++++++++++--- doc/local.mk | 29 +++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7af88b2988..aac328b75e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -954,9 +954,32 @@ 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 `autoreconf -vif'.) #` + 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 + $(MAKE) guix-daemon 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 25741a5c88..8ba1ce4668 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -294,3 +294,32 @@ $(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 + git clean -fdx -- '.am*' build-aux m4 po + 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