|
Lines 45-52
Link Here
|
| 45 |
# for more information. |
45 |
# for more information. |
| 46 |
# |
46 |
# |
| 47 |
# Another snag you may encounter is that, in many circumstances, it is possible |
47 |
# Another snag you may encounter is that, in many circumstances, it is possible |
| 48 |
# for variables to flow between multilib_<phase> functions. This is because |
48 |
# for variables to flow between multilib_<phase> functions. This is because, |
| 49 |
# no subshell is utilized. |
49 |
# unless you parallelize the phase in question, no subshell is utilized. |
| 50 |
# Extreme care must sometimes be taken to ensure that different ABI's don't |
50 |
# Extreme care must sometimes be taken to ensure that different ABI's don't |
| 51 |
# trample each other's variables. |
51 |
# trample each other's variables. |
| 52 |
# |
52 |
# |
|
Lines 122-127
case ${EAPI:-0} in
Link Here
|
| 122 |
*) die "EAPI=${EAPI} is not supported" ;; |
122 |
*) die "EAPI=${EAPI} is not supported" ;; |
| 123 |
esac |
123 |
esac |
| 124 |
|
124 |
|
|
|
125 |
# @ECLASS-VARIABLE: MULTILIB_PARALLEL_PHASES |
| 126 |
# @DEFAULT-UNSET |
| 127 |
# @DESCRIPTION: |
| 128 |
# multilib-minimal.eclass consumers may set this to a string containing |
| 129 |
# a space-separated list of phase-function names, like so: |
| 130 |
# |
| 131 |
# @CODE@ |
| 132 |
# MULTILIB_PARALLEL_PHASES="src_configure src_test" |
| 133 |
# @CODE@ |
| 134 |
# |
| 135 |
# For each (supported) phase-function name in the list, the corresponding |
| 136 |
# multilib-minimal_<phase> phase function will execute in parallel, in |
| 137 |
# the sense that, within limits (set by multiprocessing.eclass) the |
| 138 |
# multilib_<phase> function invocations (or, if none is present, the |
| 139 |
# built-in default implementation) for each ABI will run simultaneously. |
| 140 |
# |
| 141 |
# Any phase-function-names not specified are executed serially, with the |
| 142 |
# native ABI coming last. |
| 143 |
# |
| 144 |
# It is OK to add extra "bonus" whitespace or duplicated values. |
| 145 |
# Changes take effect immediately, so it may be set before or after |
| 146 |
# inheriting multilib-minimal, or even during execution of a phase function |
| 147 |
# (but not in parallelized multilib_<phase> functions; see below). |
| 148 |
# |
| 149 |
# By default, MULTILIB_PARALLEL_PHASES is empty. Consuming eclasses could |
| 150 |
# override this default by setting a new default before the inherits clause. |
| 151 |
# For example, |
| 152 |
# |
| 153 |
# @CODE |
| 154 |
# : {MULTILIB_PARALLEL_PHASES:="src_configure"} |
| 155 |
# inherit multilib-minimal |
| 156 |
# @CODE |
| 157 |
# |
| 158 |
# would create a default behavior of parallel src_configure. The question |
| 159 |
# of whether, in practice, eclasses ever should do so is potentially |
| 160 |
# complicated; you'll have to figure that out for yourself. |
| 161 |
# |
| 162 |
# Supported phase-function-names are: src_configure, src_compile, and src_test. |
| 163 |
# All other values are silently ignored. |
| 164 |
# |
| 165 |
# Note that parallel execution can lead to ugly -- and sometimes very, very ugly -- |
| 166 |
# console output at build-time. Consumers of multilib-minimal.eclass |
| 167 |
# may wish to consider activating less verbose build-time output modes, if they are |
| 168 |
# readily available, to mitigate this effect, although doing so goes against a |
| 169 |
# long-standing Gentoo tradition and might make debugging a hassle for bugzilla |
| 170 |
# and IRC participants, so use your best judgement. |
| 171 |
# |
| 172 |
# A handy per-ABI log is kept in ${T}/build-${ABI}.log by multibuild.eclass. |
| 173 |
# Debugging and bug-reporting may also benefit (unless your bug specifically |
| 174 |
# pertains to parallelization) from setting MAKEOPTS=-j1, which will prevent |
| 175 |
# parallelization entirely. |
| 176 |
|
| 125 |
# @ECLASS-VARIABLE: MULTILIB_INSECURE_INSTALL |
177 |
# @ECLASS-VARIABLE: MULTILIB_INSECURE_INSTALL |
| 126 |
# @DEFAULT-UNSET |
178 |
# @DEFAULT-UNSET |
| 127 |
# @DESCRIPTION: |
179 |
# @DESCRIPTION: |
|
Lines 161-167
multilib-minimal_src_configure() {
Link Here
|
| 161 |
if declare -f multilib_src_configure_all > /dev/null ; then |
213 |
if declare -f multilib_src_configure_all > /dev/null ; then |
| 162 |
multilib_src_configure_all |
214 |
multilib_src_configure_all |
| 163 |
fi |
215 |
fi |
| 164 |
multilib_foreach_abi multilib-minimal_abi_src_configure |
216 |
|
|
|
217 |
if has src_configure ${MULTILIB_PARALLEL_PHASES} ; then |
| 218 |
multilib_parallel_foreach_abi multilib-minimal_abi_src_configure |
| 219 |
else |
| 220 |
multilib_foreach_abi multilib-minimal_abi_src_configure |
| 221 |
fi |
| 165 |
} |
222 |
} |
| 166 |
|
223 |
|
| 167 |
multilib-minimal_src_compile() { |
224 |
multilib-minimal_src_compile() { |
|
Lines 179-185
multilib-minimal_src_compile() {
Link Here
|
| 179 |
popd >/dev/null || die |
236 |
popd >/dev/null || die |
| 180 |
} |
237 |
} |
| 181 |
|
238 |
|
| 182 |
multilib_foreach_abi multilib-minimal_abi_src_compile |
239 |
if has src_compile ${MULTILIB_PARALLEL_PHASES} ; then |
|
|
240 |
multilib_parallel_foreach_abi multilib-minimal_abi_src_compile |
| 241 |
else |
| 242 |
multilib_foreach_abi multilib-minimal_abi_src_compile |
| 243 |
fi |
| 244 |
|
| 183 |
if declare -f multilib_src_compile_all > /dev/null ; then |
245 |
if declare -f multilib_src_compile_all > /dev/null ; then |
| 184 |
multilib_src_compile_all |
246 |
multilib_src_compile_all |
| 185 |
fi |
247 |
fi |
|
Lines 200-206
multilib-minimal_src_test() {
Link Here
|
| 200 |
popd >/dev/null || die |
262 |
popd >/dev/null || die |
| 201 |
} |
263 |
} |
| 202 |
|
264 |
|
| 203 |
multilib_foreach_abi multilib-minimal_abi_src_test |
265 |
if has src_test ${MULTILIB_PARALLEL_PHASES} ; then |
|
|
266 |
multilib_parallel_foreach_abi multilib-minimal_abi_src_test |
| 267 |
else |
| 268 |
multilib_foreach_abi multilib-minimal_abi_src_test |
| 269 |
fi |
| 270 |
|
| 204 |
if declare -f multilib_src_test_all >/dev/null ; then |
271 |
if declare -f multilib_src_test_all >/dev/null ; then |
| 205 |
multilib_src_test_all |
272 |
multilib_src_test_all |
| 206 |
fi |
273 |
fi |