All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] OSSTEST: introduce a raisin build test
@ 2015-05-12 17:13 Stefano Stabellini
  2015-05-12 17:36 ` Ian Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Stabellini @ 2015-05-12 17:13 UTC (permalink / raw)
  To: xen-devel; +Cc: wei.liu2, ian.jackson, ian.campbell, stefano.stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---

Changes in v5:
- remove setting DEFAULT_REVISION_RAISIN to master
- disable raisin when branch is not xen*
- do not overwrite raisin default variables unless both revision_* and
tree_* are set of a given component

Changes in v4:
- introduce enable_raisin in mfi-common: only build raisin when building
xen-unstable
- start off from the default raisin config, then append osstest config
options to it
- do not write variable to the raisin config if the conrresponding
runvar is not set
- remove TREE_OVMF and TREE_SEABIOS

Changes in v3:
- use $raisindir throughout ts-raisin-build
- do not specify ENABLED_COMPONENTS so that empty REVISION variables can
be used to disable building a raisin component

Changes in v2:
- set revision_* variables in mfi-common;
- in ts-raisin-build set the *_REVISION config options based on the
  revision_* variables;
- in ts-raisin-build, call store_revision appropriately;
- divide the output in an hypervisor and a tools tarball.
---
 ap-common       |    2 +
 mfi-common      |   41 +++++++++++++
 sg-run-job      |    5 ++
 ts-raisin-build |  173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 221 insertions(+)
 create mode 100755 ts-raisin-build

diff --git a/ap-common b/ap-common
index 64749e3..60eaf66 100644
--- a/ap-common
+++ b/ap-common
@@ -47,6 +47,8 @@
 # rumpsrc-related runvars needed only for old rumpuser-xen
 # (ie ones which need $bodges=1 in ts-rumpuserxen-build)
 
+: ${TREE_RAISIN:=git://xenbits.xen.org/people/sstabellini/raisin.git}
+
 : ${TREE_SEABIOS_UPSTREAM:=git://git.seabios.org/seabios.git}
 : ${PUSH_TREE_SEABIOS:=$XENBITS:/home/xen/git/osstest/seabios.git}
 : ${BASE_TREE_SEABIOS:=git://xenbits.xen.org/osstest/seabios.git}
diff --git a/mfi-common b/mfi-common
index 16fc8c5..d75823d 100644
--- a/mfi-common
+++ b/mfi-common
@@ -148,6 +148,22 @@ create_build_jobs () {
     *) enable_ovmf=true;
     esac
 
+    case "$xenbranch" in
+    xen-3.*-testing) enable_raisin=false;;
+    xen-4.0-testing) enable_raisin=false;;
+    xen-4.1-testing) enable_raisin=false;;
+    xen-4.2-testing) enable_raisin=false;;
+    xen-4.3-testing) enable_raisin=false;;
+    xen-4.4-testing) enable_raisin=false;;
+    xen-4.5-testing) enable_raisin=false;;
+    *)               enable_raisin=true;
+    esac
+    case "$branch" in
+    xen*) ;;
+    *) enable_raisin=false;;
+    esac
+
+
     eval "
         arch_runvars=\"\$ARCH_RUNVARS_$arch\"
     "
@@ -215,6 +231,31 @@ create_build_jobs () {
 
     fi
 
+    if [ "x$REVISION_RAISIN" != xdisable ] && [ "$enable_raisin" = "true" ]; then
+
+    ./cs-job-create $flight build-$arch-raisin build-raisin                  \
+                arch=$arch                                                   \
+        tree_xen=$TREE_XEN                                                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_RAISIN_RUNVARS $arch_runvars \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags                              \
+                buildjob=${bfi}build-$arch                                   \
+                tree_raisin=$TREE_RAISIN                                     \
+                tree_qemuu=$TREE_QEMU_UPSTREAM                               \
+                tree_qemu=$TREE_QEMU                                         \
+                tree_seabios=$TREE_SEABIOS                                   \
+                tree_libvirt=$TREE_LIBVIRT                                   \
+                tree_ovmf=$TREE_OVMF                                         \
+                revision_xen=$REVISION_XEN                                   \
+                revision_qemu=$REVISION_QEMU                                 \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM                       \
+                revision_seabios=$REVISION_SEABIOS                           \
+                revision_ovmf=$REVISION_OVMF                                 \
+                revision_libvirt=$REVISION_LIBVIRT                           \
+                revision_raisin=${REVISION_RAISIN:-${DEFAULT_REVISION_RAISIN}}\
+
+    fi
+
     if branch_wants_rumpkernel_tests; then
 
     case $arch in
diff --git a/sg-run-job b/sg-run-job
index eae159d..449118d 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -346,6 +346,7 @@ proc need-hosts/build {} { return BUILD }
 proc need-hosts/build-kern {} { return BUILD }
 proc need-hosts/build-libvirt {} { return BUILD }
 proc need-hosts/build-rumpuserxen {} { return BUILD }
+proc need-hosts/build-raisin {} { return BUILD }
 
 proc run-job/build {} {
     run-ts . = ts-xen-build
@@ -364,6 +365,10 @@ proc run-job/build-rumpuserxen {} {
     run-ts . = ts-xen-build + host tools
 }
 
+proc run-job/build-raisin {} {
+    run-ts . = ts-raisin-build
+}
+
 proc prepare-build-host {} {
     global jobinfo
     run-ts broken = ts-hosts-allocate + host
diff --git a/ts-raisin-build b/ts-raisin-build
new file mode 100755
index 0000000..1b70568
--- /dev/null
+++ b/ts-raisin-build
@@ -0,0 +1,173 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use Osstest;
+use File::Path;
+use POSIX;
+use Osstest::TestSupport;
+use Osstest::BuildSupport;
+
+tsreadconfig();
+selectbuildhost(\@ARGV);
+# remaining arguments are passed as targets to "make"
+builddirsprops();
+
+my $raisindir="$builddir/raisin";
+
+sub checkout () {
+    prepbuilddirs();
+    build_clone($ho, 'raisin', $builddir, 'raisin');
+
+    target_cmd_build($ho, 100, $builddir, <<END.
+        cd $raisindir
+        cp defconfig config
+    >>config
+
+    echo >>config MAKE=\\"make $makeflags\\"
+    echo >>config PREFIX=\\"/usr\\"
+    echo >>config DESTDIR=dist
+    echo >>config ENABLED_COMPONENTS=\\"seabios ovmf xen qemu qemu_traditional libvirt\\"
+END
+               (nonempty($r{tree_xen}) && nonempty($r{revision_xen}) ? <<END : '').
+    echo >>config XEN_URL=\\"$r{tree_xen}\\"
+    echo >>config XEN_REVISION=\\"$r{revision_xen}\\"
+END
+               (nonempty($r{tree_qemuu}) && nonempty($r{revision_qemuu}) ? <<END : '').
+    echo >>config QEMU_URL=\\"$r{tree_qemuu}\\"
+    echo >>config QEMU_REVISION=\\"$r{revision_qemuu}\\"
+END
+               (nonempty($r{tree_qemu}) && nonempty($r{revision_qemu}) ? <<END : '').
+    echo >>config QEMU_TRADITIONAL_URL=\\"$r{tree_qemu}\\"
+    echo >>config QEMU_TRADITIONAL_REVISION=\\"$r{revision_qemu}\\"
+END
+               (nonempty($r{tree_seabios}) && nonempty($r{revision_seabios}) ? <<END : '').
+    echo >>config SEABIOS_URL=\\"$r{tree_seabios}\\"
+    echo >>config SEABIOS_REVISION=\\"$r{revision_seabios}\\"
+END
+               (nonempty($r{tree_libvirt}) && nonempty($r{revision_libvirt}) ? <<END : '').
+    echo >>config LIBVIRT_URL=\\"$r{tree_libvirt}\\"
+    echo >>config LIBVIRT_REVISION=\\"$r{revision_libvirt}\\"
+END
+               (nonempty($r{tree_ovmf}) && nonempty($r{revision_ovmf}) ? <<END : '')
+    echo >>config OVMF_URL=\\"$r{tree_ovmf}\\"
+    echo >>config OVMF_REVISION=\\"$r{revision_ovmf}\\"
+END
+               );
+}
+
+sub build () {
+    target_cmd_root($ho, <<END);
+        cd $raisindir
+        ./raise -y install-builddep
+END
+#/;
+    target_cmd_build($ho, 9000, $builddir, <<END);
+        cd $raisindir
+        ./raise -n build
+END
+#/;
+}
+
+sub checkoutput () {
+    target_cmd_build($ho, 100, $builddir, <<END);
+            cd $raisindir/dist
+            ls boot/xen.gz
+            ls usr/sbin/xenstored
+            ls usr/sbin/xenconsoled
+            ls usr/lib/libxenlight.so
+            ls usr/sbin/xl
+            ls usr/lib/xen/boot/hvmloader
+            ls usr/lib/xen/bin/qemu-dm
+            ls usr/lib/xen/bin/qemu-system-i386
+            ls usr/sbin/libvirtd
+END
+#/;
+}
+
+sub collectversions () {
+    store_revision($ho, 'xen', "$raisindir/xen-dir", 1);
+    store_revision($ho, 'qemu', "$raisindir/qemu-traditional-dir", 1);
+    store_revision($ho, 'qemuu', "$raisindir/qemu-dir", 1);
+    store_revision($ho, 'seabios', "$raisindir/seabios-dir", 1);
+    store_revision($ho, 'ovmf', "$raisindir/ovmf-dir", 1);
+    store_revision($ho, 'libvirt', "$raisindir/libvirt-dir", 1);
+}
+
+sub divide () {
+    # Only move hv to xeninstall, so that we can have
+    # xenpolicy in tools tarball.
+    #
+    # The files inside boot/ after `make dist' are
+    # xen-$XEN_VERSION: Xen binary
+    # xen.gz/xen: symlink to xen-$XEN_VERSION
+    # xen-$MAJOR: symlink to xen-$XEN_VERSION
+    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
+    # xen-sym-$XEN_VERSION: Xen symbol
+    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
+    #
+    # So the following snippet will leave xenpolicy* in
+    # install/boot and get packaged to tools tarball.
+    target_cmd_build($ho, 100, $builddir, <<END);
+        cd raisin
+        mkdir xendist
+        for f in *dist; do
+            mkdir -p \$f/lib
+        done
+        if test -d dist/boot; then
+            if test -f dist/boot/xen.gz || test -f dist/boot/xen; then
+                mkdir xendist/boot
+                mvfiles=`find dist/boot -name 'xen[a-z]*' -prune -o -name 'xen*' -print`
+                mv \$mvfiles xendist/boot/.
+            fi
+        fi
+END
+}
+
+sub stash () {
+    foreach my $part ('', 'xen') {
+        built_stash($ho, $builddir,
+                    "raisin/${part}dist",
+                    "${part}dist");
+    }
+    built_stash_file($ho, $builddir, "xen-syms", "raisin/xen-dir/xen/xen-syms", 1);
+    built_stash_file($ho, $builddir, "raisin-config", "raisin/config", 1);
+    built_stash_file($ho, $builddir, "seabios-config",
+             "raisin/seabios-dir/.config", 1);
+    built_compress_stashed("xen-syms");
+}
+
+
+our @probs;
+
+sub trapping ($) {
+    my ($sub) = @_;
+    my $tok= eval { $sub->(); 1; };
+    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
+}
+
+checkout();
+trapping(\&build);
+trapping(\&checkoutput);
+trapping(\&collectversions);
+divide();
+stash();
+
+die "*** something failed:\n\n".(join "\n\n",@probs)."\n** something failed"
+    if @probs;
+
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] OSSTEST: introduce a raisin build test
  2015-05-12 17:13 [PATCH v5] OSSTEST: introduce a raisin build test Stefano Stabellini
@ 2015-05-12 17:36 ` Ian Jackson
  2015-05-12 18:04   ` Stefano Stabellini
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2015-05-12 17:36 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: wei.liu2, ian.campbell, xen-devel

Stefano Stabellini writes ("[PATCH v5] OSSTEST: introduce a raisin build test"):
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
...
> +    echo >>config XEN_URL=\\"$r{tree_xen}\\"
> +    echo >>config XEN_REVISION=\\"$r{revision_xen}\\"

This is very repetitive.  In ts-xen-build, the names of the variables
are irregular, but here they are regular.  I think you should refactor
this accordingly.

I don't understand what the \\ are doing here.  Perhaps you should use
'' like in ts-xen-build ?

> +sub divide () {
> +    # Only move hv to xeninstall, so that we can have
> +    # xenpolicy in tools tarball.
> +    #
> +    # The files inside boot/ after `make dist' are
> +    # xen-$XEN_VERSION: Xen binary
> +    # xen.gz/xen: symlink to xen-$XEN_VERSION
> +    # xen-$MAJOR: symlink to xen-$XEN_VERSION
> +    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
> +    # xen-sym-$XEN_VERSION: Xen symbol
> +    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
> +    #
> +    # So the following snippet will leave xenpolicy* in
> +    # install/boot and get packaged to tools tarball.
> +    target_cmd_build($ho, 100, $builddir, <<END);
> +        cd raisin
> +        mkdir xendist
> +        for f in *dist; do
> +            mkdir -p \$f/lib
> +        done
> +        if test -d dist/boot; then
> +            if test -f dist/boot/xen.gz || test -f dist/boot/xen; then
> +                mkdir xendist/boot
> +                mvfiles=`find dist/boot -name 'xen[a-z]*' -prune -o -name 'xen*' -print`
> +                mv \$mvfiles xendist/boot/.

This, and much of stash(), is a clone-and-hack of ts-xen-build.

> +our @probs;
> +
> +sub trapping ($) {
> +    my ($sub) = @_;
> +    my $tok= eval { $sub->(); 1; };
> +    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
> +}

Again, this is copied from ts-xen-build.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] OSSTEST: introduce a raisin build test
  2015-05-12 17:36 ` Ian Jackson
@ 2015-05-12 18:04   ` Stefano Stabellini
  2015-05-13  9:02     ` Ian Campbell
  2015-05-13 16:15     ` Ian Jackson
  0 siblings, 2 replies; 6+ messages in thread
