From patchwork Wed Apr 17 19:08:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 63107 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 68FA827BBEA; Wed, 17 Apr 2024 20:10:19 +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=unavailable 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 63B3C27BBE9 for ; Wed, 17 Apr 2024 20:10:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxAfL-0002xT-N0; Wed, 17 Apr 2024 15:09:55 -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 1rxAfJ-0002vD-Vq for guix-patches@gnu.org; Wed, 17 Apr 2024 15:09:53 -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 1rxAfJ-0003KI-Na for guix-patches@gnu.org; Wed, 17 Apr 2024 15:09:53 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rxAfW-0000b3-Nt for guix-patches@gnu.org; Wed, 17 Apr 2024 15:10:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70380] [PATCH v4 3/6] maint: Cater for running `make dist' from tarball. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Apr 2024 19:10:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70380 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70380@debbugs.gnu.org Received: via spool by 70380-submit@debbugs.gnu.org id=B70380.17133809751999 (code B ref 70380); Wed, 17 Apr 2024 19:10:06 +0000 Received: (at 70380) by debbugs.gnu.org; 17 Apr 2024 19:09:35 +0000 Received: from localhost ([127.0.0.1]:47610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxAez-0000Vp-B8 for submit@debbugs.gnu.org; Wed, 17 Apr 2024 15:09:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxAej-0000Sy-IS for 70380@debbugs.gnu.org; Wed, 17 Apr 2024 15:09:18 -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 1rxAeR-0003Bt-7H; Wed, 17 Apr 2024 15:08:59 -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=IRmOpwldwYaD2mOQkSA6gVAFsPXZTKsfVQvCGkNR0SI=; b=VcLZlOVIhQjtBzZwgljg etuv0Dkb8tvDzv9wl+zvUKo4R0OZEqAvi+0yGQvMnerZ9KSI1YMpdC8v1pu+Pz8CyA3cIkKh24VZK eBhrzHQWyiIsvXTlou+eejN4V0fQ5Aa33COONMZO15mrVpK5YbEBepT0rspE4vrabOwlWSXos5+8d nHgw/dhjIN6+VxaxZOxBdhCDYJS9T43aiU09GhIQTn8QgHHMhGks2d0OaTpE1i4QvlDxb4abtIAHf JVEub1tbhDONqDOg1KxreZLVoAd/8sI83W3kH5enRfy+eivv0/bf2H0k/kuIS9gHTiJFuVS3swls2 ZDm/1bMlJu9e4A==; From: Janneke Nieuwenhuizen Date: Wed, 17 Apr 2024 21:08:47 +0200 Message-ID: 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 * Makefile.am: Use in_git_p conditional to disable Autotools' cache consistency assert and removal when bulding from tarball. (dist): Depend on doc-pot-update again when building from tarball. (dist-hook): Remove dependencies on gen-ChangeLog and gen-AUTHORS when building from tarball. (gen-ChangeLog, gen-AUTHORS): Remove guarding for building from tarball. Use set -e to avoid silently failing. (gen-tarball-version): Use $(SOURCE_DATE_EPOCH) instead of re-generating it using git; this also works running from a tarball. Change-Id: I9ebdd28a70837f6a4db610c4816bb283d176e2d9 --- Makefile.am | 60 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/Makefile.am b/Makefile.am index ca3fa0a693..af08bc546f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -955,6 +955,20 @@ guix-binary.%.tar.xz: guix` ; \ cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" +# The `dist' target has other dependencies when building from Git +# to assert and achieve reproducibility. +if in_git_p + +# 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 # Assert that Autotools cache is up to date with Git, by checking # PACKAGE_VERSION against HEAD. Indented to get past Automake. @@ -969,20 +983,20 @@ guix-binary.%.tar.xz: $(error Cannot create reproducible tarball) else $(warning Tarball will be irreproducible; distdir will not get removed!) - endif - endif - endif + endif # !GUIX_ALLOW_IRREPRODUCIBLE_TARBALL + endif # PACKAGE_VERSION != git_version + endif # MAKECMDGOALS dist -# 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 +else # !in_git_p + +dist: doc-pot-update -dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version + ifeq ($(MAKECMDGOALS),dist) +$(warning Not using Git, tarball will likely be irreproducible!) + endif # MAKECMDGOALS dist +endif # !in_git_p + +dist-hook: gen-tarball-version dist-hook: assert-no-store-file-names distcheck-hook: assert-binaries-available assert-final-inputs-self-contained @@ -994,27 +1008,25 @@ $(top_srcdir)/.version: config.status gen-tarball-version: echo $(VERSION) > "$(distdir)/.tarball-version" - git show HEAD --format=%ct --no-patch > $(distdir)/.tarball-timestamp + echo $(SOURCE_DATE_EPOCH) > $(distdir)/.tarball-timestamp gen-ChangeLog: - $(AM_V_GEN)if test -e .git; then \ - export LC_ALL=en_US.UTF-8; \ - export TZ=UTC0; \ - $(top_srcdir)/build-aux/gitlog-to-changelog \ - > $(distdir)/ChangeLog.tmp; \ - rm -f $(distdir)/ChangeLog; \ - mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \ - fi + $(AM_V_GEN)set -e; \ + export LC_ALL=en_US.UTF-8; \ + export TZ=UTC0; \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + > $(distdir)/ChangeLog.tmp; \ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; gen-AUTHORS: - $(AM_V_GEN)if test -e .git; then \ + $(AM_V_GEN)set -e; \ rm -f "$(distdir)/AUTHORS"; \ export LC_ALL=en_US.UTF-8; \ export TZ=UTC0; \ $(top_builddir)/pre-inst-env "$(GUILE)" \ "$(top_srcdir)/build-aux/generate-authors.scm" \ - "$(top_srcdir)" "$(distdir)/AUTHORS"; \ - fi + "$(top_srcdir)" "$(distdir)/AUTHORS"; # Like 'dist', but regenerate 'configure' so we get an up-to-date # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to