fix(lazy_deps): only treat primary spec as activation trigger - #58488
Closed
Ahmett101 wants to merge 1 commit into
Closed
fix(lazy_deps): only treat primary spec as activation trigger#58488Ahmett101 wants to merge 1 commit into
Ahmett101 wants to merge 1 commit into
Conversation
Collaborator
Duplicate of #54178 — both rewrite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/lazy_deps.py::active_features()dispatched onany(_is_present(s) for s in specs). Several messaging backends (platform.matrix,platform.slack,platform.discord,platform.teams,homeassistant,sms) share a CVE-floor pinaiohttp==3.14.1as a secondary entry —aiohttpships as a transitive of common core deps (edge-tts,firecrawl-py,discord.py), so on a stock Windows install every one of those backends flipped to active without the user opting in.hermes updatethen proceeded to install their full stacks — includingmautrix[encryption]whosepython-olmbuild shells out tomake(not present on stock Windows), surfacing as a perpetual refresh failure.Switch
active_features()to primary-spec dispatch: only the first spec — the feature's distinctive SDK (mautrix[encryption],discord.py[voice],slack-bolt,anthropic,boto3,mistralai, …) — drives activation. Subsequent entries are supporting pins for the actualpip installrefresher and remain inLAZY_DEPSso refresh still picks them up when the primary is correctly activated.Changes
tools/lazy_deps.py—active_features()rewritten to checkspecs[0]only. Docstring explains the supporting-pins/primary distinction with reference to lazy_deps: shared aiohttp pin marks never-enabled backends active; matrix refresh then fails on Windows (python-olm needs make) #58458.tests/tools/test_lazy_deps.py— two regression tests:test_supporting_pin_does_not_activate_feature— a simulatedaiohttp-only install must NOT registerplatform.matrix/platform.slack/platform.discord/platform.teams/homeassistant/smsas active.test_primary_spec_alone_activates— installingmautrixalone IS enough to registerplatform.matrix.How to Test
Pinned by stash: with
tools/lazy_deps.pyreverted, the two new regression tests fail exactly the way the issue report described —platform.matrix(and the other aiohttp-pinned features) appear inactive_features()even though the user never opted in.Checklist
tools/lazy_deps.py); the bug manifests on Windows but the fix doesn't touch platform-specific code.envnot used for non-credential settings (no config surface touched)Risk & Impact
Low. The semantic change is strictly more conservative: a feature that was previously activated by its supporting pins stays inactive until its primary SDK is genuinely present. Side-effects:
uv pip install mautrix==0.21.0 aiosqlite==0.22.1 …) still keepplatform.matrixactive — primary is satisfied, so refresh continues to bump pins.aiohttponly as a transitive now stop paying the Discord/Slack/Matrix/etc. refresh on everyhermes update. If they ever do opt in later (e.g.hermes setupenables Matrix),mautrixbecomes satisfied and refresh resumes normally.install_all_in_onepath and individualensure()calls are unaffected — they still install all listed specs fromLAZY_DEPS, not justspecs[0].Type: Bug fix
Closes: #58458