All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] osstest: initial support for building Xen on FreeBSD
@ 2018-07-02  8:40 Roger Pau Monne
  2018-07-02  8:41 ` [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars Roger Pau Monne
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Roger Pau Monne @ 2018-07-02  8:40 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

Hello,

The following osstest patches should allow to build Xen on FreeBSD using
clang and lld (the default toolchain on FreeBSD). First patch is a
cleanup, while the last two patches add the actual FreeBSD support.

Note that this series is tied to: (regarding the SeaBIOS build
options)

https://lists.xenproject.org/archives/html/xen-devel/2018-07/msg00048.html

Thanks, Roger.

Roger Pau Monne (3):
  osstest: remove duplicate set_freebsd_runvars
  osstest: set the make command to use for xen-build
  osstest: add FreeBSD Xen build job

 make-freebsd-flight   | 48 +++++++++++++++----------------------------
 mfi-common            | 23 +++++++++++++++++++++
 sg-run-job            |  6 ++++++
 ts-build-prep-freebsd |  5 ++++-
 ts-xen-build          | 11 +++++-----
 5 files changed, 56 insertions(+), 37 deletions(-)

-- 
2.17.1


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

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

* [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars
  2018-07-02  8:40 [PATCH 0/3] osstest: initial support for building Xen on FreeBSD Roger Pau Monne
@ 2018-07-02  8:41 ` Roger Pau Monne
  2018-07-03 15:10   ` Ian Jackson
  2018-07-02  8:41 ` [PATCH 2/3] osstest: set the make command to use for xen-build Roger Pau Monne
  2018-07-02  8:41 ` [PATCH 3/3] osstest: add FreeBSD Xen build job Roger Pau Monne
  2 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2018-07-02  8:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 make-freebsd-flight | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/make-freebsd-flight b/make-freebsd-flight
index 66d4b816..1a2b359c 100755
--- a/make-freebsd-flight
+++ b/make-freebsd-flight
@@ -36,37 +36,6 @@ job_create_build_filter_callback () {
     :
 }
 
-set_freebsd_runvars () {
-    # Caller should have done if required:
-    # local freebsd_runvars
-    #
-    # Figure out where are the installer binaries. The order is the
-    # following:
-    #
-    # 1. Env variable FREEBSD_<arch>_BUILDJOB: use the output from a
-    # previous build-<arch>-freebsd.
-    #
-    # 2. Env variables FREEBSD_DIST, FREEBSD_VERSION: set before calling
-    # into make-flight, provide the path to the installer image, the sets
-    # to install and the version being installed.
-    #
-    # 3. Config file FreeBSDDist, FreeBSDVersion: same as 2. except that
-    # they are set on the config file.
-    #
-    envvar="FREEBSD_${arch^^}_BUILDJOB"
-    if [ -n "${!envvar}" ]; then
-        freebsd_runvars="freebsdbuildjob=${!envvar}"
-    elif [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
-        freebsd_runvars="freebsd_distpath=$FREEBSD_DIST/$arch \
-                         freebsd_version=$FREEBSD_VERSION"
-    else
-        distpath=`getconfig "FreeBSDDist"`
-        version=`getconfig "FreeBSDVersion"`
-        freebsd_runvars="freebsd_distpath=$distpath/$arch \
-                         freebsd_version=$version"
-    fi
-}
-
 for arch in "$arches"; do
     set_freebsd_runvars
     job_create_build build-$arch-freebsd build-freebsd          \
-- 
2.17.1


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

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

* [PATCH 2/3] osstest: set the make command to use for xen-build
  2018-07-02  8:40 [PATCH 0/3] osstest: initial support for building Xen on FreeBSD Roger Pau Monne
  2018-07-02  8:41 ` [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars Roger Pau Monne
@ 2018-07-02  8:41 ` Roger Pau Monne
  2018-07-03 15:12   ` Ian Jackson
  2018-07-02  8:41 ` [PATCH 3/3] osstest: add FreeBSD Xen build job Roger Pau Monne
  2 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2018-07-02  8:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

The default make on FreeBSD is the BSD make, and Xen requires the GNU
make in order to build. Set the make command based on the OS for the
Xen build.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 ts-xen-build | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ts-xen-build b/ts-xen-build
index 57913d4f..57a6157a 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -28,6 +28,7 @@ tsreadconfig();
 selectbuildhost(\@ARGV);
 
 our $dokconfig = 1;
+our $make = $ho->{OS} eq "freebsd" ? "gmake" : "make";
 
 while (@ARGV && $ARGV[0] =~ m/^-/) {
     $_ = shift @ARGV;
@@ -156,24 +157,24 @@ END
 
     buildcmd_stamped_logged(600, 'xen', 'kconfig', '',<<END,'') if $dokconfig;
             if test -f xen/Kconfig; then
-                $make_prefix make -C xen olddefconfig
+                $make_prefix $make -C xen olddefconfig
             fi
 END
 
     if (!@make_args) {
 	buildcmd_stamped_logged(9000, 'xen', 'build', '',<<END,'');
-            $make_prefix make $makeflags build
+            $make_prefix $make $makeflags build
 END
     }
 
     buildcmd_stamped_logged(9000, 'xen', 'all', '',<<END,'');
-            $make_prefix make $makeflags @make_args
+            $make_prefix $make $makeflags @make_args
 END
 
     if ($enable_xsm) {
 	my $xen_version = target_cmd_output($ho, <<END, 30);
 	    cd $builddir/xen
-	    $make_prefix make xenversion
+	    $make_prefix $make xenversion
 END
 	store_runvar("flaskpolicy", "xenpolicy-" . $xen_version);
     }
@@ -181,7 +182,7 @@ END
     if ($enable_livepatch) {
 	substep_eval('/dist-test', sub {
 	    buildcmd_stamped_logged(600, 'xen', 'xenlpt', '',<<END,'');
-            $make_prefix make $makeflags dist-tests
+            $make_prefix $make $makeflags dist-tests
 END
 	});
     }
-- 
2.17.1


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

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

* [PATCH 3/3] osstest: add FreeBSD Xen build job
  2018-07-02  8:40 [PATCH 0/3] osstest: initial support for building Xen on FreeBSD Roger Pau Monne
  2018-07-02  8:41 ` [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars Roger Pau Monne
  2018-07-02  8:41 ` [PATCH 2/3] osstest: set the make command to use for xen-build Roger Pau Monne
@ 2018-07-02  8:41 ` Roger Pau Monne
  2018-07-03 15:22   ` Ian Jackson
  2 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2018-07-02  8:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

To both the FreeBSD and the xen-unstable flights.

This is the runvar difference of a xen-unstable flight:

+build-amd64-freebsd     all_host_os      freebsd
+build-amd64-xsm-freebsd all_host_os      freebsd
+build-amd64-freebsd     arch             amd64
+build-amd64-xsm-freebsd arch             amd64
+build-amd64-freebsd     enable_livepatch true
+build-amd64-xsm-freebsd enable_livepatch true
+build-amd64-freebsd     enable_xsm       false
+build-amd64-xsm-freebsd enable_xsm       true
+build-amd64-freebsd     freebsdbuildjob  124803.build-amd64-freebsd
+build-amd64-xsm-freebsd freebsdbuildjob  124803.build-amd64-freebsd
+build-amd64-freebsd     host_hostflags   arch-amd64,purpose-build
+build-amd64-xsm-freebsd host_hostflags   arch-amd64,purpose-build
+build-amd64-freebsd     revision_qemu
+build-amd64-xsm-freebsd revision_qemu
+build-amd64-freebsd     revision_qemuu
+build-amd64-xsm-freebsd revision_qemuu
+build-amd64-freebsd     revision_seabios
+build-amd64-xsm-freebsd revision_seabios
+build-amd64-freebsd     revision_xen
+build-amd64-xsm-freebsd revision_xen
+build-amd64-freebsd     tree_qemuu       git://xenbits.xen.org/qemu-xen.git
+build-amd64-xsm-freebsd tree_qemuu       git://xenbits.xen.org/qemu-xen.git
+build-amd64-freebsd     tree_seabios
+build-amd64-xsm-freebsd tree_seabios
+build-amd64-freebsd     tree_xen         git://xenbits.xen.org/xen.git
+build-amd64-xsm-freebsd tree_xen         git://xenbits.xen.org/xen.git

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 make-freebsd-flight   | 17 +++++++++++++++++
 mfi-common            | 23 +++++++++++++++++++++++
 sg-run-job            |  6 ++++++
 ts-build-prep-freebsd |  5 ++++-
 4 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/make-freebsd-flight b/make-freebsd-flight
index 1a2b359c..12338f58 100755
--- a/make-freebsd-flight
+++ b/make-freebsd-flight
@@ -60,6 +60,23 @@ for arch in "$arches"; do
                 all_host_os=freebsd                             \
                 freebsdbuildjob=build-$arch-freebsd             \
                 recipe_testinstall=true
+
+    # Create a Xen build job that's going to use the output from the first
+    # FreeBSD build job.
+    job_create_build build-$arch-xen-freebsd build-xen-freebsd  \
+                arch=$arch                                      \
+                $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS      \
+                $arch_runvars                                   \
+                tree_qemuu=$TREE_QEMU_UPSTREAM                  \
+                tree_xen=$TREE_XEN                              \
+                tree_seabios=$TREE_SEABIOS                      \
+                revision_xen=$REVISION_XEN                      \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM          \
+                revision_seabios=$REVISION_SEABIOS              \
+                host_hostflags=arch-$arch,purpose-build         \
+                all_host_os=freebsd                             \
+                freebsdbuildjob=build-$arch-freebsd             \
+                recipe_testinstall=true
 done
 
 echo $flight
diff --git a/mfi-common b/mfi-common
index 9b6c9470..3601f38e 100644
--- a/mfi-common
+++ b/mfi-common
@@ -183,6 +183,7 @@ create_build_jobs () {
   local enable_ovmf
   local build_hostflags
   local livepatch_runvars
+  local freebsd_runvars build_on_freebsd
 
   if [ "x$BUILD_LVEXTEND_MAX" != x ]; then
      BUILD_RUNVARS+=" build_lvextend_max=$BUILD_LVEXTEND_MAX "
@@ -193,6 +194,8 @@ create_build_jobs () {
 
     if [ "x$arch" = xdisable ]; then continue; fi
 
+    set_freebsd_runvars
+
     build_matrix_branch_filter_callback || continue
 
     case "$arch" in
@@ -269,6 +272,11 @@ create_build_jobs () {
     esac
     enable_prevovmf=${enable_prevovmf:-$enable_ovmf}
 
+    case "$xenbranch" in
+    xen-unstable) build_on_freebsd=true;;
+    *)            build_on_freebsd=false;;
+    esac
+
     want_prevxen=n
     if branch_wants_migrupgrade_tests ; then
         # Only x86 for now
@@ -310,6 +318,21 @@ create_build_jobs () {
                 revision_seabios=$REVISION_SEABIOS                           \
                 revision_ovmf=$REVISION_OVMF                                 \
                 revision_minios=$REVISION_MINIOS
+      if [ x$arch = xamd64 ] && [ x$build_on_freebsd = xtrue ] ; then
+        job_create_build build-$arch$xsm_suffix-freebsd build-xen-freebsd    \
+          arch=$arch                                                         \
+          enable_xsm=$enable_xsm $livepatch_runvars                          \
+          tree_qemuu=$TREE_QEMU_UPSTREAM                                     \
+          tree_xen=$TREE_XEN                                                 \
+          tree_seabios=$TREE_SEABIOS                                         \
+          $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars           \
+          host_hostflags=arch-$arch,purpose-build                            \
+          revision_xen=$REVISION_XEN                                         \
+          revision_qemu=$REVISION_QEMU                                       \
+          revision_qemuu=$REVISION_QEMU_UPSTREAM                             \
+          revision_seabios=$REVISION_SEABIOS                                 \
+          all_host_os=freebsd $freebsd_runvars
+      fi
     done
 
     if [ x$want_prevxen = xy ] ; then
diff --git a/sg-run-job b/sg-run-job
index d152051f..67fac1a8 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -712,6 +712,7 @@ proc need-hosts/build-libvirt {}        { return BUILD_LINUX }
 proc need-hosts/build-rumprun {}        { return BUILD_LINUX }
 proc need-hosts/build-xtf {}            { return BUILD_LINUX }
 proc need-hosts/build-freebsd {}        { return BUILD_FREEBSD }
+proc need-hosts/build-xen-freebsd {}    { return BUILD_FREEBSD }
 
 proc run-job/build {} {
     run-ts . = ts-xen-build
@@ -742,6 +743,11 @@ proc run-job/build-freebsd {} {
     run-ts . = ts-freebsd-build
 }
 
+proc run-job/build-xen-freebsd {} {
+    run-ts . xen-build-clang ts-xen-build + host -- clang=y SEABIOSCC=gcc \
+                                                    SEABIOSLD=/usr/local/bin/ld
+}
+
 proc allocate-build-host {ostype} {
     global jobinfo
     switch -exact $ostype {
diff --git a/ts-build-prep-freebsd b/ts-build-prep-freebsd
index 3999ed79..e3220fa8 100755
--- a/ts-build-prep-freebsd
+++ b/ts-build-prep-freebsd
@@ -31,7 +31,10 @@ our $ho= selecthost($whhost);
 exit 0 if $ho->{SharedReady};
 
 sub install_deps () {
-    target_install_packages($ho, qw(git));
+    my @packages = qw(git glib pkgconf yajl gmake pixman markdown gettext
+                      python argp-standalone lzo2 git gcc binutils);
+
+    target_install_packages($ho, @packages);
 }
 
 install_deps();
-- 
2.17.1


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

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

* Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars
  2018-07-02  8:41 ` [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars Roger Pau Monne
@ 2018-07-03 15:10   ` Ian Jackson
  2018-07-03 15:50     ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 15:10 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Oops.  I wonder if this was my doing.  Have you verified that they're
identical ?

Ian.

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

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

* Re: [PATCH 2/3] osstest: set the make command to use for xen-build
  2018-07-02  8:41 ` [PATCH 2/3] osstest: set the make command to use for xen-build Roger Pau Monne
@ 2018-07-03 15:12   ` Ian Jackson
  2018-07-03 15:51     ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 15:12 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH 2/3] osstest: set the make command to use for xen-build"):
> The default make on FreeBSD is the BSD make, and Xen requires the GNU
> make in order to build. Set the make command based on the OS for the
> Xen build.
...
>  our $dokconfig = 1;
> +our $make = $ho->{OS} eq "freebsd" ? "gmake" : "make";

Wouldn't it be better to write
   $ho->{OS} =~ m/bsd/
or something ?

Subject to either changing that, or having an answer:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.

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

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

* Re: [PATCH 3/3] osstest: add FreeBSD Xen build job
  2018-07-02  8:41 ` [PATCH 3/3] osstest: add FreeBSD Xen build job Roger Pau Monne
@ 2018-07-03 15:22   ` Ian Jackson
  2018-07-03 16:10     ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 15:22 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH 3/3] osstest: add FreeBSD Xen build job"):
> To both the FreeBSD and the xen-unstable flights.
> 
> This is the runvar difference of a xen-unstable flight:

Just to clarify my thinking:

> +    # Create a Xen build job that's going to use the output from the first
> +    # FreeBSD build job.

I think you do it like this so that on the freebsd branch, we use the
new being-tested version of freebsd, and see if it breaks the Xen
build.

> +    case "$xenbranch" in
> +    xen-unstable) build_on_freebsd=true;;
> +    *)            build_on_freebsd=false;;

I don't think this is right.  Why do we only want to do this with
xen-unstable ?  If the problem is that you need "new enough" xen, then
you need the version comparison case pattern used elsewhere, so that
each new branch of Xen has this turned on.

> +      if [ x$arch = xamd64 ] && [ x$build_on_freebsd = xtrue ] ; then
> +        job_create_build build-$arch$xsm_suffix-freebsd build-xen-freebsd    \
> +          arch=$arch                                                         \
> +          enable_xsm=$enable_xsm $livepatch_runvars                          \
> +          tree_qemuu=$TREE_QEMU_UPSTREAM                                     \
> +          tree_xen=$TREE_XEN                                                 \
> +          tree_seabios=$TREE_SEABIOS                                         \
> +          $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars           \
> +          host_hostflags=arch-$arch,purpose-build                            \
> +          revision_xen=$REVISION_XEN                                         \
> +          revision_qemu=$REVISION_QEMU                                       \
> +          revision_qemuu=$REVISION_QEMU_UPSTREAM                             \
> +          revision_seabios=$REVISION_SEABIOS                                 \

These various xen build runvar settings seem to have mostly been
copied from create_build_jobs.  I think they should be abstracted into
a function.

Also of course you have two places where you create the job
build-xen-freebsd.  Can we please have a shell function for that to
avoid the duplication ?

> +proc run-job/build-xen-freebsd {} {
> +    run-ts . xen-build-clang ts-xen-build + host -- clang=y SEABIOSCC=gcc \
> +                                                    SEABIOSLD=/usr/local/bin/ld

This is quite ugly.  sg-run-job normally tries to be a bit more
abstract.  I'm not sure exactly what to suggest.

Maybe a ts-xen-build-clang containing these arguments ?  Of course for
a clang build on Linux /usr/local/bin/ld is wrong...

It's also very odd that /usr/local/bin/ld is the right thing here.
I'm not sure how the semantics of /usr/local ("locally installed")
relate to Seabios's need for (presumably) binutils ld ?  Is it
conventional on FreeBSD that /usr/local/bin/ld is binutils, or is that
some kind of happenstance ?

Thanks,
Ian.

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

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

* Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars
  2018-07-03 15:10   ` Ian Jackson
@ 2018-07-03 15:50     ` Roger Pau Monné
  2018-07-03 16:53       ` Ian Jackson
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2018-07-03 15:50 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 03, 2018 at 04:10:56PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Oops.  I wonder if this was my doing.  Have you verified that they're
> identical ?

They are not identical. The one in mfi-common is a superset of the one
here, because the function itself will try to retrieve the anointed
version itself as a last resort.

Thanks, Roger.

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

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

* Re: [PATCH 2/3] osstest: set the make command to use for xen-build
  2018-07-03 15:12   ` Ian Jackson
@ 2018-07-03 15:51     ` Roger Pau Monné
  2018-07-03 16:54       ` Ian Jackson
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2018-07-03 15:51 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 03, 2018 at 04:12:06PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH 2/3] osstest: set the make command to use for xen-build"):
> > The default make on FreeBSD is the BSD make, and Xen requires the GNU
> > make in order to build. Set the make command based on the OS for the
> > Xen build.
> ...
> >  our $dokconfig = 1;
> > +our $make = $ho->{OS} eq "freebsd" ? "gmake" : "make";
> 
> Wouldn't it be better to write
>    $ho->{OS} =~ m/bsd/
> or something ?

Yes, that's indeed better. Would you like me to send a new version
with this fixed?

> Subject to either changing that, or having an answer:
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks, Roger.

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

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

* Re: [PATCH 3/3] osstest: add FreeBSD Xen build job
  2018-07-03 15:22   ` Ian Jackson
@ 2018-07-03 16:10     ` Roger Pau Monné
  2018-07-03 16:56       ` Ian Jackson
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2018-07-03 16:10 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 03, 2018 at 04:22:45PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH 3/3] osstest: add FreeBSD Xen build job"):
> > To both the FreeBSD and the xen-unstable flights.
> > 
> > This is the runvar difference of a xen-unstable flight:
> 
> Just to clarify my thinking:
> 
> > +    # Create a Xen build job that's going to use the output from the first
> > +    # FreeBSD build job.
> 
> I think you do it like this so that on the freebsd branch, we use the
> new being-tested version of freebsd, and see if it breaks the Xen
> build.

Yes, that's the intention.

> > +    case "$xenbranch" in
> > +    xen-unstable) build_on_freebsd=true;;
> > +    *)            build_on_freebsd=false;;
> 
> I don't think this is right.  Why do we only want to do this with
> xen-unstable ?  If the problem is that you need "new enough" xen, then
> you need the version comparison case pattern used elsewhere, so that
> each new branch of Xen has this turned on.

