From 6e6fb092e540c4d48ff6afb32f598ecb22f2a3ba Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Fri, 6 Nov 2026 08:07:01 +0900 Subject: [PATCH 1/2] chore: index the OpenKal 0.24 native and web source group --- pkgs/o/openkal-emscripten.lua | 21 +++++++++++++++++++++ pkgs/o/openkal-linux.lua | 21 +++++++++++++++++++++ pkgs/o/openkal-macos.lua | 21 +++++++++++++++++++++ pkgs/o/openkal-windows.lua | 21 +++++++++++++++++++++ pkgs/o/openkal.lua | 21 +++++++++++++++++++++ 5 files changed, 105 insertions(+) diff --git a/pkgs/o/openkal-emscripten.lua b/pkgs/o/openkal-emscripten.lua index 0d7e1d41..51615a8a 100644 --- a/pkgs/o/openkal-emscripten.lua +++ b/pkgs/o/openkal-emscripten.lua @@ -46,6 +46,13 @@ package = { xpm = { linux = { + ["0.13.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz", + }, + sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb", + }, ["0.12.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz", @@ -146,6 +153,13 @@ package = { }, }, macosx = { + ["0.13.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz", + }, + sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb", + }, ["0.12.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz", @@ -246,6 +260,13 @@ package = { }, }, windows = { + ["0.13.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz", + }, + sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb", + }, ["0.12.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz", diff --git a/pkgs/o/openkal-linux.lua b/pkgs/o/openkal-linux.lua index a470c5f0..042c3c5e 100644 --- a/pkgs/o/openkal-linux.lua +++ b/pkgs/o/openkal-linux.lua @@ -19,6 +19,13 @@ package = { xpm = { linux = { + ["0.25.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz", + }, + sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e", + }, ["0.24.2"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz", @@ -238,6 +245,13 @@ package = { }, }, macosx = { + ["0.25.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz", + }, + sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e", + }, ["0.24.2"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz", @@ -457,6 +471,13 @@ package = { }, }, windows = { + ["0.25.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz", + }, + sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e", + }, ["0.24.2"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz", diff --git a/pkgs/o/openkal-macos.lua b/pkgs/o/openkal-macos.lua index 01daddee..55a4111d 100644 --- a/pkgs/o/openkal-macos.lua +++ b/pkgs/o/openkal-macos.lua @@ -19,6 +19,13 @@ package = { xpm = { linux = { + ["0.22.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz", + }, + sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415", + }, ["0.21.3"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz", @@ -245,6 +252,13 @@ package = { }, }, macosx = { + ["0.22.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz", + }, + sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415", + }, ["0.21.3"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz", @@ -471,6 +485,13 @@ package = { }, }, windows = { + ["0.22.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz", + }, + sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415", + }, ["0.21.3"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz", diff --git a/pkgs/o/openkal-windows.lua b/pkgs/o/openkal-windows.lua index a45c0bdb..30963148 100644 --- a/pkgs/o/openkal-windows.lua +++ b/pkgs/o/openkal-windows.lua @@ -21,6 +21,13 @@ package = { xpm = { linux = { + ["0.20.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz", + }, + sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6", + }, ["0.19.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz", @@ -247,6 +254,13 @@ package = { }, }, macosx = { + ["0.20.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz", + }, + sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6", + }, ["0.19.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz", @@ -473,6 +487,13 @@ package = { }, }, windows = { + ["0.20.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz", + }, + sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6", + }, ["0.19.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz", diff --git a/pkgs/o/openkal.lua b/pkgs/o/openkal.lua index ac900e05..7eefa7f8 100644 --- a/pkgs/o/openkal.lua +++ b/pkgs/o/openkal.lua @@ -22,6 +22,13 @@ package = { xpm = { linux = { + ["0.24.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz", + }, + sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405", + }, ["0.23.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz", @@ -185,6 +192,13 @@ package = { }, }, macosx = { + ["0.24.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz", + }, + sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405", + }, ["0.23.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz", @@ -348,6 +362,13 @@ package = { }, }, windows = { + ["0.24.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz", + }, + sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405", + }, ["0.23.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz", From 86535e8ef63d7b52df7d34747e26055270f5995d Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Fri, 6 Nov 2026 08:12:19 +0900 Subject: [PATCH 2/2] fix: prepare coordinated candidates in one consumer graph --- tests/autoupdate/ci.py | 35 ++++++++++++++++++++++++----------- tests/autoupdate/test_ci.py | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/tests/autoupdate/ci.py b/tests/autoupdate/ci.py index b28791e1..e8b0b62d 100644 --- a/tests/autoupdate/ci.py +++ b/tests/autoupdate/ci.py @@ -300,8 +300,24 @@ def archive_of(record): print(f"Candidate matrix: {len(jobs)} real build/run jobs.") +def replace_candidate(text: str, identity: str, version: str) -> str: + namespace, name = identity.split(":", 1) + text, replacements = re.subn( + 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). + text, replacements = re.subn( + rf'(?m)^(\s*platform\s*=\s*"(?:{re.escape(namespace)}\.)?{re.escape(name)}@)[^"]+(".*)$', + lambda m: m[1] + version + m[2], text) + if not replacements: + raise RuntimeError("candidate dependency was not replaced: " + identity) + return text + + def prepare(plan: Path, identity: str, output: Path, home: Path | None = None): - record = next(r for r in json.loads(plan.read_text(encoding="utf-8"))["packages"] if r["id"] == identity) + candidates = json.loads(plan.read_text(encoding="utf-8"))["packages"] + record = next(r for r in candidates if r["id"] == identity) namespace, name = identity.split(":", 1) version = record["candidate"] member = direct_member(identity) @@ -311,16 +327,13 @@ def prepare(plan: Path, identity: str, output: Path, home: Path | None = None): shutil.copytree(source, output, dirs_exist_ok=True, ignore=shutil.ignore_patterns("target", ".mcpp", "mcpp.lock")) text = (output / "mcpp.toml").read_text(encoding="utf-8") - text, replacements = re.subn( - 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): `platform = "@"`. - text, replacements = re.subn( - rf'(?m)^(\s*platform\s*=\s*"(?:{re.escape(namespace)}\.)?{re.escape(name)}@)[^"]+(".*)$', - lambda m: m[1] + version + m[2], text) - if not replacements: - raise RuntimeError("candidate dependency was not replaced") + # One change plan may advance an ABI group together. Replacing only + # this row creates a mixture the resolver correctly rejects. Apply + # exactly the planned candidates mapped to this same real consumer; + # unplanned dependencies retain the fixture's constraints. + for candidate in candidates: + if direct_member(candidate["id"]) == member: + text = replace_candidate(text, candidate["id"], candidate["candidate"]) # Standalone consumer: no inherited workspace or stale relative index redirects. text = re.sub(r'(?ms)^\[indices(?:\.[^\]]+)?\]\s*\n.*?(?=^\[|\Z)', '', text) else: diff --git a/tests/autoupdate/test_ci.py b/tests/autoupdate/test_ci.py index d0a5deec..d2b68d09 100644 --- a/tests/autoupdate/test_ci.py +++ b/tests/autoupdate/test_ci.py @@ -25,6 +25,43 @@ def descriptor(name): class BaselineTests(unittest.TestCase): + def test_one_consumer_uses_all_and_only_its_planned_candidates(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + source = root / "tests/examples/kernel" + source.mkdir(parents=True) + (source / "mcpp.toml").write_text( + '[package]\nname="kernel"\nversion="0.1.0"\n' + '[dependencies.mcpplibs]\nabi="0.23.0"\n' + '[target.linux.dependencies.mcpplibs]\nbackend="0.24.2"\n' + '[build-dependencies.compat]\nhelper="1.0.0"\n') + other = root / "tests/examples/other" + other.mkdir() + (other / "mcpp.toml").write_text( + '[package]\nname="other"\nversion="0.1.0"\n' + '[dependencies.compat]\nunrelated="1.0.0"\n') + plan = root / "plan.json" + candidates = [{"id": "mcpplibs:abi", "candidate": "0.24.0"}, + {"id": "mcpplibs:backend", "candidate": "0.25.0"}, + {"id": "compat:unrelated", "candidate": "2.0.0"}] + with patch.object(ci, "ROOT", root): + for identity in ("mcpplibs:abi", "mcpplibs:backend"): + plan.write_text(json.dumps({"packages": candidates})) + dest = root / identity.split(":")[1] + ci.prepare(plan, identity, dest) + manifest = tomllib.loads((dest / "mcpp.toml").read_text()) + self.assertEqual(manifest["dependencies"]["mcpplibs"]["abi"], "0.24.0") + self.assertEqual(manifest["target"]["linux"]["dependencies"]["mcpplibs"]["backend"], "0.25.0") + self.assertEqual(manifest["build-dependencies"]["compat"]["helper"], "1.0.0") + self.assertNotIn("unrelated", manifest.get("dependencies", {}).get("compat", {})) + # No implicit companion upgrade when it is absent from the plan. + plan.write_text(json.dumps({"packages": candidates[:1]})) + dest = root / "single" + ci.prepare(plan, "mcpplibs:abi", dest) + manifest = tomllib.loads((dest / "mcpp.toml").read_text()) + self.assertEqual(manifest["dependencies"]["mcpplibs"]["abi"], "0.24.0") + self.assertEqual(manifest["target"]["linux"]["dependencies"]["mcpplibs"]["backend"], "0.24.2") + def test_commit_snapshot_is_manual_but_historical_bytes_are_still_guarded(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory)