Problem
PR #1289 introduced AgeFallback.NEWEST for multi-version mode, which always returns at least one candidate. This made the cache-server fallback in BootstrapRequirementResolver._resolve_and_extend() unreachable dead code.
The dead fallback creates a misleading picture — it looks like multi-version resolution has a three-layer fallback chain when it actually has one.
Why it's dead code
AgeFallback.NEWEST takes candidates_list[0], and candidates_list is always non-empty because BaseProvider.find_matches() raises on empty. So find_all_matching_from_provider() never returns [] in multi-version mode, and this block never executes:
if not results and self.multiple_versions and self.cache_wheel_server_url:
results = self._resolve_from_cache_server(req)
Before #1289, multi-version mode used the equivalent of AgeFallback.NONE (returned [] when all candidates were too old), so the cache fallback was reachable. NEWEST replaced that role.
What to remove
src/fromager/bootstrap_requirement_resolver.py
cache_wheel_server_url parameter and attribute from __init__
- The dead fallback block in
_resolve_and_extend()
- The entire
_resolve_from_cache_server() method
- The
finders import (only used by that method)
- Simplify the warning log to drop the
cache_wheel_server_url reference
src/fromager/bootstrapper/_bootstrapper.py
- Remove
cache_wheel_server_url=... from the BootstrapRequirementResolver() call
tests/test_bootstrap_requirement_resolver.py
What to leave alone
Bootstrapper.cache_wheel_server_url — still used by _cache.py, _prepare_source.py, _resolve.py
- Error handling in
_handle_phase_error — inherent to multi-version mode
AgeFallback enum and find_all_matching_from_provider — no changes needed
Follows up on #1289.
Problem
PR #1289 introduced
AgeFallback.NEWESTfor multi-version mode, which always returns at least one candidate. This made the cache-server fallback inBootstrapRequirementResolver._resolve_and_extend()unreachable dead code.The dead fallback creates a misleading picture — it looks like multi-version resolution has a three-layer fallback chain when it actually has one.
Why it's dead code
AgeFallback.NEWESTtakescandidates_list[0], andcandidates_listis always non-empty becauseBaseProvider.find_matches()raises on empty. Sofind_all_matching_from_provider()never returns[]in multi-version mode, and this block never executes:Before #1289, multi-version mode used the equivalent of
AgeFallback.NONE(returned[]when all candidates were too old), so the cache fallback was reachable.NEWESTreplaced that role.What to remove
src/fromager/bootstrap_requirement_resolver.pycache_wheel_server_urlparameter and attribute from__init___resolve_and_extend()_resolve_from_cache_server()methodfindersimport (only used by that method)cache_wheel_server_urlreferencesrc/fromager/bootstrapper/_bootstrapper.pycache_wheel_server_url=...from theBootstrapRequirementResolver()calltests/test_bootstrap_requirement_resolver.pyTestResolveFromCacheServerage_fallbacktests added by Fix: Multi version bootstrap age filter fallback for edge cases #1289What to leave alone
Bootstrapper.cache_wheel_server_url— still used by_cache.py,_prepare_source.py,_resolve.py_handle_phase_error— inherent to multi-version modeAgeFallbackenum andfind_all_matching_from_provider— no changes neededFollows up on #1289.