From: Fabian Groffen Date: Fri, 30 Jan 2009 21:29:57 +0000 (-0000) Subject: Merged from trunk -r12556:12560 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=5e015d23e90f01a0502d71468c9f9ae9d852e5f8;p=portage.git Merged from trunk -r12556:12560 | 12557 | When scheduling builds in parallel for --jobs, avoid | | zmedico | potential build dir collisions in cases when the same exact | | | cpv needs to be merged to multiple $ROOTs (like when | | | building stages). Thanks for Daniel Robbins for reporting | | | this issue and troubleshooting it. | | 12558 | In EbuildFetcher._start(), don't touch the build dir when in | | zmedico | prefetch mode. In this case, logging goes to | | | emerge-fetch.log and the builddir should not be touched | | | since otherwise it could interfere with another instance of | | | the same cpv concurrently being built for a different $ROOT | | | (currently, builds only cooperate with prefetchers that are | | | spawned for the same $ROOT). Thanks to Daniel Robbins for | | | reporting this issue. | | 12559 | - hardened gets way to many misfiled bugs related to | | solar | qa-execstack. Make it clear that bugs go to the maintainers | | | of the pkg and not hardened for fun and profit | | 12560 | Fix color in merge list [ebuild ] display, so it's the same | | zmedico | regardless of $ROOT. | svn path=/main/branches/prefix/; revision=12564 --- diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index d5d71a873..52594be6b 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -152,6 +152,8 @@ install_qa_check() { eqawarn " at http://bugs.gentoo.org/ to make sure the file is fixed." eqawarn " For more information, see http://hardened.gentoo.org/gnu-stack.xml" eqawarn " Please include the following list of files in your report:" + eqawarn " Note: Bugs should be filed for the respective maintainers" + eqawarn " of the package in question and not hardened@" eqawarn "${f}" vecho -ne '\a\n' die_msg="${die_msg} execstacks" diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 8f10cd3ce..398fcf776 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2367,12 +2367,20 @@ class EbuildFetcher(SpawnProcess): portdb = root_config.trees["porttree"].dbapi ebuild_path = portdb.findname(self.pkg.cpv) settings = self.config_pool.allocate() - self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings) - self._build_dir.lock() - self._build_dir.clean() - portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0) - if self.logfile is None: - self.logfile = settings.get("PORTAGE_LOG_FILE") + settings.setcpv(self.pkg) + + # In prefetch mode, logging goes to emerge-fetch.log and the builddir + # should not be touched since otherwise it could interfere with + # another instance of the same cpv concurrently being built for a + # different $ROOT (currently, builds only cooperate with prefetchers + # that are spawned for the same $ROOT). + if not self.prefetch: + self._build_dir = EbuildBuildDir(pkg=self.pkg, settings=settings) + self._build_dir.lock() + self._build_dir.clean() + portage.prepare_build_dirs(self.pkg.root, self._build_dir.settings, 0) + if self.logfile is None: + self.logfile = settings.get("PORTAGE_LOG_FILE") phase = "fetch" if self.fetchall: @@ -8132,7 +8140,7 @@ class depgraph(object): if not pkg_merge: myprint = "[%s] " % pkgprint(pkg_status.ljust(13)) else: - myprint = "[" + pkg_type + " " + addl + "] " + myprint = "[%s %s] " % (pkgprint(pkg_type), addl) myprint += indent + pkgprint(pkg_key) + " " + \ myoldbest + darkgreen("to " + myroot) else: @@ -9978,6 +9986,7 @@ class Scheduler(PollScheduler): self._digraph = digraph self._prune_digraph() + self._prevent_builddir_collisions() def _prune_digraph(self): """ @@ -10000,6 +10009,26 @@ class Scheduler(PollScheduler): break removed_nodes.clear() + def _prevent_builddir_collisions(self): + """ + When building stages, sometimes the same exact cpv needs to be merged + to both $ROOTs. Add edges to the digraph in order to avoid collisions + in the builddir. Currently, normal file locks would be inappropriate + for this purpose since emerge holds all of it's build dir locks from + the main process. + """ + cpv_map = {} + for pkg in self._mergelist: + if pkg.installed: + continue + if pkg.cpv not in cpv_map: + cpv_map[pkg.cpv] = [pkg] + continue + for earlier_pkg in cpv_map[pkg.cpv]: + self._digraph.add(earlier_pkg, pkg, + priority=DepPriority(buildtime=True)) + cpv_map[pkg.cpv].append(pkg) + class _pkg_failure(portage.exception.PortageException): """ An instance of this class is raised by unmerge() when