Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkgs/o/openkal-emscripten.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-linux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-macos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
35 changes: 24 additions & 11 deletions tests/autoupdate/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 = "<name>@<version>"`.
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:
Expand Down
37 changes: 37 additions & 0 deletions tests/autoupdate/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading