From d9d33a4b7853b9a57d8caa8b19a9d54c65e39b42 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 15 Aug 2017 13:45:06 +0100 Subject: [PATCH 1/3] Add build progress to the release script if progressbar module is available Install progressbar2 in your Python path to see the build progress. --- zcutil/make-release.py | 52 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/zcutil/make-release.py b/zcutil/make-release.py index 514d5883f..930970a3a 100755 --- a/zcutil/make-release.py +++ b/zcutil/make-release.py @@ -177,8 +177,27 @@ def patch_release_height(releaseheight): @phase('Building...') def build(): + base_dir = os.getcwd() + depends_dir = os.path.join(base_dir, 'depends') + src_dir = os.path.join(base_dir, 'src') nproc = sh_out('nproc').strip() - sh_log('./zcutil/build.sh', '-j', nproc) + sh_progress([ + 'Staging boost...', + 'Staging libevent...', + 'Staging zeromq...', + 'Staging libgmp...', + 'Staging libsodium...', + "Leaving directory '%s'" % depends_dir, + 'config.status: creating libzcashconsensus.pc', + "Entering directory '%s'" % src_dir, + 'httpserver.cpp', + 'torcontrol.cpp', + 'gtest/test_tautology.cpp', + 'gtest/test_metrics.cpp', + 'test/equihash_tests.cpp', + 'test/util_tests.cpp', + "Leaving directory '%s'" % src_dir, + ], './zcutil/build.sh', '-j', nproc) @phase('Generating manpages.') @@ -330,6 +349,37 @@ def sh_log(*args): raise SystemExit('Nonzero exit status: {!r}'.format(status)) +def sh_progress(markers, *args): + try: + import progressbar + except: + sh_log(*args) + return + + PIPE = subprocess.PIPE + try: + p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE, stdin=None) + except OSError: + logging.error('Error launching %r...', args) + raise + + pbar = progressbar.ProgressBar(max_value=len(markers)) + marker = 0 + pbar.update(marker) + logging.debug('Run (log PID %r): %r', p.pid, args) + for line in p.stdout: + logging.debug('> %s', line.rstrip()) + for idx, val in enumerate(markers[marker:]): + if val in line: + marker += idx + 1 + pbar.update(marker) + break + pbar.finish() + status = p.wait() + if status != 0: + raise SystemExit('Nonzero exit status: {!r}'.format(status)) + + class Version (object): '''A release version.''' From fd5724eca7edae6a67b7c096653ba5e996874ea8 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 18 Sep 2017 10:45:03 +0100 Subject: [PATCH 2/3] make-release.py: Send stderr to stdout --- zcutil/make-release.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zcutil/make-release.py b/zcutil/make-release.py index 930970a3a..3e9741aab 100755 --- a/zcutil/make-release.py +++ b/zcutil/make-release.py @@ -335,8 +335,9 @@ def sh_out(*args): def sh_log(*args): PIPE = subprocess.PIPE + STDOUT = subprocess.STDOUT try: - p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE, stdin=None) + p = subprocess.Popen(args, stdout=PIPE, stderr=STDOUT, stdin=None) except OSError: logging.error('Error launching %r...', args) raise @@ -357,8 +358,9 @@ def sh_progress(markers, *args): return PIPE = subprocess.PIPE + STDOUT = subprocess.STDOUT try: - p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE, stdin=None) + p = subprocess.Popen(args, stdout=PIPE, stderr=STDOUT, stdin=None) except OSError: logging.error('Error launching %r...', args) raise From 53e1e64d44140d995f585de10b353a962f4303ea Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 19 Sep 2017 22:32:59 +0100 Subject: [PATCH 3/3] List dependencies for release script in release process doc --- doc/release-process.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/release-process.md b/doc/release-process.md index d6090dfcd..59954cec6 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -38,6 +38,16 @@ process. If these were not anticipated correctly, this could block the release, so if you suspect this is necessary, double check with the whole engineering team. +## Release dependencies + +The release script has the following dependencies: + +- `help2man` +- `debchange` (part of the devscripts Debian package) + +You can optionally install the `progressbar2` Python module with pip to have a +progress bar displayed during the build process. + ## Release process Run the release script, which will verify you are on the latest clean