From a06d01c25c9bfbcf31d3b0780f90abf63950e23b Mon Sep 17 00:00:00 2001 From: FarnaHerry Date: Wed, 18 Nov 2026 15:12:18 +0800 Subject: [PATCH 1/3] feat(huxerui): 0.4.0 Form A: the upstream manifest gains !src/runtime/profiling.cpp and drops HUXERUI_ENABLE_PROFILING=1, but no build information is restated in the descriptor. The four direct Linux deps and the 36-entry GTK closure are byte-identical to 0.3.0 (target table diffed), so only the version block moves. LICENSE is still MIT and the canonical repo is still HuxerUI/HuxerUI. extensions.autoupdate is declared now: public tag release, stable archive template, no recipe to edit. The official pinned updater (check) found 0.4.0 and computed the same sha256 as two manual downloads; apply generated the shared versions table and the three platform references. No CN mirror yet -- plain-string GLOBAL url per SOP. Verified locally with mcpp 2026.11.15.1 (CI MCPP_VERSION), cold member: huxerui-module -> test result ok. 1 passed; 0 failed (301.36s). Descriptor lint and mcpp xpkg parse pass; audit covers 107 GitHub-direct descriptors. macOS/Windows legs remain CI-authoritative. --- .../2026-11-18-bump-huxerui-0.4.0-plan.md | 116 ++++++++++++++++++ pkgs/h/huxerui.huxerui.lua | 59 +++++++-- tests/examples/huxerui-module/mcpp.toml | 2 +- 3 files changed, 166 insertions(+), 11 deletions(-) create mode 100644 .agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md diff --git a/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md b/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md new file mode 100644 index 00000000..75c70fa3 --- /dev/null +++ b/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md @@ -0,0 +1,116 @@ +# Design doc: bump `huxerui.huxerui` to 0.4.0 + +Date: 2026-11-18 + +Follow-up to `18dfa0b` (0.3.0). Upstream released v0.4.0 on 2026-11-13; this +bumps the index from 0.3.0 to 0.4.0 and makes the package eligible for the +daily updater. + +## Source and version + +| | | +|---|---| +| Upstream | `https://github.com/HuxerUI/HuxerUI` | +| Version | `0.4.0` (latest release, 2026-11-13) | +| Tarball | `archive/refs/tags/v0.4.0.tar.gz` | +| sha256 | `46631651105b4da2fa6651c842ce4d276334b3e06b27f93bb9c26167ec16fc38` (computed twice from two fresh downloads, stable; the pinned updater independently produced the same digest and size 10,348,921) | +| Wrap dir | `HuxerUI-0.4.0/` — Form A default lookup finds `HuxerUI-0.4.0/mcpp.toml` | +| CN mirror | **pending** — no `mcpp-res` write access on this machine; plain-string GLOBAL url fallback per SOP | +| License | MIT (unchanged; upstream's `mcpp.toml` still says Apache-2.0) | +| Auto-update | **newly declared** (`tag = "v${version}"`, GitHub archive URL) | + +## What changed upstream (0.3.0 → 0.4.0) + +`mcpp.toml` diff, generated after extracting both tag archives: + +- `sources` gains `!src/runtime/profiling.cpp` and `defines` drops + `HUXERUI_ENABLE_PROFILING=1`; the release turns the profiling runtime into a + build-time option rather than a default-on define. +- `[runtime] frameworks` on macOS grows `Contacts`, `CoreBluetooth`, + `CoreLocation`, `EventKit` and `Photos`. +- No change to the Linux target dependency table: all 36 `xim` pins are + byte-identical to 0.3.0 (the only diff in that section is one comment line). +- `standard = "c++20"` is unchanged, so the consumer member keeps its c++20 + baseline. + +Release notes describe desktop multi-window support, dockable workspaces, +paragraph layout APIs for custom editors, side-by-side installed SDK versions, +and Android static linking. None of it changes the index contract. + +Form A means none of the upstream build changes are restated here: mcpp reads +the downloaded archive's own `mcpp.toml`. The descriptor only carries the +consumer-side Linux dependency closure, and that closure did not move. + +## Descriptor changes (`pkgs/h/huxerui.huxerui.lua`) + +- Shared `local versions` table (the updater's standard shape for one asset + used by every platform) holds the 0.4.0 URL and sha256. +- `xpm.["0.4.0"] = versions["0.4.0"]`; the 0.3.0 blocks + keep their original `{ GLOBAL, CN }` table untouched. +- `extensions.autoupdate` declared for the first time. The package is a public + GitHub tag release with a stable archive template and no build recipe to + edit, so future versions need only a version block. GitHub-only on purpose: + no mirror asset exists yet for 0.4.0, and a new version may name GitHub + directly. The updater's `check` now answers `up-to-date` for 0.4.0. +- File-top note records the 0.4.0 manifest delta and why it does not reach the + descriptor; the licence/repository corrections (MIT, `HuxerUI/HuxerUI`) are + still needed at v0.4.0 and keep their rationale. + +## Updater run (official flow) + +Pinned `openxlings/xpkgindex-update@6c0bee2` from +`.github/workflows/xpkgindex-update.yml`: + +- `inspect --package huxerui:huxerui.huxerui` → one declaration, `direct` + empty before 0.4.0, no error. +- `check` → `update-ready`, candidate `0.4.0`, tag `v0.4.0`, upstream commit + `4d573263e81af07e193efc2ea43fb34ab6050b33`, sha256 as above. +- `apply` → `appended`; generated the shared table plus the three references. +- `check` again → `up-to-date`, `existing_versions = ["0.3.0", "0.4.0"]`. +- `tests/autoupdate/ci.py audit --base HEAD` → 107 updateable GitHub-direct + descriptors declared; all existing versions preserved. + +## Test member + +`tests/examples/huxerui-module/mcpp.toml`: dependency pin `0.3.0` → `0.4.0`. +No source change needed: `Rect::Contains`, `Color::Rgba32`, +`FlatLightThemeSpec` and `FlatDarkThemeSpec` all still exist in the 0.4.0 +headers/sources. The test keeps its deliberate no-window shape and its +link-time assertion through the out-of-line theme specs. + +## Verification + +Local Linux x86_64, mcpp **2026.11.15.1** (the CI `MCPP_VERSION`, downloaded as +the release tarball), `MCPP_INDEX_MIRROR=GLOBAL`, cold member home +`target/package-validation-home`. + +```sh +bash tests/run_members.sh huxerui-module +``` + +Result: `test result ok. 1 passed; 0 failed; finished in 301.36s +(plan 255.11s · build 46.24s · run 0.01s)`. The run resolved +`huxerui.huxerui@0.4.0` from the index, installed the unchanged GTK closure, +built the SDK (including its `hcg`/`hrc` host tools), linked the consumer and +executed the runtime assertions. + +Descriptor lint (`lua` 5.4.8, the same scripts `validate.yml` runs) passes: +syntax, mirror URLs, package-name shape, reserved namespace, platform version +parity, duplicate versions, cross-package references. `mcpp xpkg parse +pkgs/h/huxerui.huxerui.lua` under the pinned engine reports Form A and the +0.3.0/0.4.0 versions. + +macOS and Windows legs remain CI-authoritative. The new macOS frameworks are +read from upstream's manifest, not this descriptor; the Windows `wix` decision +is unchanged. + +## Notes / risks + +- The four direct Linux dependencies and their pins are unchanged, so the + package's install closure does not move with 0.4.0. +- Future upstream releases that change the target dependency table still + require a manual `xpm.linux.deps` update. CI's Linux candidate build would + fail loudly (`Package was not found in the pkg-config search path`), and + the updater PR is reviewed before merge. +- No CN mirror is declared for 0.4.0; `mirror-cn-reachable` only checks + declared CN URLs, and the 0.3.0 mirror entry is untouched. diff --git a/pkgs/h/huxerui.huxerui.lua b/pkgs/h/huxerui.huxerui.lua index ab7d18a6..91038630 100644 --- a/pkgs/h/huxerui.huxerui.lua +++ b/pkgs/h/huxerui.huxerui.lua @@ -1,18 +1,42 @@ +local versions = { + ["0.4.0"] = { + url = "https://github.com/HuxerUI/HuxerUI/archive/refs/tags/v0.4.0.tar.gz", + sha256 = "46631651105b4da2fa6651c842ce4d276334b3e06b27f93bb9c26167ec16fc38", + }, +} + -- huxerui.huxerui — the HuxerUI SDK as a native mcpp module package. -- -- Form A: upstream carries its own `mcpp.toml`, so this descriptor declares -- metadata and a download address and nothing else about the build. mcpp's -- default lookup finds `/*/mcpp.toml` inside the GitHub tag archive's --- `HuxerUI-0.3.0/` wrap. `import huxerui;` is upstream's own module interface --- (`modules/huxerui.cppm`), not one authored here. +-- `HuxerUI-/` wrap. `import huxerui;` is upstream's own module +-- interface (`modules/huxerui.cppm`), not one authored here. +-- +-- ── 0.4.0 ───────────────────────────────────────────────────────────────── +-- +-- The upstream manifest gains `!src/runtime/profiling.cpp` in `sources` and +-- drops `defines = ["HUXERUI_ENABLE_PROFILING=1"]`; its macOS `[runtime]` +-- framework list grows Contacts/CoreBluetooth/CoreLocation/EventKit/Photos. +-- None of that reaches this descriptor: Form A downloads the tag archive and +-- mcpp reads upstream's own manifest, so no build information is restated +-- here. The four direct Linux dependencies and the 36-entry GTK closure in +-- `xpm.linux.deps` are unchanged -- the v0.4.0 target table was diffed against +-- v0.3.0's and is identical down to every pin. `FlatLightThemeSpec` / +-- `FlatDarkThemeSpec` and `Color`/`Rect` used by the consumer test still +-- exist, so the member only moves its pin. +-- +-- 0.4.0 has no CN mirror yet. Per SOP a new version may name the GitHub +-- release directly when the mcpp-res upload is not available; the mirror can +-- be filled in later without touching the version block. -- -- ── Two fields deliberately DISAGREE with `mcpp emit xpkg` ──────────────── -- --- Running `mcpp emit xpkg` against the v0.3.0 tag emits `Apache-2.0` and --- `github.com/Sunrisepeak/HuxerUI`. Both are wrong at the source and are +-- Running `mcpp emit xpkg` against the v0.4.0 tag still emits `Apache-2.0` +-- and `github.com/Sunrisepeak/HuxerUI`. Both are wrong at the source and are -- corrected here rather than copied: -- --- * LICENSE in the v0.3.0 tree is the MIT License, verbatim, and the +-- * LICENSE in the v0.4.0 tree is the MIT License, verbatim, and the -- xim-pkgindex entry for the same SDK has always said MIT. The -- `license = "Apache-2.0"` line in upstream's mcpp.toml is a typo that -- seven manifests in that repo share; it is being fixed upstream @@ -46,10 +70,11 @@ -- So the closure is transcribed here, at PLATFORM level (a per-version -- `deps` does not take effect -- the same finding compat.eui-neo and -- compat.glx-runtime record). The 36 entries and their pins are copied --- verbatim from the v0.3.0 tag's own mcpp.toml, which documents them as the --- transitive .pc closure of gtk4 + epoxy + libsoup. They are what the --- package's build compiles against AND what its consumer must have, so no --- `runtime = { … }` split applies. +-- verbatim from the v0.4.0 tag's own mcpp.toml, which documents them as the +-- transitive .pc closure of gtk4 + epoxy + libsoup. It diffs against v0.3.0 +-- only in the prose line above the table; every pin is identical. They are +-- what the package's build compiles against AND what its consumer must have, +-- so no `runtime = { … }` split applies. -- -- Keeping this list in step with upstream's is manual until mcpp can derive -- consumer dependencies from the target axis. A missing entry surfaces as @@ -71,6 +96,17 @@ package = { repo = "https://github.com/HuxerUI/HuxerUI", type = "package", + extensions = { + -- Form A carries no build recipe, so a new tag needs nothing but a + -- version block: the daily updater can append it from this template. + -- GitHub only -- the mcpp-res mirror is manual and not declared here, + -- which is allowed for a new version. + autoupdate = { + tag = "v${version}", + url = "https://github.com/HuxerUI/HuxerUI/archive/refs/tags/${tag}.tar.gz", + }, + }, + xpm = { linux = { -- DIRECT dependencies only -- the four modules upstream's cmake @@ -99,6 +135,7 @@ package = { }, sha256 = "8b326d95015e92925229fdc1ababe4fdf32515e75764472591645622c1cfbb08", }, + ["0.4.0"] = versions["0.4.0"], }, macosx = { ["0.3.0"] = { @@ -108,6 +145,7 @@ package = { }, sha256 = "8b326d95015e92925229fdc1ababe4fdf32515e75764472591645622c1cfbb08", }, + ["0.4.0"] = versions["0.4.0"], }, windows = { -- NO `xim:wix`, and that is not an oversight. @@ -147,11 +185,12 @@ package = { }, sha256 = "8b326d95015e92925229fdc1ababe4fdf32515e75764472591645622c1cfbb08", }, + ["0.4.0"] = versions["0.4.0"], }, }, -- NO `mcpp` SEGMENT, deliberately. This is shape D (external Form-A module - -- repo): the tag archive carries `HuxerUI-0.3.0/mcpp.toml`, and mcpp's + -- repo): the tag archive carries `HuxerUI-/mcpp.toml`, and mcpp's -- default lookup finds `/*/mcpp.toml` there. `mcpp emit xpkg` -- prints a table-form segment aimed at the publish flow; pasting it here -- makes the parser read this as an INLINE (Form B) descriptor and refuse diff --git a/tests/examples/huxerui-module/mcpp.toml b/tests/examples/huxerui-module/mcpp.toml index 2902af6a..7b6db825 100644 --- a/tests/examples/huxerui-module/mcpp.toml +++ b/tests/examples/huxerui-module/mcpp.toml @@ -22,4 +22,4 @@ version = "0.1.0" standard = "c++20" [dependencies.huxerui] -huxerui = "0.3.0" +huxerui = "0.4.0" From 465a127b7992eefda15210da1be1b3e193771070 Mon Sep 17 00:00:00 2001 From: FarnaHerry Date: Wed, 18 Nov 2026 15:21:12 +0800 Subject: [PATCH 2/3] fix(autoupdate): find legacy fully-qualified consumers huxerui declares namespace = "huxerui" and the legacy fully-qualified name = "huxerui.huxerui"; consumers write [dependencies.huxerui] huxerui = "...". direct_member and replace_candidate only looked for the declared leaf, so a version bump failed scan with 'no candidate consumer'. Writing the fully-qualified leaf asks mcpp for huxerui.huxerui.huxerui and is refused, so the helper now derives the short leaf for detection, rewriting, the no-member fallback and lock verification. Regression test covers detection and prepare(). --- .../2026-11-18-bump-huxerui-0.4.0-plan.md | 16 +++++++ tests/autoupdate/ci.py | 45 ++++++++++++++++--- tests/autoupdate/test_ci.py | 26 +++++++++++ 3 files changed, 80 insertions(+), 7 deletions(-) diff --git a/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md b/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md index 75c70fa3..634b013d 100644 --- a/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md +++ b/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md @@ -70,6 +70,22 @@ Pinned `openxlings/xpkgindex-update@6c0bee2` from - `tests/autoupdate/ci.py audit --base HEAD` → 107 updateable GitHub-direct descriptors declared; all existing versions preserved. +### Candidate matrix: legacy fully-qualified name + +The first PR CI run failed `scan` with `no candidate consumer: +huxerui:huxerui.huxerui`. `direct_member` looked for the declared leaf +`huxerui.huxerui`, but mcpp's consumer spelling is +`[dependencies.huxerui] huxerui = "0.4.0"` — the fully-qualified leaf asks for +`huxerui.huxerui.huxerui` and is refused (verified against the pinned engine). +`tests/autoupdate/ci.py` now derives the short leaf from a legacy +fully-qualified `name` for `direct_member`, `names_dependency`, +`replace_candidate` and lock verification; the no-member fallback manifest uses +the short leaf too. This is what lets the updater test huxerui at all — without +it, every future version of this package would fail the candidate scan. The +new unit test `test_legacy_fully_qualified_name_finds_the_short_consumer_key` +covers detection and the prepared consumer; the matrix now selects +`huxerui-module` for linux default/llvm, macOS and Windows. + ## Test member `tests/examples/huxerui-module/mcpp.toml`: dependency pin `0.3.0` → `0.4.0`. diff --git a/tests/autoupdate/ci.py b/tests/autoupdate/ci.py index 4cdf6c49..28fc17e1 100644 --- a/tests/autoupdate/ci.py +++ b/tests/autoupdate/ci.py @@ -133,6 +133,23 @@ def platform_conditions(manifest: dict, namespace: str, name: str): yield None +def dependency_leaves(namespace: str, name: str) -> set[str]: + """The leaf names a consumer may write for `namespace:name`. + + SPEC-001 keeps `name` atomic, so it is the leaf. Legacy descriptors repeat + the namespace inside `name` (`namespace = "huxerui", name = + "huxerui.huxerui"`); consumers still write `[dependencies.huxerui] huxerui + = "..."`, and mcpp reconstructs the fully-qualified wire key from that pair. + `mcpp` rejects the fully-qualified leaf for such a package + (`huxerui.huxerui.huxerui`), so both spellings must be recognized here. + """ + prefix = namespace + "." + leaves = {name} + if name.startswith(prefix): + leaves.add(name[len(prefix):]) + return leaves + + def direct_member(identity: str) -> str | None: namespace, name = identity.split(":", 1) candidates = [] @@ -184,9 +201,12 @@ def names_dependency(deps: dict, namespace: str, name: str) -> bool: nested = deps for part in namespace.split("."): nested = nested.get(part, {}) if isinstance(nested, dict) else {} - return (is_spec(deps.get(f"{namespace}.{name}")) - or is_spec(deps.get(namespace, {}).get(name) if isinstance(deps.get(namespace), dict) else None) - or (isinstance(nested, dict) and is_spec(nested.get(name)))) + table = deps.get(namespace) if isinstance(deps.get(namespace), dict) else {} + leaves = dependency_leaves(namespace, name) + return (any(is_spec(deps.get(f"{namespace}.{leaf}")) for leaf in leaves) + or any(is_spec(table.get(leaf)) for leaf in leaves) + or (isinstance(nested, dict) + and any(is_spec(nested.get(leaf)) for leaf in leaves))) # The runner platforms, by the spelling a member's `cfg(os = ...)` uses. @@ -323,10 +343,16 @@ def archive_of(record): def replace_candidate(text: str, identity: str, version: str) -> str: # The key as a consumer writes it: the bare name under the namespace's # table, or the identity key, quoted or not (`mcpplibs.mtest.capi = ...`, - # the form mcpp recommends since 2026.11.8.1). + # the form mcpp recommends since 2026.11.8.1). Legacy descriptors whose + # `name` repeats the namespace expose the short leaf too. namespace, name = identity.split(":", 1) + keys = set() + for leaf in dependency_leaves(namespace, name): + keys.update({leaf, f"{namespace}.{leaf}"}) + alternatives = "|".join(rf'"?{re.escape(key)}"?' for key in + sorted(keys, key=lambda key: (-len(key), key))) text, replacements = re.subn( - rf'(?m)^(\s*(?:{re.escape(name)}|"?{re.escape(namespace)}\.{re.escape(name)}"?)\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$', + rf'(?m)^(\s*(?:{alternatives})\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$', lambda m: m[1] + version + m[2], text) if not replacements: # A platform the member selects (mcpp SPEC-013). @@ -360,7 +386,8 @@ def prepare(plan: Path, identity: str, output: Path, home: Path | None = None): # Standalone consumer: no inherited workspace or stale relative index redirects. text = re.sub(r'(?ms)^\[indices(?:\.[^\]]+)?\]\s*\n.*?(?=^\[|\Z)', '', text) else: - text = f'[package]\nname = "candidate-{name}"\nversion = "0.1.0"\n\n[dependencies.{namespace}]\n{name} = "{version}"\n' + leaf = min(dependency_leaves(namespace, name), key=len) + text = f'[package]\nname = "candidate-{name}"\nversion = "0.1.0"\n\n[dependencies.{namespace}]\n{leaf} = "{version}"\n' (output / "tests").mkdir(exist_ok=True) probes = { "hiredis": '#include \nint main() { auto *r = redisReaderCreate(); if (!r) return 1; redisReaderFree(r); }\n', @@ -399,8 +426,12 @@ def verify(plan: Path, identity: str, consumer: Path): record = next(r for r in json.loads(plan.read_text(encoding="utf-8"))["packages"] if r["id"] == identity) namespace, name = identity.split(":", 1) lock = tomllib.loads((consumer / "mcpp.lock").read_text(encoding="utf-8")) + leaves = dependency_leaves(namespace, name) + keys = set(leaves) + keys.add(identity) + keys.update(f"{namespace}.{leaf}" for leaf in leaves) matches = [value for key, value in lock.get("package", {}).items() - if value.get("namespace") == namespace and key in (name, identity, f"{namespace}.{name}")] + if value.get("namespace") == namespace and key in keys] if not matches or any(v["version"] != record["candidate"] for v in matches): raise RuntimeError(f"lockfile does not prove {identity}@{record['candidate']}: {matches}") print(f"PROVEN: build resolved {identity}@{record['candidate']}") diff --git a/tests/autoupdate/test_ci.py b/tests/autoupdate/test_ci.py index e746dcd9..74365178 100644 --- a/tests/autoupdate/test_ci.py +++ b/tests/autoupdate/test_ci.py @@ -118,6 +118,32 @@ def test_mwrap_candidate_uses_its_actual_member_and_qualified_dependency(self): self.assertEqual(result["dependencies"]["mcpplibs.mwrap.example"], "1.0.1") self.assertEqual((dest / "tests/probe.cpp").read_text(), 'int main() { return 0; }\n') + def test_legacy_fully_qualified_name_finds_the_short_consumer_key(self): + # `namespace = "huxerui", name = "huxerui.huxerui"` is the legacy + # fully-qualified spelling. mcpp reconstructs the FQN from + # `[dependencies.huxerui] huxerui = "..."`; writing the FQN as the leaf + # asks for `huxerui.huxerui.huxerui` and is refused. + deps = tomllib.loads('[dependencies.huxerui]\nhuxerui = "0.4.0"\n')["dependencies"] + self.assertTrue(ci.names_dependency(deps, "huxerui", "huxerui.huxerui")) + self.assertFalse(ci.names_dependency( + {"huxerui": {"other": "1.0.0"}}, "huxerui", "huxerui.huxerui")) + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + source = root / "tests/examples/huxerui-module" + source.mkdir(parents=True) + (source / "mcpp.toml").write_text( + '[package]\nname="consumer"\nversion="0.1.0"\n' + '[dependencies.huxerui]\nhuxerui = "0.4.0"\n') + plan = root / "plan.json" + plan.write_text(json.dumps({"packages": [ + {"id": "huxerui:huxerui.huxerui", "candidate": "0.5.0"}]})) + with patch.object(ci, "ROOT", root): + self.assertEqual(ci.direct_member("huxerui:huxerui.huxerui"), "huxerui-module") + dest = root / "candidate" + ci.prepare(plan, "huxerui:huxerui.huxerui", dest) + result = tomllib.loads((dest / "mcpp.toml").read_text()) + self.assertEqual(result["dependencies"]["huxerui"]["huxerui"], "0.5.0") + def test_an_unquoted_identity_key_is_replaced(self): # The key mcpp recommends (2026.11.8.1): the identity, dotted and unquoted, which TOML # reads as nested tables. From 76692dc7694c67ec640794b1e2322f2bc415e15b Mon Sep 17 00:00:00 2001 From: FarnaHerry Date: Wed, 18 Nov 2026 16:56:39 +0800 Subject: [PATCH 3/3] fix(huxerui): use the atomic package name SPEC-001 keeps package.name atomic and puts hierarchy in namespace. The resolved wire key stays huxerui.huxerui (mcpp xpkg parse and mcpp.lock), while the updater now sees huxerui:huxerui and finds huxerui-module. Drop the candidate-helper compatibility change and the design document: the PR changes only the descriptor and its consumer pin. --- .../2026-11-18-bump-huxerui-0.4.0-plan.md | 132 ------------------ pkgs/h/huxerui.huxerui.lua | 7 +- tests/autoupdate/ci.py | 45 +----- tests/autoupdate/test_ci.py | 26 ---- 4 files changed, 11 insertions(+), 199 deletions(-) delete mode 100644 .agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md diff --git a/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md b/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md deleted file mode 100644 index 634b013d..00000000 --- a/.agents/docs/2026-11-18-bump-huxerui-0.4.0-plan.md +++ /dev/null @@ -1,132 +0,0 @@ -# Design doc: bump `huxerui.huxerui` to 0.4.0 - -Date: 2026-11-18 - -Follow-up to `18dfa0b` (0.3.0). Upstream released v0.4.0 on 2026-11-13; this -bumps the index from 0.3.0 to 0.4.0 and makes the package eligible for the -daily updater. - -## Source and version - -| | | -|---|---| -| Upstream | `https://github.com/HuxerUI/HuxerUI` | -| Version | `0.4.0` (latest release, 2026-11-13) | -| Tarball | `archive/refs/tags/v0.4.0.tar.gz` | -| sha256 | `46631651105b4da2fa6651c842ce4d276334b3e06b27f93bb9c26167ec16fc38` (computed twice from two fresh downloads, stable; the pinned updater independently produced the same digest and size 10,348,921) | -| Wrap dir | `HuxerUI-0.4.0/` — Form A default lookup finds `HuxerUI-0.4.0/mcpp.toml` | -| CN mirror | **pending** — no `mcpp-res` write access on this machine; plain-string GLOBAL url fallback per SOP | -| License | MIT (unchanged; upstream's `mcpp.toml` still says Apache-2.0) | -| Auto-update | **newly declared** (`tag = "v${version}"`, GitHub archive URL) | - -## What changed upstream (0.3.0 → 0.4.0) - -`mcpp.toml` diff, generated after extracting both tag archives: - -- `sources` gains `!src/runtime/profiling.cpp` and `defines` drops - `HUXERUI_ENABLE_PROFILING=1`; the release turns the profiling runtime into a - build-time option rather than a default-on define. -- `[runtime] frameworks` on macOS grows `Contacts`, `CoreBluetooth`, - `CoreLocation`, `EventKit` and `Photos`. -- No change to the Linux target dependency table: all 36 `xim` pins are - byte-identical to 0.3.0 (the only diff in that section is one comment line). -- `standard = "c++20"` is unchanged, so the consumer member keeps its c++20 - baseline. - -Release notes describe desktop multi-window support, dockable workspaces, -paragraph layout APIs for custom editors, side-by-side installed SDK versions, -and Android static linking. None of it changes the index contract. - -Form A means none of the upstream build changes are restated here: mcpp reads -the downloaded archive's own `mcpp.toml`. The descriptor only carries the -consumer-side Linux dependency closure, and that closure did not move. - -## Descriptor changes (`pkgs/h/huxerui.huxerui.lua`) - -- Shared `local versions` table (the updater's standard shape for one asset - used by every platform) holds the 0.4.0 URL and sha256. -- `xpm.["0.4.0"] = versions["0.4.0"]`; the 0.3.0 blocks - keep their original `{ GLOBAL, CN }` table untouched. -- `extensions.autoupdate` declared for the first time. The package is a public - GitHub tag release with a stable archive template and no build recipe to - edit, so future versions need only a version block. GitHub-only on purpose: - no mirror asset exists yet for 0.4.0, and a new version may name GitHub - directly. The updater's `check` now answers `up-to-date` for 0.4.0. -- File-top note records the 0.4.0 manifest delta and why it does not reach the - descriptor; the licence/repository corrections (MIT, `HuxerUI/HuxerUI`) are - still needed at v0.4.0 and keep their rationale. - -## Updater run (official flow) - -Pinned `openxlings/xpkgindex-update@6c0bee2` from -`.github/workflows/xpkgindex-update.yml`: - -- `inspect --package huxerui:huxerui.huxerui` → one declaration, `direct` - empty before 0.4.0, no error. -- `check` → `update-ready`, candidate `0.4.0`, tag `v0.4.0`, upstream commit - `4d573263e81af07e193efc2ea43fb34ab6050b33`, sha256 as above. -- `apply` → `appended`; generated the shared table plus the three references. -- `check` again → `up-to-date`, `existing_versions = ["0.3.0", "0.4.0"]`. -- `tests/autoupdate/ci.py audit --base HEAD` → 107 updateable GitHub-direct - descriptors declared; all existing versions preserved. - -### Candidate matrix: legacy fully-qualified name - -The first PR CI run failed `scan` with `no candidate consumer: -huxerui:huxerui.huxerui`. `direct_member` looked for the declared leaf -`huxerui.huxerui`, but mcpp's consumer spelling is -`[dependencies.huxerui] huxerui = "0.4.0"` — the fully-qualified leaf asks for -`huxerui.huxerui.huxerui` and is refused (verified against the pinned engine). -`tests/autoupdate/ci.py` now derives the short leaf from a legacy -fully-qualified `name` for `direct_member`, `names_dependency`, -`replace_candidate` and lock verification; the no-member fallback manifest uses -the short leaf too. This is what lets the updater test huxerui at all — without -it, every future version of this package would fail the candidate scan. The -new unit test `test_legacy_fully_qualified_name_finds_the_short_consumer_key` -covers detection and the prepared consumer; the matrix now selects -`huxerui-module` for linux default/llvm, macOS and Windows. - -## Test member - -`tests/examples/huxerui-module/mcpp.toml`: dependency pin `0.3.0` → `0.4.0`. -No source change needed: `Rect::Contains`, `Color::Rgba32`, -`FlatLightThemeSpec` and `FlatDarkThemeSpec` all still exist in the 0.4.0 -headers/sources. The test keeps its deliberate no-window shape and its -link-time assertion through the out-of-line theme specs. - -## Verification - -Local Linux x86_64, mcpp **2026.11.15.1** (the CI `MCPP_VERSION`, downloaded as -the release tarball), `MCPP_INDEX_MIRROR=GLOBAL`, cold member home -`target/package-validation-home`. - -```sh -bash tests/run_members.sh huxerui-module -``` - -Result: `test result ok. 1 passed; 0 failed; finished in 301.36s -(plan 255.11s · build 46.24s · run 0.01s)`. The run resolved -`huxerui.huxerui@0.4.0` from the index, installed the unchanged GTK closure, -built the SDK (including its `hcg`/`hrc` host tools), linked the consumer and -executed the runtime assertions. - -Descriptor lint (`lua` 5.4.8, the same scripts `validate.yml` runs) passes: -syntax, mirror URLs, package-name shape, reserved namespace, platform version -parity, duplicate versions, cross-package references. `mcpp xpkg parse -pkgs/h/huxerui.huxerui.lua` under the pinned engine reports Form A and the -0.3.0/0.4.0 versions. - -macOS and Windows legs remain CI-authoritative. The new macOS frameworks are -read from upstream's manifest, not this descriptor; the Windows `wix` decision -is unchanged. - -## Notes / risks - -- The four direct Linux dependencies and their pins are unchanged, so the - package's install closure does not move with 0.4.0. -- Future upstream releases that change the target dependency table still - require a manual `xpm.linux.deps` update. CI's Linux candidate build would - fail loudly (`Package was not found in the pkg-config search path`), and - the updater PR is reviewed before merge. -- No CN mirror is declared for 0.4.0; `mirror-cn-reachable` only checks - declared CN URLs, and the 0.3.0 mirror entry is untouched. diff --git a/pkgs/h/huxerui.huxerui.lua b/pkgs/h/huxerui.huxerui.lua index 91038630..ad313fd3 100644 --- a/pkgs/h/huxerui.huxerui.lua +++ b/pkgs/h/huxerui.huxerui.lua @@ -88,9 +88,10 @@ local versions = { package = { spec = "1", namespace = "huxerui", - -- FULLY-QUALIFIED, per mcpp#278 (INV-NAME). `namespace` plus a bare - -- `name` is the split form, which parses but can never be installed. - name = "huxerui.huxerui", + -- Atomic, per mcpp SPEC-001 §3.2: hierarchy belongs in `namespace`. + -- mcpp reconstructs the wire key `huxerui.huxerui` from the consumer's + -- `[dependencies.huxerui] huxerui = "..."`. + name = "huxerui", description = "HuxerUI — declarative cross-platform UI framework in C++20 (GTK4 on Linux, Win32/Direct2D, AppKit/Metal)", licenses = {"MIT"}, repo = "https://github.com/HuxerUI/HuxerUI", diff --git a/tests/autoupdate/ci.py b/tests/autoupdate/ci.py index 28fc17e1..4cdf6c49 100644 --- a/tests/autoupdate/ci.py +++ b/tests/autoupdate/ci.py @@ -133,23 +133,6 @@ def platform_conditions(manifest: dict, namespace: str, name: str): yield None -def dependency_leaves(namespace: str, name: str) -> set[str]: - """The leaf names a consumer may write for `namespace:name`. - - SPEC-001 keeps `name` atomic, so it is the leaf. Legacy descriptors repeat - the namespace inside `name` (`namespace = "huxerui", name = - "huxerui.huxerui"`); consumers still write `[dependencies.huxerui] huxerui - = "..."`, and mcpp reconstructs the fully-qualified wire key from that pair. - `mcpp` rejects the fully-qualified leaf for such a package - (`huxerui.huxerui.huxerui`), so both spellings must be recognized here. - """ - prefix = namespace + "." - leaves = {name} - if name.startswith(prefix): - leaves.add(name[len(prefix):]) - return leaves - - def direct_member(identity: str) -> str | None: namespace, name = identity.split(":", 1) candidates = [] @@ -201,12 +184,9 @@ def names_dependency(deps: dict, namespace: str, name: str) -> bool: nested = deps for part in namespace.split("."): nested = nested.get(part, {}) if isinstance(nested, dict) else {} - table = deps.get(namespace) if isinstance(deps.get(namespace), dict) else {} - leaves = dependency_leaves(namespace, name) - return (any(is_spec(deps.get(f"{namespace}.{leaf}")) for leaf in leaves) - or any(is_spec(table.get(leaf)) for leaf in leaves) - or (isinstance(nested, dict) - and any(is_spec(nested.get(leaf)) for leaf in leaves))) + return (is_spec(deps.get(f"{namespace}.{name}")) + or is_spec(deps.get(namespace, {}).get(name) if isinstance(deps.get(namespace), dict) else None) + or (isinstance(nested, dict) and is_spec(nested.get(name)))) # The runner platforms, by the spelling a member's `cfg(os = ...)` uses. @@ -343,16 +323,10 @@ def archive_of(record): def replace_candidate(text: str, identity: str, version: str) -> str: # The key as a consumer writes it: the bare name under the namespace's # table, or the identity key, quoted or not (`mcpplibs.mtest.capi = ...`, - # the form mcpp recommends since 2026.11.8.1). Legacy descriptors whose - # `name` repeats the namespace expose the short leaf too. + # the form mcpp recommends since 2026.11.8.1). namespace, name = identity.split(":", 1) - keys = set() - for leaf in dependency_leaves(namespace, name): - keys.update({leaf, f"{namespace}.{leaf}"}) - alternatives = "|".join(rf'"?{re.escape(key)}"?' for key in - sorted(keys, key=lambda key: (-len(key), key))) text, replacements = re.subn( - rf'(?m)^(\s*(?:{alternatives})\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$', + rf'(?m)^(\s*(?:{re.escape(name)}|"?{re.escape(namespace)}\.{re.escape(name)}"?)\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$', lambda m: m[1] + version + m[2], text) if not replacements: # A platform the member selects (mcpp SPEC-013). @@ -386,8 +360,7 @@ def prepare(plan: Path, identity: str, output: Path, home: Path | None = None): # Standalone consumer: no inherited workspace or stale relative index redirects. text = re.sub(r'(?ms)^\[indices(?:\.[^\]]+)?\]\s*\n.*?(?=^\[|\Z)', '', text) else: - leaf = min(dependency_leaves(namespace, name), key=len) - text = f'[package]\nname = "candidate-{name}"\nversion = "0.1.0"\n\n[dependencies.{namespace}]\n{leaf} = "{version}"\n' + text = f'[package]\nname = "candidate-{name}"\nversion = "0.1.0"\n\n[dependencies.{namespace}]\n{name} = "{version}"\n' (output / "tests").mkdir(exist_ok=True) probes = { "hiredis": '#include \nint main() { auto *r = redisReaderCreate(); if (!r) return 1; redisReaderFree(r); }\n', @@ -426,12 +399,8 @@ def verify(plan: Path, identity: str, consumer: Path): record = next(r for r in json.loads(plan.read_text(encoding="utf-8"))["packages"] if r["id"] == identity) namespace, name = identity.split(":", 1) lock = tomllib.loads((consumer / "mcpp.lock").read_text(encoding="utf-8")) - leaves = dependency_leaves(namespace, name) - keys = set(leaves) - keys.add(identity) - keys.update(f"{namespace}.{leaf}" for leaf in leaves) matches = [value for key, value in lock.get("package", {}).items() - if value.get("namespace") == namespace and key in keys] + if value.get("namespace") == namespace and key in (name, identity, f"{namespace}.{name}")] if not matches or any(v["version"] != record["candidate"] for v in matches): raise RuntimeError(f"lockfile does not prove {identity}@{record['candidate']}: {matches}") print(f"PROVEN: build resolved {identity}@{record['candidate']}") diff --git a/tests/autoupdate/test_ci.py b/tests/autoupdate/test_ci.py index 74365178..e746dcd9 100644 --- a/tests/autoupdate/test_ci.py +++ b/tests/autoupdate/test_ci.py @@ -118,32 +118,6 @@ def test_mwrap_candidate_uses_its_actual_member_and_qualified_dependency(self): self.assertEqual(result["dependencies"]["mcpplibs.mwrap.example"], "1.0.1") self.assertEqual((dest / "tests/probe.cpp").read_text(), 'int main() { return 0; }\n') - def test_legacy_fully_qualified_name_finds_the_short_consumer_key(self): - # `namespace = "huxerui", name = "huxerui.huxerui"` is the legacy - # fully-qualified spelling. mcpp reconstructs the FQN from - # `[dependencies.huxerui] huxerui = "..."`; writing the FQN as the leaf - # asks for `huxerui.huxerui.huxerui` and is refused. - deps = tomllib.loads('[dependencies.huxerui]\nhuxerui = "0.4.0"\n')["dependencies"] - self.assertTrue(ci.names_dependency(deps, "huxerui", "huxerui.huxerui")) - self.assertFalse(ci.names_dependency( - {"huxerui": {"other": "1.0.0"}}, "huxerui", "huxerui.huxerui")) - with tempfile.TemporaryDirectory() as directory: - root = Path(directory) - source = root / "tests/examples/huxerui-module" - source.mkdir(parents=True) - (source / "mcpp.toml").write_text( - '[package]\nname="consumer"\nversion="0.1.0"\n' - '[dependencies.huxerui]\nhuxerui = "0.4.0"\n') - plan = root / "plan.json" - plan.write_text(json.dumps({"packages": [ - {"id": "huxerui:huxerui.huxerui", "candidate": "0.5.0"}]})) - with patch.object(ci, "ROOT", root): - self.assertEqual(ci.direct_member("huxerui:huxerui.huxerui"), "huxerui-module") - dest = root / "candidate" - ci.prepare(plan, "huxerui:huxerui.huxerui", dest) - result = tomllib.loads((dest / "mcpp.toml").read_text()) - self.assertEqual(result["dependencies"]["huxerui"]["huxerui"], "0.5.0") - def test_an_unquoted_identity_key_is_replaced(self): # The key mcpp recommends (2026.11.8.1): the identity, dotted and unquoted, which TOML # reads as nested tables.