From: Stefano Stabellini @ 2015-05-12 18:04 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, wei.liu2, ian.campbell, Stefano Stabellini

On Tue, 12 May 2015, Ian Jackson wrote:
> Stefano Stabellini writes ("[PATCH v5] OSSTEST: introduce a raisin build test"):
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ...
> > +    echo >>config XEN_URL=\\"$r{tree_xen}\\"
> > +    echo >>config XEN_REVISION=\\"$r{revision_xen}\\"
> 
> This is very repetitive.  In ts-xen-build, the names of the variables
> are irregular, but here they are regular.  I think you should refactor
> this accordingly.

I think that the cure here would be worse than the disease. In bash
would be fragile and difficult to read, but you probably would do it in
perl, right? In that case I don't know how it would look like; in fact I
wouldn't know how to write it. However if you are keen on it, feel free
to provide a snippet of code and I'll try to include it in the patch.


> I don't understand what the \\ are doing here.  Perhaps you should use
> '' like in ts-xen-build ?

I need to retain the " in the output


> > +sub divide () {
> > +    # Only move hv to xeninstall, so that we can have
> > +    # xenpolicy in tools tarball.
> > +    #
> > +    # The files inside boot/ after `make dist' are
> > +    # xen-$XEN_VERSION: Xen binary
> > +    # xen.gz/xen: symlink to xen-$XEN_VERSION
> > +    # xen-$MAJOR: symlink to xen-$XEN_VERSION
> > +    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
> > +    # xen-sym-$XEN_VERSION: Xen symbol
> > +    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
> > +    #
> > +    # So the following snippet will leave xenpolicy* in
> > +    # install/boot and get packaged to tools tarball.
> > +    target_cmd_build($ho, 100, $builddir, <<END);
> > +        cd raisin
> > +        mkdir xendist
> > +        for f in *dist; do
> > +            mkdir -p \$f/lib
> > +        done
> > +        if test -d dist/boot; then
> > +            if test -f dist/boot/xen.gz || test -f dist/boot/xen; then
> > +                mkdir xendist/boot
> > +                mvfiles=`find dist/boot -name 'xen[a-z]*' -prune -o -name 'xen*' -print`
> > +                mv \$mvfiles xendist/boot/.
> 
> This, and much of stash(), is a clone-and-hack of ts-xen-build.
> 
> > +our @probs;
> > +
> > +sub trapping ($) {
> > +    my ($sub) = @_;
> > +    my $tok= eval { $sub->(); 1; };
> > +    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
> > +}
> 
> Again, this is copied from ts-xen-build.

Yes, it is. If this is not a descriptive comment, what would you have me
do? I could move trapping somewhere else common, but I don't think that
generalizing divide and stash is a good idea.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] OSSTEST: introduce a raisin build test
  2015-05-12 18:04   ` Stefano Stabellini
@ 2015-05-13  9:02     ` Ian Campbell
  2015-05-13 16:15     ` Ian Jackson
  1 sibling, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-05-13  9:02 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: wei.liu2, Ian Jackson, xen-devel

On Tue, 2015-05-12 at 19:04 +0100, Stefano Stabellini wrote:
> On Tue, 12 May 2015, Ian Jackson wrote:
> > Stefano Stabellini writes ("[PATCH v5] OSSTEST: introduce a raisin build test"):
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > ...
> > > +    echo >>config XEN_URL=\\"$r{tree_xen}\\"
> > > +    echo >>config XEN_REVISION=\\"$r{revision_xen}\\"
> > 
> > This is very repetitive.  In ts-xen-build, the names of the variables
> > are irregular, but here they are regular.  I think you should refactor
> > this accordingly.
> 
> I think that the cure here would be worse than the disease. In bash
> would be fragile and difficult to read, but you probably would do it in
> perl, right? In that case I don't know how it would look like; in fact I
> wouldn't know how to write it. However if you are keen on it, feel free
> to provide a snippet of code and I'll try to include it in the patch.

Something like:

foreach (qw(xen foo bar)) {
       (nonempty($r{tree_$_}) && nonempty($r{revision_$_}) ? <<END : '').
    echo >>config ".uc($_)."_URL=\\"$r{tree_$_}\\"
    echo >>config ".uc($_)."_REVISION=\\"$r{revision_$_}\\"
+END
}
I think.

> 
> 
> > I don't understand what the \\ are doing here.  Perhaps you should use
> > '' like in ts-xen-build ?
> 
> I need to retain the " in the output

If you use ' as your quote character then you do not need to escape uses
of ". However I think that would stop $r{tree_$_} being evaluated too,
so you would need to do like I did with uc above and use . to paste
strings together, which may not be an overall improvement.

> > > +sub divide () {
> > > +    # Only move hv to xeninstall, so that we can have
> > > +    # xenpolicy in tools tarball.
> > > +    #
> > > +    # The files inside boot/ after `make dist' are
> > > +    # xen-$XEN_VERSION: Xen binary
> > > +    # xen.gz/xen: symlink to xen-$XEN_VERSION
> > > +    # xen-$MAJOR: symlink to xen-$XEN_VERSION
> > > +    # xen-$MAJOR.$MINOR: symlink to xen-$XEN_VERSION
> > > +    # xen-sym-$XEN_VERSION: Xen symbol
> > > +    # xenpolicy-$XEN_VERSION: flask policy binary if xsm is enabled
> > > +    #
> > > +    # So the following snippet will leave xenpolicy* in
> > > +    # install/boot and get packaged to tools tarball.
> > > +    target_cmd_build($ho, 100, $builddir, <<END);
> > > +        cd raisin
> > > +        mkdir xendist
> > > +        for f in *dist; do
> > > +            mkdir -p \$f/lib
> > > +        done
> > > +        if test -d dist/boot; then
> > > +            if test -f dist/boot/xen.gz || test -f dist/boot/xen; then
> > > +                mkdir xendist/boot
> > > +                mvfiles=`find dist/boot -name 'xen[a-z]*' -prune -o -name 'xen*' -print`
> > > +                mv \$mvfiles xendist/boot/.
> > 
> > This, and much of stash(), is a clone-and-hack of ts-xen-build.
> > 
> > > +our @probs;
> > > +
> > > +sub trapping ($) {
> > > +    my ($sub) = @_;
> > > +    my $tok= eval { $sub->(); 1; };
> > > +    if (!$tok) { push @probs, $@; print STDERR "failure (trapped): $@\n"; }
> > > +}
> > 
> > Again, this is copied from ts-xen-build.
> 
> Yes, it is. If this is not a descriptive comment, what would you have me
> do? I could move trapping somewhere else common, but I don't think that
> generalizing divide and stash is a good idea.

