Re: [libvirt PATCH 2/2] ci: Call meson consistently

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

 



On Thu, Apr 08, 2021 at 12:56:05PM +0200, Martin Kletzander wrote:
> On Thu, Apr 08, 2021 at 11:39:55AM +0100, Daniel P. Berrangé wrote:
> > On Thu, Apr 08, 2021 at 12:32:10PM +0200, Martin Kletzander wrote:
> > > On Thu, Apr 01, 2021 at 03:43:11PM +0200, Andrea Bolognani wrote:
> > > > On Wed, 2021-03-31 at 23:31 +0200, Martin Kletzander wrote:
> > > > > On Fri, Mar 26, 2021 at 11:35:02AM +0100, Andrea Bolognani wrote:
> > > > > > We should always pass --werror and display the contents of the
> > > > > > log file in case of failure.
> > > > >
> > > > > Any reason why the lines are not in one place?  What I did in libnbd
> > > > > (first draft, still up for review) is that I just took all the lines of
> > > > > the script and put them inside `ci/build_script.sh` with only the most
> > > > > basic conditionals to accommodate various types of runs.  That way
> > > > > common things are in one place.  It could take a parameter (like what
> > > > > ninja target to run) and you can run things after that (like `website`
> > > > > and `potfiles` jobs do.  Just an idea.
> > > >
> > > > As is often the case, the raisins are mostly hysterical ;)
> > > >
> > > > I think the initial idea was to keep things as simple as possible,
> > > > but I agree with you that when you have seven (!) build recipes, most
> > > > of which are almost identical, it makes sense to think about
> > > > consolidating them to a single location.
> > > >
> > > 
> > > So I took a look at the consolidation.  I went through few iterations
> > > after which I ended with two scripts, one that does the meson part and
> > > one that does the ninja part.  The first one does not need to take any
> > > parameters, the other one would be nice if it took one, that's enough.
> > > What's weird about it is the way I think of it.  The most understandable
> > > way would be a `configure` that runs `meson ...` and then another one,
> > > which runs `ninja ...` with parameter(s).
> > > 
> > > At that point you can make the second one a Makefile and just do:
> > > 
> > >   ./configure
> > >   make
> > > 
> > > most of the time.  But because we can just put the configure part into
> > > the makefile we can also just have a makefile that does all of it.  It
> > > might sound stupid, but it is the easiest way how to provide few targets
> > > without extra scripting and everything around it.  On the other hand it
> > > feels weird just suggesting that, although I cannot pinpoint why that
> > > is.  Maybe that it would be too controversial?
> > > 
> > > At this point I honestly do not know whether I went too far or it
> > > actually makes sense and I am not capable of recognising the difference.
> > 
> > I've not looked back at the full thread, but I'd say that if the answer
> > to any problem involves the words  "configure" or "make", then we're
> > likely approaching the problem in the wrong way, because we're really
> > supposed to have removed use of make and autotools (or anything that
> > pretends to look like a configure script),
> > 
> 
> It's only the name that suggested this, it could've been a
> `ci/build_script.sh`, I just used the name because it, of course,
> reminded me of the old ways.
> 
> Basically the whole point of this is to have the line:
> 
>   meson build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
> 
> only written in one place, and possibly similarly with some ninja
> invocations.  It would be almost exclusively used by the CI, although it
> could be also useful for some people.

Our ci/build.sh & ci/Makefile commands probably don't belong here at all.

If we think about it they're just trying to provide a simple way to run a
build inside a container, and this logic works for essentially any app
that uses meson.  This suggests it probably doesn't belong in libvirt.git.

Instead we might want to think about doing this in lcitool, so it can be
used from any of our repos that use meson. Most of the logic will work
fine for other build systems too.

IOW, instead of using a makefile to provide

   make ci-build@fedora-33

we could just let people run

  lcitool build -c fedora-33

where -c is shorthand for --container, and could have -v / --vm for doing
the VM builds.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux