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

Re: [Xen-devel] [PATCH for-4.10] scripts: add a script for build testing



On Mon, Oct 23, 2017 at 02:24:40AM -0600, Jan Beulich wrote:
> >>> On 20.10.17 at 19:32, <wei.liu2@xxxxxxxxxx> 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.