Osstest/Testsupport.pm is a suitable home for any random shared code I
think, even if only shared between two ts-*. Or Osstest/Buildsupport.pm
might be a better choice in this case.

Thinking back to the issue about dividing the raisin build into per
components though, perhaps use_raisin should become a runvar which is
used in ts-*-build to either do the existing thing vs the new raisin
thing? Then stash+divide etc would only be used in the one place, just
consuming a potentially different dist dir output from the build phase.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] OSSTEST: introduce a raisin build test
  2015-05-12 18:04   ` Stefano Stabellini
  2015-05-13  9:02     ` Ian Campbell
@ 2015-05-13 16:15     ` Ian Jackson
  2015-06-17 15:12       ` Stefano Stabellini
  1 sibling, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2015-05-13 16:15 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: wei.liu2, ian.campbell, xen-devel

Stefano Stabellini writes ("Re: [PATCH v5] OSSTEST: introduce a raisin build test"):
> On Tue, 12 May 2015, Ian Jackson wrote:
> > I don't understand what the \\ are doing here.  Perhaps you should use
> > '' like in ts-xen-build ?
> 
> I need to retain the " in the output

raisin doesn't cope with '' in the config file ?

> > This is very repetitive.  In ts-xen-build, the names of the variables
> > are irregular, but here they are regular.  I think you should refactor
> > this accordingly.
> 
> I think that the cure here would be worse than the disease. In bash
> would be fragile and difficult to read, but you probably would do it in
> perl, right? In that case I don't know how it would look like; in fact I
> wouldn't know how to write it. However if you are keen on it, feel free
> to provide a snippet of code and I'll try to include it in the patch.

