Repository navigation
feat(xvm): let self doctor --fix take down an incoherent release - #396
Merged
Merged
Conversation
doctor could name an active release whose members disagree, but not do anything about it. Naming a problem the tool refuses to touch is only half an exit. --fix now deactivates such a release: every member of it leaves the active workspace, and the user re-selects with one `xlings use`. Deactivating rather than repairing is the point. Repair would mean deciding which member was right, and there is no basis for that choice -- the user may have meant either release, and picking one silently is exactly how the state went wrong in the first place. An inactive toolchain is a visible problem; an incoherent one reports the right version from `gcc --version` and fails at link time. The whole release comes down, not just the members that disagree. Leaving the agreeing ones active would swap one incoherent state for another. Scope is deliberately narrow. Unresolvable and corrupt entries are still reported and left alone: repairing those means dropping stored metadata, which needs explicit consent rather than a flag the user passed to fix their shims. Ungrouped packages are never touched. The repair takes the state lock and reloads before writing, like any other mutating path. Tests cover the whole-release takedown, a coherent workspace being left alone, an unresolvable release being left alone, and an unrelated single package not becoming collateral damage.
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.
Problem
#394 让 doctor 能说出哪个 release 的成员互相矛盾,但不能对它做任何事。指出一个自己拒绝处理的问题,只是半个出口。
Change
--fix现在会停用这样的 release:它的每个成员都退出 active workspace,用户用一条xlings use重新选择。为什么是停用而不是修复
修复意味着要判定哪个成员是"对的",而没有依据做这个判断 —— 用户可能想要任一 release,而静默挑一个正是这个状态最初出错的方式。
整组下线
不只是那些"不一致"的成员 —— 把一致的那些留在 active 只是把一种不一致换成另一种。
范围刻意收窄
无法解析的、以及元数据损坏的条目,仍然只报告不触碰。修复它们意味着丢弃已存储的元数据,那需要用户的明确同意,而不是一个他为了修 shim 而传的 flag。未分组的包永不波及。
修复路径与其它变更路径一样:取状态锁、重载、再写。
Tests
DeactivationTakesDownEveryMemberOfAnIncoherentReleaseDeactivationLeavesACoherentWorkspaceAloneDeactivationIgnoresUnresolvableReleasesDeactivationLeavesUngroupedTargetsAlone剩余部分
元数据损坏条目的修复(
--reset-metadata)仍未做,原因见 #394:需要先为未解析的记录保留原始 JSON,否则保存本身就会丢信息。那是独立的一次改动。Verification
CI 状态为已知上游拉取签名(见 #386),依计划 §3.1.1 合入集成分支。