Gentoo Archives: gentoo-python

From: Rafael Goncalves Martins <rafaelmartins@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: Mike Gilbert <floppym@g.o>, gentoo-python <gentoo-python@l.g.o>
Subject: Re: [gentoo-python] Re: [PATCH] Support overriding job-count for distutils-r1 multiprocessing.
Date: Tue, 01 Jan 2013 20:15:52
Message-Id: CAHgY3qft2eXhjYLPNYCfDMUb25FfN7wvqEupo9-T6Si1zAGObQ@mail.gmail.com
In Reply to: Re: [gentoo-python] Re: [PATCH] Support overriding job-count for distutils-r1 multiprocessing. by "Michał Górny"
1 On Tue, Jan 1, 2013 at 5:55 PM, Michał Górny <mgorny@g.o> wrote:
2 > On Tue, 1 Jan 2013 14:15:35 -0500
3 > Mike Gilbert <floppym@g.o> wrote:
4 >
5 >> On Tue, Jan 1, 2013 at 11:57 AM, Michał Górny <mgorny@g.o> wrote:
6 >> > ---
7 >> > gx86/eclass/distutils-r1.eclass | 44 ++++++++++++++++++++++++++++-------------
8 >> > 1 file changed, 30 insertions(+), 14 deletions(-)
9 >> >
10 >> > diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
11 >> > index e288c2c..3312505 100644
12 >> > --- a/gx86/eclass/distutils-r1.eclass
13 >> > +++ b/gx86/eclass/distutils-r1.eclass
14 >> > @@ -68,6 +68,14 @@ if [[ ! ${_DISTUTILS_R1} ]]; then
15 >> > RDEPEND=${PYTHON_DEPS}
16 >> > DEPEND=${PYTHON_DEPS}
17 >> >
18 >> > +# @ECLASS-VARIABLE: DISTUTILS_JOBS
19 >> > +# @DEFAULT_UNSET
20 >> > +# @DECRIPTION:
21 >> > +# The number of parallel jobs to run for distutils-r1 parallel builds.
22 >> > +# If unset, the job-count in ${MAKEOPTS} will be used.
23 >> > +#
24 >> > +# This variable is intended to be set in make.conf.
25 >> > +
26 >> > # @ECLASS-VARIABLE: PATCHES
27 >> > # @DEFAULT_UNSET
28 >> > # @DESCRIPTION:
29 >> > @@ -144,15 +152,6 @@ DEPEND=${PYTHON_DEPS}
30 >> > # This variable can be used to disable the afore-mentioned feature
31 >> > # in case it causes issues with the package.
32 >> >
33 >> > -#
34 >> > -# If in-source builds are used, the eclass will create a copy of package
35 >> > -# sources for each Python implementation in python_prepare_all(),
36 >> > -# and work on that copy afterwards.
37 >> > -#
38 >> > -# If out-of-source builds are used, the eclass will instead work
39 >> > -# on the sources directly, prepending setup.py arguments with
40 >> > -# 'build --build-base ${BUILD_DIR}' to enforce keeping & using built
41 >> > -# files in the specific root.
42 >> > # @ECLASS-VARIABLE: mydistutilsargs
43 >> > # @DEFAULT_UNSET
44 >> > # @DESCRIPTION:
45 >> > @@ -425,6 +424,23 @@ _distutils-r1_run_common_phase() {
46 >> > "${@}"
47 >> > }
48 >> >
49 >> > +# @FUNCTION: _distutils-r1_multijob_init
50 >> > +# @INTERNAL
51 >> > +# @DESCRIPTION:
52 >> > +# Init multijob, taking the job-count from ${DISTUTILS_JOBS}.
53 >> > +_distutils-r1_multijob_init() {
54 >> > + debug-print-function ${FUNCNAME} "${@}"
55 >> > +
56 >> > + local opts
57 >> > + if [[ ${DISTUTILS_JOBS} ]]; then
58 >> > + opts=-j${DISTUTILS_JOBS}
59 >> > + else
60 >> > + opts=${MAKEOPTS}
61
62 I don't know the eclass enough and the question may look silly for you
63 guys, but what happens if people adds other make options to MAKEOPTS
64 instead of just -jX ?
65
66 >> > + fi
67 >> > +
68 >> > + multijob_init "${opts}"
69 >> > +}
70 >> > +
71 >> > distutils-r1_src_prepare() {
72 >> > debug-print-function ${FUNCNAME} "${@}"
73 >> >
74 >> > @@ -435,7 +451,7 @@ distutils-r1_src_prepare() {
75 >> > distutils-r1_python_prepare_all
76 >> > fi
77 >> >
78 >> > - multijob_init
79 >> > + _distutils-r1_multijob_init
80 >> > if declare -f python_prepare >/dev/null; then
81 >> > python_foreach_impl distutils-r1_run_phase python_prepare
82 >> > else
83 >> > @@ -445,7 +461,7 @@ distutils-r1_src_prepare() {
84 >> > }
85 >> >
86 >> > distutils-r1_src_configure() {
87 >> > - multijob_init
88 >> > + _distutils-r1_multijob_init
89 >> > if declare -f python_configure >/dev/null; then
90 >> > python_foreach_impl distutils-r1_run_phase python_configure
91 >> > else
92 >> > @@ -461,7 +477,7 @@ distutils-r1_src_configure() {
93 >> > distutils-r1_src_compile() {
94 >> > debug-print-function ${FUNCNAME} "${@}"
95 >> >
96 >> > - multijob_init
97 >> > + _distutils-r1_multijob_init
98 >> > if declare -f python_compile >/dev/null; then
99 >> > python_foreach_impl distutils-r1_run_phase python_compile
100 >> > else
101 >> > @@ -477,7 +493,7 @@ distutils-r1_src_compile() {
102 >> > distutils-r1_src_test() {
103 >> > debug-print-function ${FUNCNAME} "${@}"
104 >> >
105 >> > - multijob_init
106 >> > + _distutils-r1_multijob_init
107 >> > if declare -f python_test >/dev/null; then
108 >> > python_foreach_impl distutils-r1_run_phase python_test
109 >> > else
110 >> > @@ -493,7 +509,7 @@ distutils-r1_src_test() {
111 >> > distutils-r1_src_install() {
112 >> > debug-print-function ${FUNCNAME} "${@}"
113 >> >
114 >> > - multijob_init
115 >> > + _distutils-r1_multijob_init
116 >> > if declare -f python_install >/dev/null; then
117 >> > python_foreach_impl distutils-r1_run_phase python_install
118 >> > else
119 >> > --
120 >> > 1.8.0.2
121 >> >
122 >>
123 >> Seems ok. Was this requested by someone?
124 >
125 > By me ;).
126 >
127 > I have MAKEOPTS=-j6 because of distcc, and it kills my system with
128 > nose's tests.
129 >
130 > --
131 > Best regards,
132 > Michał Górny
133
134
135
136 --
137 Rafael Goncalves Martins
138 Gentoo Linux developer
139 http://rafaelmartins.eng.br/

Replies