public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/
Date: Mon, 14 May 2012 20:20:00 +0000 (UTC)	[thread overview]
Message-ID: <1337021465.4941c3c674400116f118a9c75b520c3fd1a25490.vapier@gentoo> (raw)

commit:     4941c3c674400116f118a9c75b520c3fd1a25490
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 18:20:15 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon May 14 18:51:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4941c3c6

prepstrip: make splitdebug/installsources parallel safe

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 bin/ebuild-helpers/prepstrip |   44 +++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index 61249ac..a58a83b 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -62,22 +62,13 @@ prepstrip_sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}
 type -P debugedit >/dev/null && debugedit_found=true || debugedit_found=false
 debugedit_warned=false
 
-disable_parallel=false
-${FEATURES_splitdebug} && disable_parallel=true
-${FEATURES_installsources} && \
-	! ${RESTRICT_installsources} && \
-	${debugedit_found} && disable_parallel=true
-
-if ${disable_parallel} ; then
-	# Disable parallel processing, in order to prevent interference with
-	# temp files like debug.sources or prepstrip.split.debug
-	numjobs() {
-		echo 1
-	}
-fi
-
 multijob_init
 
+# Setup $T filesystem layout that we care about.
+tmpdir="${T}/prepstrip"
+rm -rf "${tmpdir}"
+mkdir -p "${tmpdir}"/{splitdebug,sources}
+
 unset ${!INODE_*}
 
 # Usage: inode_var_name: <file>
@@ -112,11 +103,11 @@ save_elf_sources() {
 	buildid=$(debugedit -i \
 		-b "${WORKDIR}" \
 		-d "${prepstrip_sources_dir}" \
-		-l "${T}"/debug.sources \
+		-l "${tmpdir}/sources/${x##*/}.${BASHPID}" \
 		"${x}")
 }
 
-# Usage: save_elf_debug <elf>
+# Usage: save_elf_debug <elf> [splitdebug file]
 save_elf_debug() {
 	${FEATURES_splitdebug} || return 0
 
@@ -125,6 +116,7 @@ save_elf_debug() {
 	# twice in this path) in order for gdb's debug-file-directory
 	# lookup to work correctly.
 	local x=$1
+	local splitdebug=$2
 	local y=${ED}usr/lib/debug/${x:${#D}}.debug
 
 	# dont save debug info twice
@@ -137,8 +129,8 @@ save_elf_debug() {
 		ln "${ED}usr/lib/debug/${!inode:${#D}}.debug" "${y}"
 	else
 		eval ${inode}=\${x}
-		if [[ -e ${T}/prepstrip.split.debug ]] ; then
-			mv "${T}"/prepstrip.split.debug "${y}"
+		if [[ -n ${splitdebug} ]] ; then
+			mv "${splitdebug}" "${y}"
 		else
 			local objcopy_flags="--only-keep-debug"
 			${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections"
@@ -175,11 +167,13 @@ process_elf() {
 	if ${strip_this} ; then
 		# see if we can split & strip at the same time
 		if [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
+			local shortname="${x##*/}.debug"
+			local splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID}"
 			${STRIP} ${strip_flags} \
-				-f "${T}"/prepstrip.split.debug \
-				-F "${x##*/}.debug" \
+				-f "${splitdebug}" \
+				-F "${shortname}" \
 				"${x}"
-			save_elf_debug "${x}"
+			save_elf_debug "${x}" "${splitdebug}"
 		else
 			save_elf_debug "${x}"
 			${STRIP} ${strip_flags} "${x}"
@@ -194,8 +188,8 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
 	# We need to do the non-stripped scan serially first before we turn around
 	# and start stripping the files ourselves.  The log parsing can be done in
 	# parallel though.
-	log=$T/scanelf-already-stripped.log
-	scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "$log"
+	log=${tmpdir}/scanelf-already-stripped.log
+	scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "${log}"
 	(
 	multijob_child_init
 	qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
@@ -286,9 +280,11 @@ do
 	multijob_post_fork
 done
 
-# Let jobs finish before processing ${T}/debug.sources
+# With a bit more work, we could run the rsync processes below in
+# parallel, but not sure that'd be an overall improvement.
 multijob_finish
 
+cat "${tmpdir}"/sources/* > "${tmpdir}/debug.sources" 2>/dev/null
 if [[ -s ${T}/debug.sources ]] && \
    ${FEATURES_installsources} && \
    ! ${RESTRICT_installsources} && \



             reply	other threads:[~2012-05-14 20:20 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 20:20 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-26 17:08 [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/ Ulrich Müller
2023-10-21 19:23 Ulrich Müller
2023-10-21 19:23 Ulrich Müller
2023-06-07  9:02 Ulrich Müller
2023-06-07  7:16 Ulrich Müller
2023-05-11 20:19 Sam James
2023-05-11 20:19 Sam James
2023-04-30 19:31 Ulrich Müller
2023-04-30 19:31 Ulrich Müller
2023-04-06  8:08 Ulrich Müller
2023-04-06  8:08 Ulrich Müller
2022-07-27 19:05 Fabian Groffen
2022-06-26 18:08 Mike Gilbert
2020-01-23  5:58 Zac Medico
2019-10-02 22:22 Ulrich Müller
2018-12-22  0:08 Zac Medico
2018-09-17 18:18 Michał Górny
2018-09-17  6:45 Michał Górny
2018-09-17  6:45 Michał Górny
2018-09-17  6:45 Michał Górny
2018-05-04 15:56 Zac Medico
2018-03-14 17:04 Michał Górny
2018-03-11 11:44 Michał Górny
2018-03-08 21:50 Michał Górny
2018-03-04  2:41 Zac Medico
2018-02-05  4:39 Zac Medico
2017-12-15 21:07 Zac Medico
2017-10-16 17:16 Zac Medico
2017-07-09 21:35 Michał Górny
2017-04-20 20:40 Michał Górny
2017-04-20 17:21 Ulrich Müller
2015-05-14 19:05 Brian Dolbec
2015-05-14  9:43 Mike Frysinger
2014-10-19 17:33 Zac Medico
2014-01-05 14:42 Mike Frysinger
2013-09-09 17:44 Zac Medico
2013-09-09 17:11 Zac Medico
2013-08-21 19:21 Zac Medico
2013-08-02 17:42 Zac Medico
2013-05-21 21:37 Zac Medico
2013-05-12 20:52 Zac Medico
2013-04-01  7:22 Zac Medico
2013-03-20 19:16 Mike Frysinger
2013-03-20  8:33 Mike Frysinger
2013-03-14  3:30 Zac Medico
2013-03-14  3:30 Zac Medico
2013-03-14  3:30 Zac Medico
2013-02-15 23:40 Zac Medico
2012-12-11  9:00 Zac Medico
2012-12-10 22:05 Zac Medico
2012-12-01 21:41 Zac Medico
2012-12-01 21:19 Zac Medico
2012-12-01 21:19 Zac Medico
2012-12-01  3:37 Zac Medico
2012-11-06  8:28 Zac Medico
2012-11-06  6:14 Zac Medico
2012-11-06  5:42 Zac Medico
2012-11-05  2:51 Zac Medico
2012-09-27  2:05 Zac Medico
2012-09-26 21:43 Zac Medico
2012-09-17  1:27 Zac Medico
2012-09-01 22:51 Zac Medico
2012-08-31 15:21 Ulrich Mueller
2012-08-25 21:13 Ulrich Mueller
2012-08-25 20:01 Zac Medico
2012-08-25 19:46 Zac Medico
2012-08-25 19:46 Zac Medico
2012-08-23 22:29 Zac Medico
2012-08-11 19:11 Zac Medico
2012-07-15 21:29 Zac Medico
2012-06-02  4:06 Zac Medico
2012-06-02  2:45 Zac Medico
2012-06-02  2:37 Zac Medico
2012-06-02  2:28 Zac Medico
2012-05-14 22:56 Zac Medico
2012-05-14 22:38 Zac Medico
2012-05-14 22:03 Zac Medico
2012-05-14 21:11 Zac Medico
2012-05-14 20:53 Zac Medico
2012-05-14 20:13 Zac Medico
2012-05-14 18:51 Mike Frysinger
2012-05-14 18:51 Mike Frysinger
2012-05-14  8:42 Zac Medico
2012-05-14  8:29 Zac Medico
2012-03-29 22:26 Zac Medico
2012-03-29 22:12 Zac Medico
2012-03-29 22:03 Zac Medico
2012-02-22 20:51 Zac Medico
2012-01-21 21:33 Zac Medico
2012-01-14 21:37 Mike Frysinger
2011-12-22 22:17 Zac Medico
2011-12-21 19:30 Zac Medico
2011-12-20  0:00 Zac Medico
2011-11-08 19:25 Zac Medico
2011-11-07  8:14 Zac Medico
2011-10-11 17:29 Mike Frysinger
2011-10-11 14:24 Mike Frysinger
2011-10-11 14:24 Mike Frysinger
2011-10-11  2:28 Mike Frysinger
2011-10-10  6:27 Zac Medico
2011-10-10  6:04 Zac Medico
2011-10-10  2:29 Mike Frysinger
2011-10-10  2:29 Mike Frysinger
2011-10-10  2:29 Mike Frysinger
2011-08-22 17:35 Zac Medico
2011-08-22 16:06 Zac Medico
2011-06-30  8:18 Zac Medico
2011-06-30  8:07 Zac Medico
2011-05-04 16:41 Zac Medico
2011-04-11 23:29 Zac Medico
2011-03-02  4:53 Zac Medico
2011-02-25 20:33 Zac Medico
2011-02-25 20:11 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337021465.4941c3c674400116f118a9c75b520c3fd1a25490.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox