Skip to content

Commit abf3aee

Browse files
authored
Merge pull request #716 from mcpplibs/chore/observable-unit-source-group
chore: index the OpenKal 0.24 source group
2 parents 3821eb7 + 86535e8 commit abf3aee

7 files changed

Lines changed: 166 additions & 11 deletions

File tree

‎pkgs/o/openkal-emscripten.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ package = {
4646

4747
xpm = {
4848
linux = {
49+
["0.13.0"] = {
50+
url = {
51+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",
52+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz",
53+
},
54+
sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb",
55+
},
4956
["0.12.0"] = {
5057
url = {
5158
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",
@@ -146,6 +153,13 @@ package = {
146153
},
147154
},
148155
macosx = {
156+
["0.13.0"] = {
157+
url = {
158+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",
159+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz",
160+
},
161+
sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb",
162+
},
149163
["0.12.0"] = {
150164
url = {
151165
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",
@@ -246,6 +260,13 @@ package = {
246260
},
247261
},
248262
windows = {
263+
["0.13.0"] = {
264+
url = {
265+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.13.0.tar.gz",
266+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.13.0/openkal-emscripten-0.13.0.tar.gz",
267+
},
268+
sha256 = "0397a00f76612b4e1fd469ce7178fd0754b1988d80a71756730799a1c99d7adb",
269+
},
249270
["0.12.0"] = {
250271
url = {
251272
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",

‎pkgs/o/openkal-linux.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.25.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz",
26+
},
27+
sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e",
28+
},
2229
["0.24.2"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz",
@@ -238,6 +245,13 @@ package = {
238245
},
239246
},
240247
macosx = {
248+
["0.25.0"] = {
249+
url = {
250+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",
251+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz",
252+
},
253+
sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e",
254+
},
241255
["0.24.2"] = {
242256
url = {
243257
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz",
@@ -457,6 +471,13 @@ package = {
457471
},
458472
},
459473
windows = {
474+
["0.25.0"] = {
475+
url = {
476+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.25.0.tar.gz",
477+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.25.0/openkal-linux-0.25.0.tar.gz",
478+
},
479+
sha256 = "09e3b17b0ec7060145987d5048b79c734c60a3f85591c720dd8ed5016aa3613e",
480+
},
460481
["0.24.2"] = {
461482
url = {
462483
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.2.tar.gz",

‎pkgs/o/openkal-macos.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.22.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz",
26+
},
27+
sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415",
28+
},
2229
["0.21.3"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz",
@@ -245,6 +252,13 @@ package = {
245252
},
246253
},
247254
macosx = {
255+
["0.22.0"] = {
256+
url = {
257+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz",
258+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz",
259+
},
260+
sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415",
261+
},
248262
["0.21.3"] = {
249263
url = {
250264
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz",
@@ -471,6 +485,13 @@ package = {
471485
},
472486
},
473487
windows = {
488+
["0.22.0"] = {
489+
url = {
490+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.22.0.tar.gz",
491+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.22.0/openkal-macos-0.22.0.tar.gz",
492+
},
493+
sha256 = "341b1fe6f886ad8289da08835799382af79daf919b035c06b8c884d8a66e8415",
494+
},
474495
["0.21.3"] = {
475496
url = {
476497
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.3.tar.gz",

‎pkgs/o/openkal-windows.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.20.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz",
28+
},
29+
sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6",
30+
},
2431
["0.19.0"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",
@@ -247,6 +254,13 @@ package = {
247254
},
248255
},
249256
macosx = {
257+
["0.20.0"] = {
258+
url = {
259+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
260+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz",
261+
},
262+
sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6",
263+
},
250264
["0.19.0"] = {
251265
url = {
252266
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",
@@ -473,6 +487,13 @@ package = {
473487
},
474488
},
475489
windows = {
490+
["0.20.0"] = {
491+
url = {
492+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.20.0.tar.gz",
493+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.20.0/openkal-windows-0.20.0.tar.gz",
494+
},
495+
sha256 = "ae3f469d929eaf77f9e7a679132b68c42cd570a175b27fbdc608071b8831aaa6",
496+
},
476497
["0.19.0"] = {
477498
url = {
478499
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",

‎pkgs/o/openkal.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ package = {
2222

2323
xpm = {
2424
linux = {
25+
["0.24.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz",
29+
},
30+
sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405",
31+
},
2532
["0.23.0"] = {
2633
url = {
2734
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",
@@ -185,6 +192,13 @@ package = {
185192
},
186193
},
187194
macosx = {
195+
["0.24.0"] = {
196+
url = {
197+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz",
198+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz",
199+
},
200+
sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405",
201+
},
188202
["0.23.0"] = {
189203
url = {
190204
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",
@@ -348,6 +362,13 @@ package = {
348362
},
349363
},
350364
windows = {
365+
["0.24.0"] = {
366+
url = {
367+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.24.0.tar.gz",
368+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.24.0/openkal-0.24.0.tar.gz",
369+
},
370+
sha256 = "7e0f48e85611e6d9853f294fd5a33b6a9201b48cfb2f2bffad3f4d68c60ab405",
371+
},
351372
["0.23.0"] = {
352373
url = {
353374
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",

‎tests/autoupdate/ci.py‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,24 @@ def archive_of(record):
300300
print(f"Candidate matrix: {len(jobs)} real build/run jobs.")
301301

302302

303+
def replace_candidate(text: str, identity: str, version: str) -> str:
304+
namespace, name = identity.split(":", 1)
305+
text, replacements = re.subn(
306+
rf'(?m)^(\s*(?:{re.escape(name)}|"{re.escape(namespace)}\.{re.escape(name)}")\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
307+
lambda m: m[1] + version + m[2], text)
308+
if not replacements:
309+
# A platform the member selects (mcpp SPEC-013).
310+
text, replacements = re.subn(
311+
rf'(?m)^(\s*platform\s*=\s*"(?:{re.escape(namespace)}\.)?{re.escape(name)}@)[^"]+(".*)$',
312+
lambda m: m[1] + version + m[2], text)
313+
if not replacements:
314+
raise RuntimeError("candidate dependency was not replaced: " + identity)
315+
return text
316+
317+
303318
def prepare(plan: Path, identity: str, output: Path, home: Path | None = None):
304-
record = next(r for r in json.loads(plan.read_text(encoding="utf-8"))["packages"] if r["id"] == identity)
319+
candidates = json.loads(plan.read_text(encoding="utf-8"))["packages"]
320+
record = next(r for r in candidates if r["id"] == identity)
305321
namespace, name = identity.split(":", 1)
306322
version = record["candidate"]
307323
member = direct_member(identity)
@@ -311,16 +327,13 @@ def prepare(plan: Path, identity: str, output: Path, home: Path | None = None):
311327
shutil.copytree(source, output, dirs_exist_ok=True,
312328
ignore=shutil.ignore_patterns("target", ".mcpp", "mcpp.lock"))
313329
text = (output / "mcpp.toml").read_text(encoding="utf-8")
314-
text, replacements = re.subn(
315-
rf'(?m)^(\s*(?:{re.escape(name)}|"{re.escape(namespace)}\.{re.escape(name)}")\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
316-
lambda m: m[1] + version + m[2], text)
317-
if not replacements:
318-
# A platform the member selects (mcpp SPEC-013): `platform = "<name>@<version>"`.
319-
text, replacements = re.subn(
320-
rf'(?m)^(\s*platform\s*=\s*"(?:{re.escape(namespace)}\.)?{re.escape(name)}@)[^"]+(".*)$',
321-
lambda m: m[1] + version + m[2], text)
322-
if not replacements:
323-
raise RuntimeError("candidate dependency was not replaced")
330+
# One change plan may advance an ABI group together. Replacing only
331+
# this row creates a mixture the resolver correctly rejects. Apply
332+
# exactly the planned candidates mapped to this same real consumer;
333+
# unplanned dependencies retain the fixture's constraints.
334+
for candidate in candidates:
335+
if direct_member(candidate["id"]) == member:
336+
text = replace_candidate(text, candidate["id"], candidate["candidate"])
324337
# Standalone consumer: no inherited workspace or stale relative index redirects.
325338
text = re.sub(r'(?ms)^\[indices(?:\.[^\]]+)?\]\s*\n.*?(?=^\[|\Z)', '', text)
326339
else:

‎tests/autoupdate/test_ci.py‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,43 @@ def descriptor(name):
2525

2626

2727
class BaselineTests(unittest.TestCase):
28+
def test_one_consumer_uses_all_and_only_its_planned_candidates(self):
29+
with tempfile.TemporaryDirectory() as directory:
30+
root = Path(directory)
31+
source = root / "tests/examples/kernel"
32+
source.mkdir(parents=True)
33+
(source / "mcpp.toml").write_text(
34+
'[package]\nname="kernel"\nversion="0.1.0"\n'
35+
'[dependencies.mcpplibs]\nabi="0.23.0"\n'
36+
'[target.linux.dependencies.mcpplibs]\nbackend="0.24.2"\n'
37+
'[build-dependencies.compat]\nhelper="1.0.0"\n')
38+
other = root / "tests/examples/other"
39+
other.mkdir()
40+
(other / "mcpp.toml").write_text(
41+
'[package]\nname="other"\nversion="0.1.0"\n'
42+
'[dependencies.compat]\nunrelated="1.0.0"\n')
43+
plan = root / "plan.json"
44+
candidates = [{"id": "mcpplibs:abi", "candidate": "0.24.0"},
45+
{"id": "mcpplibs:backend", "candidate": "0.25.0"},
46+
{"id": "compat:unrelated", "candidate": "2.0.0"}]
47+
with patch.object(ci, "ROOT", root):
48+
for identity in ("mcpplibs:abi", "mcpplibs:backend"):
49+
plan.write_text(json.dumps({"packages": candidates}))
50+
dest = root / identity.split(":")[1]
51+
ci.prepare(plan, identity, dest)
52+
manifest = tomllib.loads((dest / "mcpp.toml").read_text())
53+
self.assertEqual(manifest["dependencies"]["mcpplibs"]["abi"], "0.24.0")
54+
self.assertEqual(manifest["target"]["linux"]["dependencies"]["mcpplibs"]["backend"], "0.25.0")
55+
self.assertEqual(manifest["build-dependencies"]["compat"]["helper"], "1.0.0")
56+
self.assertNotIn("unrelated", manifest.get("dependencies", {}).get("compat", {}))
57+
# No implicit companion upgrade when it is absent from the plan.
58+
plan.write_text(json.dumps({"packages": candidates[:1]}))
59+
dest = root / "single"
60+
ci.prepare(plan, "mcpplibs:abi", dest)
61+
manifest = tomllib.loads((dest / "mcpp.toml").read_text())
62+
self.assertEqual(manifest["dependencies"]["mcpplibs"]["abi"], "0.24.0")
63+
self.assertEqual(manifest["target"]["linux"]["dependencies"]["mcpplibs"]["backend"], "0.24.2")
64+
2865
def test_commit_snapshot_is_manual_but_historical_bytes_are_still_guarded(self):
2966
with tempfile.TemporaryDirectory() as directory:
3067
root = Path(directory)

0 commit comments

Comments
 (0)