From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RW98v-0007K0-HS for qemu-devel@nongnu.org; Thu, 01 Dec 2011 11:05:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RW98p-0007hM-PA for qemu-devel@nongnu.org; Thu, 01 Dec 2011 11:05:49 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:49342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RW98p-0007gt-MH for qemu-devel@nongnu.org; Thu, 01 Dec 2011 11:05:43 -0500 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Dec 2011 11:05:41 -0500 Message-ID: <4ED7A5AE.4000602@linux.vnet.ibm.com> Date: Thu, 01 Dec 2011 10:05:02 -0600 From: Michael Roth MIME-Version: 1.0 References: <4ED3F1C3.4060601@weilnetz.de> <1322606869-25865-1-git-send-email-mdroth@linux.vnet.ibm.com> <1322606869-25865-2-git-send-email-mdroth@linux.vnet.ibm.com> <4ED68B19.7050704@weilnetz.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] Makefile: use full path for qapi-generated directory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "qemu-trivial@nongnu.org" , Stefan Weil , "qemu-devel@nongnu.org" , Stefan Hajnoczi On 12/01/2011 09:19 AM, Stefano Stabellini wrote: > On Wed, 30 Nov 2011, Stefan Weil wrote: >> It's common to use either out-of-tree builds or in-tree builds, >> but not to mix both variants with a common root directory. >> I think QEMU should explicitly forbid that mixed scenario (like >> other projects do). >> >> Even with your fix there can remain problems with generated >> header files. > > Really? Can you provide more specific details? > >> The mixed scenario creates unnecessary complexity. >> Without the mixed scenario, your patch is not needed. > > I agree that supporting the mixed scenario shouldn't be a priority. > However without this last patch a "make clean" on the main tree is not > enough to allow out of tree builds. > > Try the following scenario: > > - cd qemu; ./configure; make > > - make clean > > - cd ../temp; ./configure --source-path=../qemu; make > > this has to work, right? It does not without the patch to fix the > generation of config-devices.mak. > To clarify, the first patch I sent fix a bug that's not currently triggered due to qapi-dir always ending up being "qapi-generated/", so the guardname generated works, albeit with some needlessly verbose names. The second isn't intended to fix your issue with builds, but avoid potential problems that may arise if at some point $(BUILD_DIR) != $(CURDIR). So they don't actually fix anything, just potential bugs that may arise in the future. The issue with doing out of tree builds with a dirty source directory is really just an unsupported scenario. To really clean things up, you need to run `make distclean` using the same configuration you used to dirty the directory in the first place, otherwise even `make distclean` will leave cruft laying in target directories not present in your current config. Alexandre Raymond sent a patch to make it so that `make distclean` always left the source directory pristine, but there was some contention on what exactly a `make distclean` entails and it wasn't applied: http://lists.gnu.org/archive/html/qemu-trivial/2011-07/msg00037.html That's really the only complete fix for these build issues. I'm starting to think it'd be worth it to add a `make clean_for_reals` target that does what Alexandre's patch does and tell people to run it after a pull or switching to out-of-tree builds.