public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] [PATCHES] distutils-r1: making in-source builds more compatible with out-of-source builds
@ 2013-02-24 12:45 Michał Górny
  2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 1/4] In-source builds: make BUILD_DIR point to the 'build' subdir Michał Górny
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michał Górny @ 2013-02-24 12:45 UTC (permalink / raw
  To: gentoo-python; +Cc: python

[-- Attachment #1: Type: text/plain, Size: 2655 bytes --]

Hello,

Currently in-source builds differ a lot from out-of-source builds. Most
notably:

- BUILD_DIR points to source dir rather than build dir,

- build directories are not overriden,

- PYTHONPATH is not set.


With the net outcome being that:

- in-source builds are theoretically safer for weird build system hacks,

- in-source build ebuilds are harder to write,

- switching between one and the other requires a fair amount of changes.


If we consider then that enabling in-source build should be considered
a quick and possibly temporary hack to get the package to build, points
2/3 seem to really outweigh the benefit of 1.

For that reason, I'd like to 'unify' the behavior between the two.
The patches which I will send in reply to this mail will:


1) make BUILD_DIR point to the 'build' subdirectory in in-source builds,

2) override build locations the same way in both kinds of builds,

3) set PYTHONPATH in in-source builds,

4) [optional] run *_all() phases in implementation-specific sources
copy rather than ${S}.


This is an incompatible change but seems to be the least troublesome
possibility. Most importantly, any ebuild using BUILD_DIR
in python_*_all() phase will become at least partially broken.

Hopefully, this ain't as bad as it seems. Those ebuilds which used
BUILD_DIR there to append to PYTHONPATH will still work. While
the appending will no longer be correct, the newly-introduced
PYTHONPATH will take precedence and solve the issue for now.

There is also the potential of packages being broken because of
--build-* overrides. But the most common case of relying on standard
locations would probably still work because the new paths will mostly be
absolute-path variants of the default locations.

In any case, I'm testing this a bit now and will let you know what gets
broken.


Rationale:

The code appends '/build' subdirectory to BUILD_DIR in distutils-r1
(python-r1's BUILD_DIR still points to the sources). This seemed like
the best possible way of achieving the goal since:

1) BUILD_DIR is not used commonly in in-source build ebuilds,

2) using ${BUILD_DIR}/lib with BUILD_DIR pointing to source root is
likely to collide with package sources,

3) using ${BUILD_DIR}/build/lib conditionally would cause
incompatibility with out-of-source builds,

4) using ${BUILD_DIR}/build/lib unconditionally would break a fair
number of out-of-source build ebuilds using '${BUILD_DIR}/lib'.

Therefore, appending the 'build' subdir to BUILD_DIR seems like
the least evil necessary to fix the past mistake.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-24 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24 12:45 [gentoo-python] [PATCHES] distutils-r1: making in-source builds more compatible with out-of-source builds Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 1/4] In-source builds: make BUILD_DIR point to the 'build' subdir Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 2/4] In-source builds: override build locations as well Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 3/4] In-source builds: set PYTHONPATH properly Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 4/4] In-source builds: run *_all() phases in best-impl sources copy Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox