From 2406cf918e57775bf42f4b977512957dc33729ce Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 8 Jul 2026 20:17:00 +0200 Subject: [PATCH] conda resolver: gate lazy availability probe on auto_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CondaDependencyResolver.__init__ calls ensure_installed(), which shells out to 'conda info --json' — spawning the conda binary (~1-2s) — to set self.disabled. Two independent reductions: 1. Gate the probe on auto_init. With auto_init set, the resolver is expected to initialize conda at startup, so it still probes (and installs, if needed) eagerly in __init__ — behaviour unchanged. With auto_init off, nothing on the boot or job dependency-resolution path reads disabled (only the dependency-resolvers admin view), so disabled becomes a cached property probed lazily on first access. 2. Memoize CondaContext.conda_info(). It is queried several times over a context's life (availability probe, conda version, conda-build availability), each spawning conda. Cache the result and clear it in _reset_conda_properties() (already called after installs) so a re-probe reflects the new state. This also helps the auto_init/eager path. An earlier revision deferred the probe unconditionally; because the boot and job resolution paths never read disabled, conda was never bootstrapped, breaking dependency resolution for conda-package tools. --- lib/galaxy/tools/lazy_toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tools/lazy_toolbox.py b/lib/galaxy/tools/lazy_toolbox.py index 890ecd2c980..0e0e73714b0 100644 --- a/lib/galaxy/tools/lazy_toolbox.py +++ b/lib/galaxy/tools/lazy_toolbox.py @@ -6,9 +6,9 @@ lightweight index in memory and loads full Tool objects on-demand with LRU eviction. """ +import errno import logging import os -import errno import threading from typing import ( Any,