Yes, you are right.

> > +      if [ x$arch = xamd64 ] && [ x$build_on_freebsd = xtrue ] ; then
> > +        job_create_build build-$arch$xsm_suffix-freebsd build-xen-freebsd    \
> > +          arch=$arch                                                         \
> > +          enable_xsm=$enable_xsm $livepatch_runvars                          \
> > +          tree_qemuu=$TREE_QEMU_UPSTREAM                                     \
> > +          tree_xen=$TREE_XEN                                                 \
> > +          tree_seabios=$TREE_SEABIOS                                         \
> > +          $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars           \
> > +          host_hostflags=arch-$arch,purpose-build                            \
> > +          revision_xen=$REVISION_XEN                                         \
> > +          revision_qemu=$REVISION_QEMU                                       \
> > +          revision_qemuu=$REVISION_QEMU_UPSTREAM                             \
> > +          revision_seabios=$REVISION_SEABIOS                                 \
> 
> These various xen build runvar settings seem to have mostly been
> copied from create_build_jobs.  I think they should be abstracted into
> a function.
> 
> Also of course you have two places where you create the job
> build-xen-freebsd.  Can we please have a shell function for that to
> avoid the duplication ?

Yes, let me try.

> > +proc run-job/build-xen-freebsd {} {
> > +    run-ts . xen-build-clang ts-xen-build + host -- clang=y SEABIOSCC=gcc \
> > +                                                    SEABIOSLD=/usr/local/bin/ld
> 
> This is quite ugly.  sg-run-job normally tries to be a bit more
> abstract.  I'm not sure exactly what to suggest.
> 
> Maybe a ts-xen-build-clang containing these arguments ?  Of course for
> a clang build on Linux /usr/local/bin/ld is wrong...

Maybe ts-xen-build-freebsd?

I went this route because it did not involve creating yet another
ts-build-* script, but if you think it's better I can add such a
script.

> It's also very odd that /usr/local/bin/ld is the right thing here.
> I'm not sure how the semantics of /usr/local ("locally installed")
> relate to Seabios's need for (presumably) binutils ld ?

Yes, SeaBIOS requires GNU ld in order to build, hence the setting of
those parameters.

On FreeBSD there's a difference from what's in base and on ports. base
is the basic system that contains a basic set of utilities, and it's
using a single repository:

https://svnweb.freebsd.org/base/head/

This contains the kernel, loader, and what's considered a minimal set
of tools to get a working UNIX system.

Everything else is installed from packages, and all those go by
default into /usr/local (you can change that to whatever path you
want). The set of packages to install is called ports, and the source
is not hosted in a FreeBSD repository, only the recipes to build them:

https://svnweb.freebsd.org/ports/head/

GNU binutils is moving outside of base, and is installed from a port
into /usr/local.

> Is it
> conventional on FreeBSD that /usr/local/bin/ld is binutils, or is that
> some kind of happenstance ?

It happens to be like that in this case because the
ts-build-prep-freebsd installs the binutils package in /usr/local and
that provides GNU ld in the specified path.

Thanks, Roger.

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

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

* Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars
  2018-07-03 15:50     ` Roger Pau Monné
@ 2018-07-03 16:53       ` Ian Jackson
  2018-07-04  7:50         ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 16:53 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: Ian Jackson, xen-devel

Roger Pau Monné writes ("Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> On Tue, Jul 03, 2018 at 04:10:56PM +0100, Ian Jackson wrote:
> > Roger Pau Monne writes ("[PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > 
> > Oops.  I wonder if this was my doing.  Have you verified that they're
> > identical ?
> 
> They are not identical. The one in mfi-common is a superset of the one
> here, because the function itself will try to retrieve the anointed
> version itself as a last resort.

So as a side effect of this change you are adding that functionality
to make-freebsd-flight ?  Or rather, you are fixing, in
make-freebsd-flight, the bug that caused me to write:
  mfi-common: Fall back to anointed builds in Executive mode
?

Ian.

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

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

* Re: [PATCH 2/3] osstest: set the make command to use for xen-build
  2018-07-03 15:51     ` Roger Pau Monné
@ 2018-07-03 16:54       ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 16:54 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH 2/3] osstest: set the make command to use for xen-build"):
> On Tue, Jul 03, 2018 at 04:12:06PM +0100, Ian Jackson wrote:
> > Wouldn't it be better to write
> >    $ho->{OS} =~ m/bsd/
> > or something ?
> 
> Yes, that's indeed better. Would you like me to send a new version
> with this fixed?

Well, please change it in your tree.  I think I may ask you to change
another commit message somehwere...

Ian.

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

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

* Re: [PATCH 3/3] osstest: add FreeBSD Xen build job
  2018-07-03 16:10     ` Roger Pau Monné
@ 2018-07-03 16:56       ` Ian Jackson
  2018-07-04  7:57         ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2018-07-03 16:56 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH 3/3] osstest: add FreeBSD Xen build job"):
> On Tue, Jul 03, 2018 at 04:22:45PM +0100, Ian Jackson wrote:
> > This is quite ugly.  sg-run-job normally tries to be a bit more
> > abstract.  I'm not sure exactly what to suggest.
> > 
> > Maybe a ts-xen-build-clang containing these arguments ?  Of course for
> > a clang build on Linux /usr/local/bin/ld is wrong...
> 
> Maybe ts-xen-build-freebsd?
> 
> I went this route because it did not involve creating yet another
> ts-build-* script, but if you think it's better I can add such a
> script.

Mmm.  How about a simple shell script wrapper ?  See
ts-host-install-twice :-).

> It happens to be like that in this case because the
> ts-build-prep-freebsd installs the binutils package in /usr/local and
> that provides GNU ld in the specified path.

So this is a thing specific to building on FreeBSD, and will always be
true ?  Presumably on other BSDs too in theory ?

Maybe it should be in ts-xen-build, then, conditional on $ho->{OS} ?

Ian.

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

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

* Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars
  2018-07-03 16:53       ` Ian Jackson
@ 2018-07-04  7:50         ` Roger Pau Monné
  0 siblings, 0 replies; 15+ messages in thread
From: Roger Pau Monné @ 2018-07-04  7:50 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 03, 2018 at 05:53:44PM +0100, Ian Jackson wrote:
> Roger Pau Monné writes ("Re: [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> > On Tue, Jul 03, 2018 at 04:10:56PM +0100, Ian Jackson wrote:
> > > Roger Pau Monne writes ("[PATCH 1/3] osstest: remove duplicate set_freebsd_runvars"):
> > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > > 
> > > Oops.  I wonder if this was my doing.  Have you verified that they're
> > > identical ?
> > 
> > They are not identical. The one in mfi-common is a superset of the one
> > here, because the function itself will try to retrieve the anointed
> > version itself as a last resort.
> 
> So as a side effect of this change you are adding that functionality
> to make-freebsd-flight ?  Or rather, you are fixing, in
> make-freebsd-flight, the bug that caused me to write:
>   mfi-common: Fall back to anointed builds in Executive mode
> ?

For make-freebsd-flight the initial build to use is set by
cr-daily-branch, so that we can have FreeBSD flights from different
FreeBSD branches. I think this behaviour should be preserved, even if
ATM we only run FreeBSD flights from the master branch.

So I don't think this is strictly a bug for make-freebsd-flight, but
there's no need to have a specific set_freebsd_runvars.

Does this make sense? Should I add something to the commit message in
order to make this clearer? What about:

"The set_freebsd_runvars helper in mfi-common is a superset of the
original function present in make-freebsd-flight, and will attempt to
fetch the last anointed FreeBSD build as a last resort option if no
FreeBSD build is signaled from the FreeBSD env vars. There's no
reason to have this duplication, since the set_freebsd_runvars in
mfi-common is perfectly suitable to be used by make-freebsd-flight.

This duplication was wrongly introduced by d36a7d892f by adding a
set_freebsd_runvars to mfi-common without removing the original
function in make-freebsd-flight."

Thanks, Roger.

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

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

* Re: [PATCH 3/3] osstest: add FreeBSD Xen build job
  2018-07-03 16:56       ` Ian Jackson
@ 2018-07-04  7:57         ` Roger Pau Monné
  0 siblings, 0 replies; 15+ messages in thread
From: Roger Pau Monné @ 2018-07-04  7:57 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Tue, Jul 03, 2018 at 05:56:51PM +0100, Ian Jackson wrote:
> Roger Pau Monné writes ("Re: [PATCH 3/3] osstest: add FreeBSD Xen build job"):
> > On Tue, Jul 03, 2018 at 04:22:45PM +0100, Ian Jackson wrote:
> > > This is quite ugly.  sg-run-job normally tries to be a bit more
> > > abstract.  I'm not sure exactly what to suggest.
> > > 
> > > Maybe a ts-xen-build-clang containing these arguments ?  Of course for
> > > a clang build on Linux /usr/local/bin/ld is wrong...
> > 
> > Maybe ts-xen-build-freebsd?
> > 
> > I went this route because it did not involve creating yet another
> > ts-build-* script, but if you think it's better I can add such a
> > script.
> 
> Mmm.  How about a simple shell script wrapper ?  See
> ts-host-install-twice :-).
> 
> > It happens to be like that in this case because the
> > ts-build-prep-freebsd installs the binutils package in /usr/local and
> > that provides GNU ld in the specified path.
> 
> So this is a thing specific to building on FreeBSD, and will always be
> true ?

Yes, I think on FreeBSD we can assume that /usr/local/bin/ld will
always be GNU ld iff the binutils package has been installed from
ports.

> Presumably on other BSDs too in theory ?

Hm, I wouldn't bet on that. NetBSD still ships GNU ld in base, and the
ports directory there is /usr/pkg/ by default IIRC. I'm not sure about
OpenBSD.

The only common part is the fact that all BSDs ship BSD make in base,
and GNU make is gmake, so I'm happy to place this in ts-xen-build
directly (like it's done in patch #2).

> Maybe it should be in ts-xen-build, then, conditional on $ho->{OS} ?

I think I prefer to use a ts-xen-build-freebsd wrapper around
ts-xen-build if you are OK with it.

Thanks, Roger.

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

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

end of thread, other threads:[~2018-07-04  7:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02  8:40 [PATCH 0/3] osstest: initial support for building Xen on FreeBSD Roger Pau Monne
2018-07-02  8:41 ` [PATCH 1/3] osstest: remove duplicate set_freebsd_runvars Roger Pau Monne
2018-07-03 15:10   ` Ian Jackson
2018-07-03 15:50     ` Roger Pau Monné
2018-07-03 16:53       ` Ian Jackson
2018-07-04  7:50         ` Roger Pau Monné
2018-07-02  8:41 ` [PATCH 2/3] osstest: set the make command to use for xen-build Roger Pau Monne
2018-07-03 15:12   ` Ian Jackson
2018-07-03 15:51     ` Roger Pau Monné
2018-07-03 16:54       ` Ian Jackson
2018-07-02  8:41 ` [PATCH 3/3] osstest: add FreeBSD Xen build job Roger Pau Monne
2018-07-03 15:22   ` Ian Jackson
2018-07-03 16:10     ` Roger Pau Monné
2018-07-03 16:56       ` Ian Jackson
2018-07-04  7:57         ` Roger Pau Monné

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.