Repository navigation
feat(wpm): bundle packages via installs: [...] index field (+3 latent include fixes) - #1529
Conversation
A full rebuild on the current toolchain exposes three TUs that only compiled while stale objects from an older STL sat in the build directory: cpio.cpp and logger.cpp call localtime_s/strftime and terminfo_table.h names std::string_view without including <ctime>/<string_view>. date.cpp already carries the same explicit include with the identical rationale.
A bundle is an index entry with no artifacts that names a group of
packages: {"name":"build-base","kind":"bundle","installs":["mingw",
"cmake",...]}. Expansion happens once in install_packages: bundle
names never reach install_package, members recurse with a visiting
chain so bundles cannot loop (depth-capped, chain printed like alias
cycles), and the result dedupes order-preserving so a member listed
twice or already installed downloads at most once — the existing
already_installed skip makes re-runs free.
wpm info gains a 'Bundle of:' line (and installs[] in --json).
Verified live in an isolated root: expansion installs the missing
member and skips the installed one (requested=2 failed=0), and a
cycle-a <-> cycle-b pair is refused with the chain in the message.
The 14 wpm.* ctest failures on this machine reproduce identically on
pristine origin/main (environment-bound), so the diff does not move
them.
The bundle pre-pass loaded its own index snapshot (load_index with no refresh) and hard-failed every requested name that snapshot could not see. Any install staged through a configured source - the local cache is only populated by the refresh install_package performs - died in the pre-pass with a bundle diagnostic, and a plain unknown name in a mixed batch took the whole batch down with it and lost the canonical "package not found after index update" message. 14 wpm ctest cases failed in CI while main is 3757/3757 green. Expansion now resolves against the same index view install_package uses: - install_packages refreshes once when a requested name is missing from the local index (the same first move install_package makes for a single name), so a bundle only a fetched source carries resolves. - Only names the index contains take part in expansion. Plain packages, aliases and still-unknown names pass through untouched; install_package keeps owning their per-package outcomes and diagnostics. - A bundle is an entry with no artifacts and a well-formed installs list (the documented definition); an entry with artifacts installs itself and its installs field stays inert metadata. - A malformed installs list (not a list of names) on an artifact-less entry is diagnosed instead of silently dropping members. - Members still resolve strictly inside the bundle: a missing member fails the group with the bundle diagnostic. Also drops the unused ExpandedBundles struct.
New ctest coverage for the installs-field bundles: members install in order, repeated members dedupe, already-installed members take the benign path, nested bundles expand, cycles are refused with the chain in the message, a missing member installs nothing, a malformed installs list is rejected, wpm info reports Bundle of:/installs, and the regression pin - a batch mixing a bundle with an unknown package installs the members and reports the unknown name through the canonical install_package diagnostic, never as a bundle member.
Review: the 14 ctest failures are introduced here — fixed on this branchCaptain review of the two original commits, with two fix commits added on top (author commits untouched): Why CI is red. On Root cause: the expansion pre-pass in
Nine new ctest cases: members install in order, repeated members dedupe, already-installed members take the benign path, nested bundles expand, cycles are refused with the chain printed, a missing member installs nothing, a malformed Net for the fix commits: For the record (not addressed here, to keep the fix scoped): the new bundle messages are raw strings without |
队长复核结论:CI 全绿,可合(2026-11-06 22:01 CST)head
即:原审结论「不可合」的唯一产品原因(bundle 预展开绕过索引刷新、全批安装被误杀)已修复并钉住,作者本地 61/14 的说法与 CI 主干 3757/3757 的矛盾也已解释清楚(其本机基线红是另一回事)。 遗留(不阻塞合并,已在前一评论记录):bundle 报错文案仍是裸字符串,未走 合并与否留待仓主决定。 |
What
Bundle support: an index entry with no artifacts and an
installs: [...]array now expands at the install entry point.wpm install build-basewherebuild-base = {kind: bundle, installs: [mingw, cmake, ninja, bsdtar]}installs the group in order. Cycle-guarded (chain printed like alias cycles, depth-capped), deduped order-preserving — a member listed twice or already installed downloads at most once, because the existingalready_installedreceipt skip stays on the per-package path.wpm infogainsBundle of:(andinstalls[]in--json).Latent include fixes (needed a full rebuild on the current toolchain to surface):
cpio.cpp/logger.cppuselocaltime_s/strftimeandterminfo_table.hnamesstd::string_viewwithout including<ctime>/<string_view>— they only compiled while stale objects from an older STL sat in the build dir.date.cppalready carries the same explicit include.Verification
wpm install test-bundle(make+grex) printed the expansion line, skipped installed make without re-download, installed grex, summaryrequested=2 failed=0; acycle-a <-> cycle-bpair is refused with the chain in the message.wpm.*ctest: 61 passed / 14 failed — identical on pristineorigin/mainon this machine (environment-bound), so the diff does not move the suite.Intended consumer (index side, separate PR in wpm-source)
mingw(winlibs x86_64 GCC 16.2 zip, direct GitHub release URL + sha256) andbuild-basebundle — turnswpm install build-base+ rubash/niubash into a complete no-MSYS configure && make toolchain story (the zlib configure→make→test loop was driven end-to-end under rubash with this shape).