aboutsummaryrefslogtreecommitdiffstats
path: root/lib/_emerge/depgraph.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-02-12 20:04:34 -0800
committerZac Medico <zmedico@gentoo.org>2024-02-21 07:27:30 -0800
commitf9ea958018c02b3ce07761c2d965260498add2af (patch)
treef4baed4c49cf69d111949805e593a1e0e69f5163 /lib/_emerge/depgraph.py
parentEbuildMetadataPhase: Add deallocate_config future (diff)
downloadgentoo-portage-f9ea958018c02b3ce07761c2d965260498add2af.tar.xz
gentoo-portage-f9ea958018c02b3ce07761c2d965260498add2af.zip
MetadataRegen: Use EbuildMetadataPhase deallocate_config
For EbuildMetadataPhase consumers like MetadataRegen and depgraph, store a pool of config instances in a config_pool list, and return instaces to the list when the deallocate_config future is done. Bug: https://bugs.gentoo.org/924319 Fixes: c95fc64abf96 ("EbuildPhase: async_check_locale") Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 1674fa289ec4..70b83ee1f4b4 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -754,6 +754,7 @@ class depgraph:
def _dynamic_deps_preload(self, fake_vartree):
portdb = fake_vartree._portdb
+ config_pool = []
for pkg in fake_vartree.dbapi:
self._spinner_update()
self._dynamic_config._package_tracker.add_installed_pkg(pkg)
@@ -768,12 +769,22 @@ class depgraph:
if metadata is not None:
fake_vartree.dynamic_deps_preload(pkg, metadata)
else:
+ if config_pool:
+ settings = config_pool.pop()
+ else:
+ settings = portage.config(clone=portdb.settings)
+
+ deallocate_config = portdb._event_loop.create_future()
+ deallocate_config.add_done_callback(
+ lambda future: config_pool.append(future.result())
+ )
proc = EbuildMetadataPhase(
cpv=pkg.cpv,
ebuild_hash=ebuild_hash,
portdb=portdb,
repo_path=repo_path,
settings=portdb.doebuild_settings,
+ deallocate_config=deallocate_config,
)
proc.addExitListener(self._dynamic_deps_proc_exit(pkg, fake_vartree))
yield proc