qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] configure: add support for psuedo-"in source tree" builds
Date: Thu, 20 Aug 2020 18:12:21 +0100	[thread overview]
Message-ID: <20200820171221.GO109518@redhat.com> (raw)
In-Reply-To: <CAFEAcA_a+0N8FXQ4CrBwJ9jt8LptaTO3d=LZ_S2B0H7h1Ev94g@mail.gmail.com>

On Thu, Aug 20, 2020 at 06:10:34PM +0100, Peter Maydell wrote:
> On Thu, 20 Aug 2020 at 17:56, Daniel P. Berrangé <berrange@redhat.com> 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/.
> 
> > +if test "$PWD" == "$source_path"
> > +then
> > +    echo "Using './build' as the directory for build output"
> > +    rm -rf build
> > +    mkdir -p build
> 
> Can we put in a mollyguard here so we only blow away build/
> if we previously auto-created it? Something like
> 
>       if ! -e build || -e build/created-by-configure; then
>           rm -rf build
>           mkdir -p build
>           touch build/created-by-configure
>       else
>           echo "some helpful error message here"
>       fi
> 
> (shell syntax probably wrong but you get the idea)
> 
> My current setup has multiple build-directories like
> build/x86, build/clang, ... and I'd like a guard against
> configure blowing them all away if I accidentally run it
> from the source tree some day.

Sure, that makes sense.

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 :|



  reply	other threads:[~2020-08-20 17:13 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é [this message]
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é
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=20200820171221.GO109518@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).