bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: maint.mk: improve the release procedure


From: Akim Demaille
Subject: Re: maint.mk: improve the release procedure
Date: Fri, 21 Sep 2012 14:34:16 +0200

Le 3 août 2012 à 11:41, Jim Meyering a écrit :

> Akim Demaille wrote:
>> There is still the uploading step which is not bound to a make target.  I 
>> would remove the emit_upload_command completely, and instead mention the 
>> upload target in README-release, including the announcement step, WDYT?
> 
> Hi Akim,
> 
> I like the added automation.  Thanks.
> ACK to your amended patch.
> 
> However, we should not remove the emit_upload_command rule because
> even without multiple upload target URLs, it is nontrivial.
> I want to be able to mouse it, if necessary, not type it from scratch
> when the new make rule happens to no longer work.
> 
> When might that be?
> 
> Well, once you've run "make stable" to create the tarball, you've made the
> first commit after the tag: i.e., the "maint: post-release administrivia".
> For now that's fine, because the VERSION variable in Makefile is still
> at the bare release number (say "1.0"), rather than what git-describe
> would print: v1.0-1-gHHHHHHH.  Currently, GNUmakefile deliberately defers
> the update of VERSION, so this is fine.  Unless you happen to run "make
> _version" (or e.g., make dist) before you run the new "make upload".
> Those would update VERSION to v1.0-1-gHHHHHHH.  Once that happens, your
> "make upload" command will try to upload not the release you intend,
> but the v1.0-1-gHHHHHHH.tar.xz tarball.  Oops.
> 
> Hence, the emit_upload_command output serves as a record of the desired
> upload command that can be used more reliably than "make upload".
> 
> --------------
> Hmm... maybe I need to retract that ACK.
> Providing this new "make upload" target may make it too easy to
> accidentally upload as "stable" a version like v1.0-44-gHHHHHHH.
> 
> If you add a safety net that rejects (or at least warns otherwise,
> and requires some sort of manual override) a "stable" VERSION that
> matches /-\d+-g/, I would be more comfortable.

hi Jim,

I'm finally back on this issue.  I suggest the following three patches
to address this issue.  Actually the first two are just cleanups, and
only the last one addresses the issue.  In order to both improve reliability
and consistency between the different targets, I promote RELEASE='X.Y TYPE'
as recurring user input for them.

From 9fc32589802eb9369138cf244c446cdcf8f6e491 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Thu, 20 Sep 2012 11:09:53 +0200
Subject: [PATCH 1/3] maint.mk: silent rules

With help from Stefano Lattarini.

* top/maint.mk (writable-files): Use $(AM_V_GEN).
(announcement): Use $(AM_V_at).
---
 ChangeLog    | 7 +++++++
 top/maint.mk | 6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index da8afa2..b1856eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-20  Akim Demaille  <address@hidden>
+
+       maint.mk: silent rules
+       With help from Stefano Lattarini.
+       * top/maint.mk (writable-files): Use $(AM_V_GEN).
+       (announcement): Use $(AM_V_at).
+
 2012-09-20  Jim Meyering  <address@hidden>
 
        non-recursive-gnulib-prefix-hack: new module
diff --git a/top/maint.mk b/top/maint.mk
index 5d63b49..87bbde9 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1135,7 +1135,7 @@ sc_makefile_path_separator_check:
 # i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
 # and is read-only.
 writable-files:
-       if test -d $(release_archive_dir); then                         \
+       $(AM_V_GEN)if test -d $(release_archive_dir); then              \
          for file in $(DIST_ARCHIVES); do                              \
            for p in ./ $(release_archive_dir)/; do                     \
              test -e $$p$$file || continue;                            \
@@ -1280,7 +1280,9 @@ else
 endif
 
 announcement: NEWS ChangeLog $(rel-files)
-       $(AM_V_GEN)$(srcdir)/$(_build-aux)/announce-gen                 \
+# Not $(AM_V_GEN) since the output of this command serves as
+# annoucement message: it would start with " GEN announcement".
+       $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen                  \
            --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
-- 
1.7.12.1





From 3547cd4888812a54bae45ffa2dbabdb08e59b874 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Fri, 21 Sep 2012 14:11:18 +0200
Subject: [PATCH 2/3] maint.mk: factor the validation of RELEASE_TYPE

* top/maint.mk (GET_RELEASE_TYPE): New.
Use it instead of $(RELEASE_TYPE).
Remove now useless local checks.
---
 ChangeLog    |  7 +++++++
 top/maint.mk | 19 +++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b1856eb..61a40a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-21  Akim Demaille  <address@hidden>
