1 |
Alike the PMS-defined phases, sub-phases do not support leaving jobs |
2 |
behind. To avoid leaving something accidentally, make sure to reap all |
3 |
jobs (i.e. wait) post running the command. Warn if any stray processes |
4 |
are found since that indicates a bug in ebuild. |
5 |
--- |
6 |
eclass/multibuild.eclass | 12 ++++++++++++ |
7 |
1 file changed, 12 insertions(+) |
8 |
|
9 |
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass |
10 |
index 0f89e4ec0b83..a29218d8d840 100644 |
11 |
--- a/eclass/multibuild.eclass |
12 |
+++ b/eclass/multibuild.eclass |
13 |
@@ -125,6 +125,18 @@ multibuild_foreach_variant() { |
14 |
_multibuild_run "${@}" \ |
15 |
> >(exec tee -a "${T}/build-${MULTIBUILD_ID}.log") 2>&1 |
16 |
lret=${?} |
17 |
+ |
18 |
+ # make sure no processes are left over |
19 |
+ local leftovers= |
20 |
+ while :; do |
21 |
+ wait -n |
22 |
+ [[ ${?} -eq 127 ]] && break || leftovers=1 |
23 |
+ done |
24 |
+ |
25 |
+ if [[ ${leftovers} ]]; then |
26 |
+ ewarn "The multibuild function has left one or more processes running" |
27 |
+ ewarn "in the background. Please report a bug." |
28 |
+ fi |
29 |
done |
30 |
[[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret} |
31 |
|
32 |
-- |
33 |
2.12.1 |