Repository navigation
feat(wpm): expose/unexpose subcommands for bin/ entry links — A-side split of #1844 - #2012
Merged
Merged
Conversation
Member
Author
CAPTAIN 复核——合入代码面全绿。 CI(run 46570304996):27 个 job 通过,含 build-windows 四条腿全绿——wpm 单元测试(含本 PR 新增 7 钉:随包无 receipt 暴露/收回、幂等、--force、别名、unexpose 守卫两支)在 MSVC 下编译并通过。 唯一红 = rust2-gate 聚合步,与本 PR 无关: unexpose 守卫按 r1 复核的队长裁决实现并已钉:payload 可解析时只认文件身份,receipt 记录仅作 payload 缺失时兜底;同名异物跳过并报告( 结论:squash 合入。#1835 由队长在合入后手动关闭(本 PR 为 Refs)。 |
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.
wpm expose/unexpose for already-installed packages (Refs #1835)
The A-side split of #1844, relayed by the captain per the owner's
2026-12-01 direction. #1844 carried two features in one PR; this PR
lands only the #1835 feature and leaves the declared-links subsystem
in #1844, re-scoped (see below).
What this does
wpm expose <package>...materializes an installed package's declaredcommands as entry links in
<root>/bin- the samehardlink-or-copy materialization install uses, idempotent like
links rebuild. Works for bundled packages that ship a payload butno
.wpmreceipt (the niugit shape, niubash#1052): installation isproven by the payload destinations on disk.
wpm unexpose <package>...revokes those entry links withoutuninstalling; the payload, the
usr/binshims and the rest of.wpmstay, so the package remains installed.
destinationsare kept in sync (sync_receipt_entry_links):materialized links are recorded, revoked links are dropped, or the
receipt-records check would read a revoked package as uninstalled.
--force,--dry-runand
--jsonare supported throughout.Unexpose ownership guard (captain ruling on the #1844 review)
unexposedeletes a bin name only when it is verifiably this package'sentry link: file identity with the payload
package_entry_linksresolves for the command (
same_file/files_equal; forwarder-routedcommands resolve to the shim source), or - when the payload itself is
gone and identity cannot be checked - the install receipt recording
the path as a destination. A same-named foreign file is skipped and
reported (warning on stderr;
"status": "skipped_not_package_link"per command under
--json), never deleted. Receipt sync drops onlythe records of links actually removed (or already gone).
Tests
The end-to-end test from #1844, plus six pins for the review's A-side
gaps: bundled no-receipt expose/unexpose, idempotency,
--forceoverwrite of a foreign target, alias expose, the unexpose ownership
guard (foreign file survives, reported skipped), and the
receipt-proved revocation when the payload is missing.
Deletions
None against main (+923/-0). Nothing is superseded in-tree: the
declared-links (links.json) subsystem is not deleted - it was never
in main; it remains in #1844 only.
Out of scope
The declared intra-package links subsystem from #1844
(
links.jsonreconcile, the receiptlinksfield, install/uninstall/rebuild declared-set handling, the hardlink-fallback warning) stays
with #1844, to be re-reviewed there with its own pins.
UNVERIFIED-BY-CAPTAIN - relayed code-only; MSVC build and test verdicts
are this PR's CI.