+
+       maint.mk: factor the validation of RELEASE_TYPE
+       * top/maint.mk (GET_RELEASE_TYPE): New.
+       Use it instead of $(RELEASE_TYPE).
+       Remove now useless local checks.
+
 2012-09-20  Akim Demaille  <address@hidden>
 
        maint.mk: silent rules
diff --git a/top/maint.mk b/top/maint.mk
index 87bbde9..e8ea768 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -91,13 +91,22 @@ my_distdir = $(PACKAGE)-$(VERSION)
 # Old releases are stored here.
 release_archive_dir ?= ../release
 
+# Validate and return $(RELEASE_TYPE), or die.
+GET_RELEASE_TYPE =                                              \
+  $(if $(RELEASE_TYPE),                                         \
+    $(or $(shell case '$(RELEASE_TYPE)' in                      \
+                   (alpha|beta|stable) echo $(RELEASE_TYPE);;   \
+                 esac),                                         \
+       $(error invalid RELEASE_TYPE: $(RELEASE_TYPE))),         \
+    $(error RELEASE_TYPE undefined))
+
 # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
 # Use alpha.gnu.org for alpha and beta releases.
 # Use ftp.gnu.org for stable releases.
 gnu_ftp_host-alpha = alpha.gnu.org
 gnu_ftp_host-beta = alpha.gnu.org
 gnu_ftp_host-stable = ftp.gnu.org
-gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE))
+gnu_rel_host ?= $(gnu_ftp_host-$(GET_RELEASE_TYPE))
 
 ifeq ($(gnu_rel_host),ftp.gnu.org)
 url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE)
@@ -1266,7 +1275,7 @@ gpg_key_ID ?=                                             
                \
 translation_project_ ?= address@hidden
 
 # Make info-gnu the default only for a stable release.
-ifeq ($(RELEASE_TYPE),stable)
+ifeq ($(GET_RELEASE_TYPE),stable)
   announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
   announcement_mail_headers_ ?=                                                
\
     To: address@hidden                                         \
@@ -1284,7 +1293,7 @@ announcement: NEWS ChangeLog $(rel-files)
 # annoucement message: it would start with " GEN announcement".
        $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen                  \
            --mail-headers='$(announcement_mail_headers_)'              \
-           --release-type=$(RELEASE_TYPE)                              \
+           --release-type=$(GET_RELEASE_TYPE)                          \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
@@ -1386,9 +1395,7 @@ release-prep-hook ?= release-prep
 gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
-       $(AM_V_GEN)case $$RELEASE_TYPE in alpha|beta|stable) ;; \
-         *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
-       $(AM_V_at)$(MAKE) --no-print-directory -s announcement \
+       $(AM_V_GEN)$(MAKE) --no-print-directory -s announcement \
          > ~/announce-$(my_distdir)
        $(AM_V_at)if test -d $(release_archive_dir); then       \
          ln $(rel-files) $(release_archive_dir);               \
-- 
1.7.12.1





From 52cfcc3a334abd7e4b028bb502761e9a3281f7b9 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Thu, 20 Sep 2012 11:10:34 +0200
Subject: [PATCH 3/3] maint.mk: provide "make upload" to ease uploading

See <http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00028.html>.
Do not depend simply on the current $(VERSION), as there may have been
new commits since the tarball generation.  Rather, rely on $(RELEASE),
as "make release-commit" already does.

For consistency, add "make release RELEASE='X.Y TYPE'" as an alias for
"make TYPE".

* top/maint.mk (upload_command, upload, release): New.
(RELEASE_TYPE): If undefined, default to the second word of $(RELEASE).
(VERSION): first word of $(RELEASE) is always right.
(emit_upload_commands): Adjust.
* top/README-release: Update.
---
 ChangeLog          | 18 ++++++++++++++++++
 top/README-release | 15 +++++++++------
 top/maint.mk       | 23 +++++++++++++++++++----
 3 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 61a40a2..01b5eb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,24 @@
 
 2012-09-20  Akim Demaille  <address@hidden>
 
+       maint.mk: provide "make upload" to ease uploading
+       See
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00028.html>.
+       Do not depend simply on the current $(VERSION), as there may have been
+       new commits since the tarball generation.  Rather, rely on $(RELEASE),
+       as "make release-commit" already does.
+
+       For consistency, add "make release RELEASE='X.Y TYPE'" as an alias for
+       "make TYPE".
+
+       * top/maint.mk (upload_command, upload, release): New.
+       (RELEASE_TYPE): If undefined, default to the second word of $(RELEASE).
+       (VERSION): first word of $(RELEASE) is always right.
+       (emit_upload_commands): Adjust.
+       * top/README-release: Update.
+
+2012-09-20  Akim Demaille  <address@hidden>
+
        maint.mk: silent rules
        With help from Stefano Lattarini.
        * top/maint.mk (writable-files): Use $(AM_V_GEN).
diff --git a/top/README-release b/top/README-release
index 9c47528..17f026a 100644
--- a/top/README-release
+++ b/top/README-release
@@ -31,18 +31,18 @@ Here are most of the steps we (maintainers) follow when 
making a release.
 
     make check syntax-check distcheck
 
-* To (i) set the date, version number, and release type [stable/alpha/beta]
-  on line 3 of NEWS, (ii) commit that, and (iii) tag the release, run
+* To (i) set the date, version number, and release TYPE on line 3 of
+  NEWS, (ii) commit that, and (iii) tag the release, run
 
-    make release-commit RELEASE='X.Y stable'
+    # "TYPE" must be stable, beta or alpha
+    make release-commit RELEASE='X.Y TYPE'
 
 * Run the following to create release tarballs.  Your choice selects the
   corresponding upload-to destination in the emitted gnupload command.
   The different destinations are specified in cfg.mk.  See the definitions
   of gnu_ftp_host-{alpha,beta,stable}.
 
-    # "TYPE" must be stable, beta or alpha
-    make TYPE
+    make release RELEASE='X.Y TYPE'
 
 * Test the tarball.  Copy it to a few odd-ball systems and ensure that
   it builds and passes all tests.
@@ -53,7 +53,10 @@ Here are most of the steps we (maintainers) follow when 
making a release.
 
 Once all the builds and tests have passed,
 
-* Run the gnupload command that was suggested by your "make TYPE" run above.
+* Run the gnupload command that was suggested by your "make release"
+  run above, or run
+
+    make upload RELEASE='X.Y TYPE'
 
 * Wait a few minutes (maybe up to 30?) and then use the release URLs to
   download all tarball/signature pairs and use gpg --verify to ensure
diff --git a/top/maint.mk b/top/maint.mk
index e8ea768..638a926 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -91,6 +91,13 @@ my_distdir = $(PACKAGE)-$(VERSION)
 # Old releases are stored here.
 release_archive_dir ?= ../release
 
+# If RELEASE_TYPE is undefined, but RELEASE is, use its second word.
+# But overwrite VERSION.
+ifdef RELEASE
+  VERSION := $(word 1, $(RELEASE))
+  RELEASE_TYPE ?= $(word 2, $(RELEASE))
+endif
+
 # Validate and return $(RELEASE_TYPE), or die.
 GET_RELEASE_TYPE =                                              \
   $(if $(RELEASE_TYPE),                                         \
@@ -1320,16 +1327,22 @@ ftp-gnu = ftp://ftp.gnu.org/gnu
 www-gnu = http://www.gnu.org
 
 upload_dest_dir_ ?= $(PACKAGE)
+upload_command =                                               \
+  $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS)            \
+  --to $(gnu_rel_host):$(upload_dest_dir_)                     \
+  $(rel-files)
 emit_upload_commands:
        @echo =====================================
        @echo =====================================
-       @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\"
-       @echo "    --to $(gnu_rel_host):$(upload_dest_dir_) \\"
-       @echo "  $(rel-files)"
+       @echo '$(upload_command)'
        @echo '# send the ~/announce-$(my_distdir) e-mail'
        @echo =====================================
        @echo =====================================
 
+.PHONY: upload
+upload:
+       $(AM_V_GEN)echo $(upload_command)
+
 define emit-commit-log
   printf '%s\n' 'maint: post-release administrivia' ''                 \
     '* NEWS: Add header line for next release.'                                
\
@@ -1375,7 +1388,7 @@ public-submodule-commit:
 gl_public_submodule_commit ?= public-submodule-commit
 check: $(gl_public_submodule_commit)
 
-.PHONY: alpha beta stable
+.PHONY: alpha beta stable release
 ALL_RECURSIVE_TARGETS += alpha beta stable
 alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_GEN)test $@ = stable                                     \
@@ -1389,6 +1402,8 @@ alpha beta stable: $(local-check) writable-files 
$(submodule-checks)
        $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
        $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
+release: $(GET_RELEASE_TYPE)
+
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
 
-- 
1.7.12.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]