From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C68FD138010 for ; Sun, 28 Oct 2012 16:10:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF6E721C01A; Sun, 28 Oct 2012 16:10:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2577421C01A for ; Sun, 28 Oct 2012 16:10:26 +0000 (UTC) Received: from pomiocik.lan (213-238-96-169.adsl.inetia.pl [213.238.96.169]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 91A8033D95A; Sun, 28 Oct 2012 16:10:24 +0000 (UTC) Date: Sun, 28 Oct 2012 17:11:15 +0100 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: Mike Gilbert Cc: gentoo-python@lists.gentoo.org Subject: Re: [gentoo-python] distutils-r1 -- support for out-of-source builds? Message-ID: <20121028171115.26599f0d@pomiocik.lan> In-Reply-To: References: <20121028085705.62e1eed4@pomiocik.lan> <20121028165518.5f1afe4a@pomiocik.lan> Organization: Gentoo X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.13; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/O+33bUZk9Vcur/t06hTxVZ_"; protocol="application/pgp-signature" X-Archives-Salt: 0780e8dc-d878-4521-811f-5209d6bb999c X-Archives-Hash: 84e652c06ceb3f5979ae0868b058065b --Sig_/O+33bUZk9Vcur/t06hTxVZ_ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, 28 Oct 2012 12:04:04 -0400 Mike Gilbert wrote: > On Sun, Oct 28, 2012 at 11:55 AM, Micha=C5=82 G=C3=B3rny wrote: > > On Sun, 28 Oct 2012 08:57:05 +0100 > > Micha=C5=82 G=C3=B3rny wrote: > > > >> On the other hand, we would introduce a tiny bit of additional code. > > > > I did a bit research on the topic, and the code introduced is circa 100 > > lines, including docs and esetuppy() which would be probably added > > anyway. There are other potential problems however. > > > > The main issue is how distutils is designed. The only command accepting > > build-dir is the 'build' command. Other commands which need to access > > the build tree just use some weird method of getting parameters for > > other commands. Effectively, if you need to provide a build-dir, you > > always have to run 'build'. > > > > So, the install command would grow from: > > > > ./setup.py install ... > > > > to: > > > > ./setup.py build -b ... install ... > > > > Of course, all other commands accessing the build-dir would need to > > be prepended with the 'build -b ...' as well. For that reason, > > the patches I'm going to attach add that thing to esetuppy() directly. > > > > This has the following implications: > > > > 1) all calls to esetuppy() involve running build, > > > > 2) if build takes additional arguments, they may need to be passed > > consistently to all esetuppy calls (like: 'build --foo' in args). > > Otherwise, a rebuild with different options may happen (but that's > > probably a case already anyway). > > > > In any case, I wouldn't say it's very elegant of Python. It will work > > flawlessly for the most of Python packages, and likely most > > of the remaining ones would require running in-source builds anyway > > (and that can be enabled with a single variable). > > > > Well, best just look at the code and tell me what you think. > > >=20 > I don't really see any need for out-of-source builds, but if you want > to write the code for it I certainly don't mind having it there. >=20 > I will say that doing out-of-source builds occasionally makes writing > src_test a bit tricky; you have to play with the working directory and > PYTHONPATH. Yes, I have fixed gentoopm to make it compile Python modules (in tests) in build-dir rather than sourcedir. https://bitbucket.org/mgorny/gentoopm/changeset/f46c4057d76 https://bitbucket.org/mgorny/gentoopm/changeset/975fd2dde55 The first commit should be enough for most packages out there. The second one is necessary if any of the modules were loaded before (e.g. in gentoopm to get PV). But probably getting the PV like that was a bad idea anyway... --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/O+33bUZk9Vcur/t06hTxVZ_ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iJwEAQEIAAYFAlCNWSMACgkQfXuS5UK5QB01dwP/bxTfAfpiz05LDrC/CmOPnfwx nHWAjau5H3NruRnsof5BQHriE/pDvraMqAv+g+z6g8mvaXZcyAIOigpVQT/KgF2m ii+7PvWMgENhi8xABl1uzauLnsU0grDDHHBqNHZWC8DRHyOiReyr2pQIHBWYzuL+ 9FES62oyzb4RkMwcUmc= =NSeV -----END PGP SIGNATURE----- --Sig_/O+33bUZk9Vcur/t06hTxVZ_--