Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Subject: [gentoo-python] distutils-r1: BEST_BUILD_DIR vs BUILD_DIR problem
Date: Wed, 09 Jan 2013 21:56:45
Message-Id: 20130109225658.4937dbba@pomiocik.lan
1 Hello,
2
3 distutils-r1 has a few sub-phase functions which are run once
4 per the whole build process. For example:
5
6 python_compile_all() -- e.g. for building docs
7 python_install_all() -- e.g. for installing docs ;)
8
9 Some time ago I have made the eclass export the data for best enabled
10 Python implementation for those phases.
11
12 So, if py2.5,2.6,2.7 is enabled, EPYTHON == python2.7
13 in python_compile_all(), similarly PYTHON and PYTHONPATH.
14
15 However, the build directory for that implementation has been exported
16 as BEST_BUILD_DIR rather than BUILD_DIR, to avoid overriding user-set
17 BUILD_DIR. Sadly, this means that 'esetup.py' now fails (because of
18 wrong BUILD_DIR) when invoked in _all() phases.
19
20
21 I see two solutions here:
22
23 1) export 'best' implementation build-dir as BUILD_DIR
24
25 + works well in most cases,
26 + maybe a bit more predictable,
27 - no access to original BUILD_DIR setting,
28 - therefore: python_foreach_impl() called in _all() phase sets invalid
29 BUILD_DIRs.
30
31 2) make esetup.py prefer BEST_BUILD_DIR over BUILD_DIR
32
33 + works well in all current cases,
34 - hacky, surprising.
35
36
37 I think the main question here would be whether we:
38
39 a) really want to use python_foreach_impl() in _all() sub-phase rather
40 than putting the relevant code in per-impl sub-phase,
41
42 b) if we do, we need BUILD_DIR in the called function.
43
44 What do you think?
45
46 --
47 Best regards,
48 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature