All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	KonradRzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.10] scripts: add a script for build testing
Date: Mon, 23 Oct 2017 12:41:53 +0100	[thread overview]
Message-ID: <20171023114152.e2wy33s2bujbqbsm@citrix.com> (raw)
In-Reply-To: <59EDC3680200007800189363@prv-mh.provo.novell.com>

On Mon, Oct 23, 2017 at 02:24:40AM -0600, Jan Beulich wrote:
> >>> On 20.10.17 at 19:32, <wei.liu2@citrix.com> wrote:
> > --- /dev/null
> > +++ b/scripts/build-test.sh
> > @@ -0,0 +1,40 @@
> > +#!/bin/sh
> > +
> > +# WARNING: Always backup the branch by creating another reference to it if
> > +# you're not familiar with git-rebase(1).
> > +#
> > +# Use `git rebase` to run command or script on every commit within the range
> > +# specified. If no command or script is provided, use the default one to clean
> > +# and build the whole tree.
> > +#
> > +# If something goes wrong, the script will stop at the commit that fails.  Fix
> > +# the failure and run `git rebase --continue`.
> > +#
> > +# If for any reason the tree is screwed, use `git rebase --abort` to restore to
> > +# original state.
> > +
> > +if ! test -f xen/Kconfig; then
> > +    echo "Please run this script from top-level directory"
> 
> Wouldn't running this in one of the top-level sub-trees also be useful?
> E.g. why would one want a hypervisor only series not touching the
> public interface to have the tools tree rebuilt all the time?
> 

You can do that by supplying your custom command.

The script really aims to be an easy to use thing to point contributors
to hence the checks, warning and restrictions, while at the same time
allows some flexibility.

For example, if you want to build hypervisor only:

$ ./scripts/build-test.sh $BASE $TIP "make -C xen clean && make -C xen"

> > +    exit 1
> > +fi
> > +
> > +if test $# -lt 2 ; then
> > +    echo "Usage: $0 <BASE> <TIP> [CMD|SCRIPT]"
> 
> Perhaps
> 
>     echo "Usage: $0 <BASE> <TIP> [<CMD>|<SCRIPT>]"
> 
> ? Also I'm not clear why you make the distinction between command
> and script.
> 

I will just use CMD here.

> > +    exit 1
> > +fi
> > +
> > +BASE=$1
> > +TIP=$2
> > +CMD=${3:-git clean -fdx && ./configure && make -j4}
> > +
> > +echo "Running command \"$CMD\" on every commit from $BASE to $TIP"
> > +echo -n "Starting in "
> > +
> > +for i in `seq 5 -1 1`; do
> > +    echo -n "$i ... "
> > +    sleep 1
> > +done
> 
> What is this startup delay intended for?
> 

To give user a chance to check the command -- git-rebase can be
destructive after all.

> > +echo
> > +
> > +git rebase $BASE $TIP -x "$CMD"
> 
> Is this quoting on $CMD really going to work right no matter what
> the variable actually expands to? I.e. don't you either want to use
> "eval" or adjust script arguments such that you can use "$@" with
> its special quoting rules?

What sort of use cases you have in mind that involve complex quoting and
expansion?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-23 11:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 17:32 [PATCH for-4.10] scripts: add a script for build testing Wei Liu
2017-10-23  8:24 ` Jan Beulich
2017-10-23 11:41   ` Wei Liu [this message]
2017-10-23 12:02     ` Ian Jackson
2017-10-23 12:03       ` Wei Liu
2017-10-23 12:07         ` Ian Jackson
2017-10-23 12:20           ` Wei Liu
2017-10-23 12:09     ` Jan Beulich
2017-10-23 12:15     ` Ian Jackson
2017-10-23 11:12 ` Julien Grall
2017-10-23 11:30 ` Anthony PERARD
2017-10-23 11:37   ` Anthony PERARD
2017-10-23 11:50   ` Wei Liu
2017-10-23 13:02 ` George Dunlap
2017-10-23 14:50   ` Anthony PERARD
2017-10-23 15:04     ` Wei Liu
2017-10-23 15:09       ` Ian Jackson
2017-10-23 15:11         ` Wei Liu

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=20171023114152.e2wy33s2bujbqbsm@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.