Yes, it should be done in perl.  Something like:

    foreach my $treename (qw(xen seabios blah blah)) {
        $buildcmd .= <<END;
            echo >>config \U$treename\E_URL='$r{"tree_$treename"}'
            echo >>config \U$treename\E_REVISION='$r{"revision_$treename"}'
END
    }

(Untested; adjust to taste.)

> > Again, this is copied from ts-xen-build.
> 
> Yes, it is. If this is not a descriptive comment, what would you have me
> do? I could move trapping somewhere else common, but I don't think that
> generalizing divide and stash is a good idea.

divide should be moved into BuildSupport, probably.  There, it would
need a slightly longer name, and perhaps to take some more of its
variables as parameters.

It doesn't need to be "generalised", since you want it basically
as-is.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] OSSTEST: introduce a raisin build test
  2015-05-13 16:15     ` Ian Jackson
@ 2015-06-17 15:12       ` Stefano Stabellini
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2015-06-17 15:12 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, wei.liu2, ian.campbell, Stefano Stabellini

On Wed, 13 May 2015, Ian Jackson wrote:
> Stefano Stabellini writes ("Re: [PATCH v5] OSSTEST: introduce a raisin build test"):
> > On Tue, 12 May 2015, Ian Jackson wrote:
> > > I don't understand what the \\ are doing here.  Perhaps you should use
> > > '' like in ts-xen-build ?
> > 
> > I need to retain the " in the output
> 
> raisin doesn't cope with '' in the config file ?
> 
> > > This is very repetitive.  In ts-xen-build, the names of the variables
> > > are irregular, but here they are regular.  I think you should refactor
> > > this accordingly.
> > 
> > I think that the cure here would be worse than the disease. In bash
> > would be fragile and difficult to read, but you probably would do it in
> > perl, right? In that case I don't know how it would look like; in fact I
> > wouldn't know how to write it. However if you are keen on it, feel free
> > to provide a snippet of code and I'll try to include it in the patch.
> 
> Yes, it should be done in perl.  Something like:
> 
>     foreach my $treename (qw(xen seabios blah blah)) {
>         $buildcmd .= <<END;
>             echo >>config \U$treename\E_URL='$r{"tree_$treename"}'
>             echo >>config \U$treename\E_REVISION='$r{"revision_$treename"}'
> END
>     }
> 

I see what you mean now, but the variable names are not that regular;
this wouldn't work.  In particular we have:

QEMU_URL, QEMU_REVISION and tree_qemuu, revision_qemuu
QEMU_TRADITIONAL_URL, QEMU_TRADITIONAL_REVISION and tree_qemu, revision_qemu


> > > Again, this is copied from ts-xen-build.
> > 
> > Yes, it is. If this is not a descriptive comment, what would you have me
> > do? I could move trapping somewhere else common, but I don't think that
> > generalizing divide and stash is a good idea.
> 
> divide should be moved into BuildSupport, probably.  There, it would
> need a slightly longer name, and perhaps to take some more of its
> variables as parameters.
> 
> It doesn't need to be "generalised", since you want it basically
> as-is.

OK, I should be able to do that.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-17 15:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 17:13 [PATCH v5] OSSTEST: introduce a raisin build test Stefano Stabellini
2015-05-12 17:36 ` Ian Jackson
2015-05-12 18:04   ` Stefano Stabellini
2015-05-13  9:02     ` Ian Campbell
2015-05-13 16:15     ` Ian Jackson
2015-06-17 15:12       ` Stefano Stabellini

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.