From patchwork Mon Apr 8 18:46:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 62863 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 D193727BBEA; Mon, 8 Apr 2024 19:48:29 +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 17DE827BBE2 for ; Mon, 8 Apr 2024 19:48:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtu2E-00046q-2X; Mon, 08 Apr 2024 14:48:02 -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 1rtu2C-00043y-EL for guix-patches@gnu.org; Mon, 08 Apr 2024 14:48:00 -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 1rtu2C-00057C-5p for guix-patches@gnu.org; Mon, 08 Apr 2024 14:48:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtu2J-0005YK-N9 for guix-patches@gnu.org; Mon, 08 Apr 2024 14:48:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70169] [PATCH v3 13/13] maint: Ensure generated file reproducibility for dist. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Apr 2024 18:48:07 +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.171260207121118 (code B ref 70169); Mon, 08 Apr 2024 18:48:07 +0000 Received: (at 70169) by debbugs.gnu.org; 8 Apr 2024 18:47:51 +0000 Received: from localhost ([127.0.0.1]:47678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtu22-0005UQ-J0 for submit@debbugs.gnu.org; Mon, 08 Apr 2024 14:47:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtu1z-0005Sr-96 for 70169@debbugs.gnu.org; Mon, 08 Apr 2024 14:47:47 -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 1rtu1m-00054k-De; Mon, 08 Apr 2024 14:47:34 -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=uTv80dTKFheU8HPXeV49hSlByFv/4lLiU0/fzsESt7I=; b=cDKz6iDO2D7VDAnCay/G zgDfYOEzTXHs4RCd4A1Q14GuPQRnGANdcsH5aIpxo+XGBgtxrRo+SpI6HQ61znGx5+FNTKYWWTsd6 TX8kAWd0GRFSz1QejLO26YsLexdP333HR3OHxJ4RZRNK2Lii/PASSdddRlqGpXsXU+kqV3RjH2FpA PNOECjbcMS3GScF7xSVePOQgDfyS2ISNjGa42nHxhnOjv+pyEajeVus1lVR9vUY1ZK3eWBgccvlXa /nfbxmZdjcwL9vxkxlZlWtQTWY6AJN4RQRYl8OPjS5F0DIcuq1ErbvSvAtQIeqVJ/5S3MLrNzPxGX HtLsJ0oNC1tQBQ==; From: Janneke Nieuwenhuizen Date: Mon, 8 Apr 2024 18:46:56 +0000 Message-ID: <0e305324621bdf2c04a6770d37f15efa85dcdb07.1712600307.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 | 28 +++++++++++++++++++++++++--- doc/local.mk | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 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 72f80bb511..f6d6640546 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -291,3 +291,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