From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] configure: add support for psuedo-"in source tree" builds
Date: Fri, 21 Aug 2020 11:14:17 +0100 [thread overview]
Message-ID: <20200821101417.GG251583@redhat.com> (raw)
In-Reply-To: <20200821095821.GA5153@linux.fritz.box>
On Fri, Aug 21, 2020 at 11:58:21AM +0200, Kevin Wolf wrote:
> Am 20.08.2020 um 19:42 hat Eric Blake geschrieben:
> > On 8/20/20 11:55 AM, Daniel P. Berrangé wrote:
> > > Meson requires the build dir to be separate from the source tree. Many
> > > people are used to just running "./configure && make" though and the
> > > meson conversion breaks that.
> > >
> > > This introduces some backcompat support to make it appear as if an
> > > "in source tree" build is being done, but with the the results in the
> > > "build/" directory. This allows "./configure && make" to work as it
> > > did historically, albeit with the output binaries staying under build/.
> > >
> > > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > > ---
> >
> > In addition to reviews you already have,
> >
> >
> > > I've not tested it beyond that. Note it blows away the "build/"
> > > dir each time ./configure is run so it is pristine each time.
> >
> > I definitely like the idea of only blowing away what we created - but if we
> > created build, then recreating it for each new configure run is nice.
>
> I think I actually wouldn't automatically remove anything on configure.
> It can be surprising behaviour for configure to delete directories, and
> the old setup didn't do an automatic "make clean" either. By having a
> separate build directory, manually emptying as needed has already become
> easier.
The issue is that previously you could do
./configure
make
./configure
make
This isn't possible with the new system because meson will refuse
to use the "build/" directory if it already contains a previous
configured build.
Doing "rm -rf build" in configure lets the above sequence work.
I can remove the "rm -rf biuld" in configure if we are happy
to require
./configure
make
make distclean
./configure
make
because the "GNUmakefile" wires up "distclean" to purge the
build/ directory.
> > > We could optionally symlink binaries from build/ into $PWD
> > > if poeople think that is important, eg by changing GNUmakefile
> > > to have:
> > >
> > > recurse: all
> > > for bin in `find build -maxdepth 1 -type f -executable | grep -v -E '(ninjatool|config.status)'`; \
> >
> > Using -maxdepth gets rid of the need to pre-create empty directories for
> > nested binaries, but also loses out on binaries such as
> > x86_64-softmmu/qemu-system-x86_64. Oh, it looks like meson creates
> > qemu-system-x86_64 as a binary in the top level, then a symlink in its old
> > location. Populating symlinks to ALL old locations is thus trickier than
> > what you are proposing here, so it is fine to save that for a followup patch
> > (let's get the bare minimum in first, so that at least ./configure && make
> > works, before we worry about back-compat symlinks).
>
> Having the system emulator symlinks in the top level would be a change,
> but even more convenient than the original places. I'd vote for adding
> the auto-symlinking at least for the tools; if the top-level symlinks
> for system emulators get also symlinked by this, that's fine, too.
>
> I was actually surprised that Dan reports "make check" from the source
> tree to be working without the symlinks. Some code must be cleverer than
> I thought!
That's because "make check" is not actually running from the source
tree. When you run "make check" in the source tree, what's acutally
happening is
cd build
make check
so it is actually running from build-dir context.
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 :|
next prev parent reply other threads:[~2020-08-21 10:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 16:55 [PATCH] configure: add support for psuedo-"in source tree" builds Daniel P. Berrangé
2020-08-20 17:10 ` Peter Maydell
2020-08-20 17:12 ` Daniel P. Berrangé
2020-08-20 17:14 ` Peter Maydell
2020-08-20 17:18 ` Philippe Mathieu-Daudé
2020-08-20 17:42 ` Eric Blake
2020-08-20 17:54 ` Philippe Mathieu-Daudé
2020-08-20 18:26 ` Paolo Bonzini
2020-08-21 9:15 ` Daniel P. Berrangé
2020-08-21 9:58 ` Kevin Wolf
2020-08-21 10:14 ` Daniel P. Berrangé [this message]
2020-08-21 10:24 ` Kevin Wolf
2020-08-21 10:28 ` Paolo Bonzini
2020-08-20 18:15 ` Peter Maydell
2020-08-21 9:19 ` Daniel P. Berrangé
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=20200821101417.GG251583@redhat.com \
--to=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).