public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Zack Weinberg <zackw@panix.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Add script to build many glibc configurations
Date: Fri, 18 Nov 2016 18:27:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1611181822350.32404@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAKCAbMi=PpLoahBsx_twVtKPHBpUUZ4c9VH7Tivd2NkRouHMRQ@mail.gmail.com>

On Fri, 18 Nov 2016, Zack Weinberg wrote:

> * Please don't delete the build tree unless configure, build, and
> check all succeed, so that one can dig into a failure beyond what's

That's --keep=failed.

> visible in the logs.  Add an option to preserve the build tree even if
> all three succeeded, to facilitate additional testing (for instance,
> an "installed stripped libraries are unchanged" test - if that fails
> one will want to go look at the object files).

That's --keep=all.

There's the question of what the best default is.  The current --keep=none 
default is oriented to the idea of a buildbot that may not want disk usage 
to explode after a commit that causes all builds to fail, and will need to 
delete the build directories anyway when starting the next build.

> * Please find some way of not needing to make a copy of the glibc
> source tree for each build configuration, so that one can make edits
> to .../src/glibc and immediately do incremental rebuilds in all
> failing configurations.

You'd need to fix bug 14121, then see if builds and testing with a 
read-only source directory work (and try to find any cases where Makefile 
dependencies mean something could get regenerated in the source directory 
and the checkout step doesn't currently fix the timestamps to avoid that).

> * Please make sure that command lines written to logfiles are properly
> quoted, so that they can be copied and pasted directly into a shell.
> (The problem case I know about is CC="x-y-z-gcc -mthis -mthat" on a
> configure command line, which currently gets written to the logfile
> without any quotes.)  (Python stdlib has a function `shlex.quote` that
> will help.)

Patch below committed.

Quote shell commands in logs from build-many-glibcs.py.

As requested in
<https://sourceware.org/ml/libc-alpha/2016-11/msg00664.html>, this
patch makes the commands recorded in build-many-glibcs.py quote words
so they can be cut-and-pasted back into a shell.  (Note that these
logs are generated by the wrapper script generated to run commands
with logs, hence the needs for quoting logic to be implemented in that
shell script.)

2016-11-18  Joseph Myers  <joseph@codesourcery.com>

	* scripts/build-many-glibcs.py (Context.write_files): Make wrapper
	script quote words in command output to log suitably for input to
	the shell.

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index b0e0f5e..517dec4 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -423,7 +423,17 @@ class Context(object):
             'date > "$this_log"\n'
             'echo >> "$this_log"\n'
             'echo "Description: $desc" >> "$this_log"\n'
-            'echo "Command: $*" >> "$this_log"\n'
+            'printf "%s" "Command:" >> "$this_log"\n'
+            'for word in "$@"; do\n'
+            '  if expr "$word" : "[]+,./0-9@A-Z_a-z-]\\\\{1,\\\\}\\$" > /dev/null; then\n'
+            '    printf " %s" "$word"\n'
+            '  else\n'
+            '    printf " \'"\n'
+            '    printf "%s" "$word" | sed -e "s/\'/\'\\\\\\\\\'\'/"\n'
+            '    printf "\'"\n'
+            '  fi\n'
+            'done >> "$this_log"\n'
+            'echo >> "$this_log"\n'
             'echo "Directory: $dir" >> "$this_log"\n'
             'echo "Path addition: $path" >> "$this_log"\n'
             'echo >> "$this_log"\n'

-- 
Joseph S. Myers
joseph@codesourcery.com

      reply	other threads:[~2016-11-18 18:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 16:27 Joseph Myers
2016-11-10 14:27 ` Joseph Myers
2016-11-10 16:44   ` Joseph Myers
2016-11-23 17:36   ` Chris Metcalf
2016-11-10 17:09 ` Steve Ellcey
2016-11-10 17:22   ` Joseph Myers
2016-11-10 17:39     ` Steve Ellcey
2016-11-11 15:20 ` Joseph Myers
2016-11-11 19:37   ` Carlos O'Donell
2016-11-14 15:06   ` Mike Frysinger
2016-11-14 15:23     ` Joseph Myers
2016-11-14 19:27       ` Mike Frysinger
2016-11-14 23:28         ` Joseph Myers
2016-11-14 23:57     ` Joseph Myers
2016-11-17 16:52 ` Zack Weinberg
2016-11-17 17:26   ` Zack Weinberg
2016-11-17 17:47     ` Joseph Myers
2016-11-17 17:54     ` Andreas Schwab
2016-11-17 17:51   ` Joseph Myers
2016-11-18 16:28     ` Zack Weinberg
2016-11-18 18:27       ` Joseph Myers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1611181822350.32404@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).