Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: multilib@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 3/3] multibuild: remove parallel run support
Date: Thu, 11 Dec 2014 10:37:50
Message-Id: 1418294192-9639-4-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/3] Remove parallel run support from multilib & multibuild by "Michał Górny"
1 ---
2 eclass/multibuild.eclass | 48 +++---------------------------------------------
3 1 file changed, 3 insertions(+), 45 deletions(-)
4
5 diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
6 index 03e6280..bb17421 100644
7 --- a/eclass/multibuild.eclass
8 +++ b/eclass/multibuild.eclass
9 @@ -26,8 +26,6 @@ esac
10
11 if [[ ! ${_MULTIBUILD} ]]; then
12
13 -inherit multiprocessing
14 -
15 # @ECLASS-VARIABLE: MULTIBUILD_VARIANTS
16 # @DESCRIPTION:
17 # An array specifying all enabled variants which multibuild_foreach*
18 @@ -138,8 +136,8 @@ multibuild_foreach_variant() {
19 # @USAGE: [<argv>...]
20 # @DESCRIPTION:
21 # Run the passed command repeatedly for each of the enabled package
22 -# variants alike multibuild_foreach_variant. Multiple invocations of the command
23 -# will be performed in parallel, up to MULTIBUILD_JOBS tasks.
24 +# variants. This used to run the commands in parallel but now it's
25 +# just a deprecated alias to multibuild_foreach_variant.
26 #
27 # The function returns 0 if all commands return 0, or the first non-zero
28 # exit status otherwise. However, it performs all the invocations
29 @@ -148,31 +146,7 @@ multibuild_foreach_variant() {
30 multibuild_parallel_foreach_variant() {
31 debug-print-function ${FUNCNAME} "${@}"
32
33 - local ret lret
34 -
35 - _multibuild_parallel() {
36 - (
37 - multijob_child_init
38 - "${@}"
39 - ) &
40 - multijob_post_fork
41 - }
42 -
43 - local opts
44 - if [[ ${MULTIBUILD_JOBS} ]]; then
45 - opts=-j${MULTIBUILD_JOBS}
46 - else
47 - opts=${MAKEOPTS}
48 - fi
49 -
50 - multijob_init "${opts}"
51 - multibuild_foreach_variant _multibuild_parallel "${@}"
52 - ret=${?}
53 - multijob_finish
54 - lret=${?}
55 -
56 - [[ ${ret} -eq 0 ]] && ret=${lret}
57 - return ${ret}
58 + multibuild_foreach_variant "${@}"
59 }
60
61 # @FUNCTION: multibuild_for_best_variant
62 @@ -252,25 +226,12 @@ run_in_build_dir() {
63 # Merge the directory tree (fake root) from <src-root> to <dest-root>
64 # (the real root). Both directories have to be real, absolute paths
65 # (i.e. including ${D}). Source root will be removed.
66 -#
67 -# This functions uses locking to support merging during parallel
68 -# installs.
69 multibuild_merge_root() {
70 local src=${1}
71 local dest=${2}
72
73 - local lockfile=${T}/.multibuild_merge_lock
74 - local lockfile_l=${lockfile}.${BASHPID}
75 local ret
76
77 - # Lock the install tree for merge. The touch+ln method ensures race
78 - # condition-free locking with maximum portability.
79 - touch "${lockfile_l}" || die
80 - until ln "${lockfile_l}" "${lockfile}" &>/dev/null; do
81 - sleep 1
82 - done
83 - rm "${lockfile_l}" || die
84 -
85 if use userland_BSD; then
86 # Most of BSD variants fail to copy broken symlinks, #447370
87 # also, they do not support --version
88 @@ -297,9 +258,6 @@ multibuild_merge_root() {
89 ret=${?}
90 fi
91
92 - # Remove the lock.
93 - rm "${lockfile}" || die
94 -
95 if [[ ${ret} -ne 0 ]]; then
96 die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed."
97 fi
98 --
99 2.2.0