From patchwork Wed Apr 17 09:53:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 63101 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 9DEAE27BBE9; Wed, 17 Apr 2024 10:55:18 +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 28D2F27BBEA for ; Wed, 17 Apr 2024 10:55:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx20I-0004jo-Qm; Wed, 17 Apr 2024 05:54:58 -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 1rx20G-0004gW-97 for guix-patches@gnu.org; Wed, 17 Apr 2024 05:54:56 -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 1rx20B-0006l8-K6 for guix-patches@gnu.org; Wed, 17 Apr 2024 05:54:52 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rx20O-0005MK-80 for guix-patches@gnu.org; Wed, 17 Apr 2024 05:55:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70380] [PATCH v3 1/4] 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 09:55:04 +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.171334765820140 (code B ref 70380); Wed, 17 Apr 2024 09:55:04 +0000 Received: (at 70380) by debbugs.gnu.org; 17 Apr 2024 09:54:18 +0000 Received: from localhost ([127.0.0.1]:45797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx1zd-0005Ei-Rd for submit@debbugs.gnu.org; Wed, 17 Apr 2024 05:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx1zK-0005A4-Sj for 70380@debbugs.gnu.org; Wed, 17 Apr 2024 05:54:02 -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 1rx1z1-0006es-Fo; Wed, 17 Apr 2024 05:53:39 -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=MhHY04uxLV0WTTKnYE3iau0XCscxWbzEGZlawrxhJj0=; b=iEI8NQEDWc53Y5xAQXf5 Cb7wCEmczl6vLBN1NLM1tNnuzN0hi7oMxQICVh1se8u1cFJYVpQ5UiNy+1wilCSL8NiRnlMimeYA6 fQY4obWbsz33/S0cz9znhmd2pTD4dRSj/hsOJ2fbgzJ5bYUb90IbOUR7eiv3Hgz8ifUG09ek9EEMN QFgkyxyblMuqD11hbTPTYxirijsjKSbOGlnN6RPv8FiS1CGA7k8oK0aLweTLgR96ULMojHhZ7dO9k AIfw6ZkG9a/xGqOUutngYjyDGj9GeybR9DVwpC7xLkEl9K1KdyUjWK6AWtrYkjfknHHt1Axnjx4LO hIoKdvP3sEd0NQ==; From: Janneke Nieuwenhuizen Date: Wed, 17 Apr 2024 11:53:28 +0200 Message-ID: <9dd6e4436bcc0639cbbae2d468e5bc3760d73aa3.1713340673.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 * Makefile.am (in_git_p): New variable. Use it 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 | 61 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index 147767ece4..39cf4b4b17 100644 --- a/Makefile.am +++ b/Makefile.am @@ -953,9 +953,24 @@ 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. Indented to get past Automake. +in_git_p = $(shell test -e .git && echo true) + ifeq ($(in_git_p),true) + +# 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. +# PACKAGE_VERSION against HEAD. ifeq ($(MAKECMDGOALS),dist) git_version = $(shell build-aux/git-version-gen .tarball-version) ifneq ($(PACKAGE_VERSION),$(git_version)) @@ -967,20 +982,18 @@ 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-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version +dist: doc-pot-update +$(warning Not using Git, tarball will likely be irreproducible!) + + 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 @@ -992,27 +1005,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