Skip to content

Commit 5f20698

Browse files
committed
cortex-m-rt 0.2.0, and the C library packages at their own version
## cortex-m-rt: one package, two environments, three features mcpp run # the emulator mcpp run --features hardware # the board, over a debug probe mcpp run --features libc # with a C library A board reached through an emulator and the same board reached through a probe differ in the argv of their runners and in nothing else, so the environment is a feature rather than a second package. Each brings its own tool on the `run` tier, so a consumer downloads exactly what the feature they selected needs and a CI job that compiles firmware and never flashes it downloads nothing. ⚠️ And the board sets the thread pointer, which is what makes `libc` work. picolibc reaches `stdout` through thread-local storage; a freestanding image has none until the startup file sets one. Measured without it: a `printf` program linked cleanly, ran, printed NOTHING and hung. There is no diagnostic for that state. ## ⚠️⚠️ picolibc and compiler-rt-builtins move to 0.1.0, replacing the first entry The first release took UPSTREAM's version — 1.8.12, 22.1.8 — which is wrong in kind: a package's version has to move when the PACKAGING changes, and the packaging is most of what is there (the source selection, the exclusions, the feature split, the per-target blocks). `openkal-musl` is 0.13.1 for musl 1.2.5 for the same reason. Upstream's version is now in the description. ⚠️ The first entry is REMOVED rather than kept beside the new one, and that is an exception rather than the rule. It shipped a `path =` dependency left over from local testing: error: path dependency 'compiler-rt-builtins' (at '…/mcpplibs-x-picolibc/1.8.12/compiler-rt-builtins') has no mcpp.toml so it resolves to nothing on any machine without a sibling checkout. Keeping a version that cannot install is not compatibility. ⭐ Found by the sandbox, not by CI: `xlings subos … --sandbox` installed the engine from the published index and then could not resolve `cortex-m-rt`, because it had never been added here. That is the check the ecosystem needs and no repository's own CI performs. All four tarballs verified against their bytes and re-fetched from the CN mirror, byte-identical. Index lints pass.
1 parent f3df5f5 commit 5f20698

3 files changed

Lines changed: 122 additions & 26 deletions

File tree

pkgs/c/compiler-rt-builtins.lua

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,43 @@ package = {
1919
licenses = {"Apache-2.0 WITH LLVM-exception"},
2020
repo = "https://github.com/mcpplibs/compiler-rt-builtins",
2121
type = "package",
22-
22+
--
23+
-- ⚠️⚠️ 0.1.0 SUPERSEDES THE FIRST ENTRY, WHICH TOOK UPSTREAM'S VERSION. A
24+
-- package's version has to move when the PACKAGING changes, and the packaging
25+
-- is most of what is here — the source selection, the exclusions, the feature
26+
-- split, the per-target blocks. `openkal-musl` is 0.13.1 for musl 1.2.5 for the
27+
-- same reason.
28+
--
29+
-- The first entry is REMOVED rather than kept beside this one, and that is the
30+
-- exception rather than the rule: it shipped a `path =` dependency left over
31+
-- from local testing, so it resolves to nothing on any machine without a
32+
-- sibling checkout. Keeping a version that cannot install is not compatibility.
2333
xpm = {
2434
linux = {
25-
["22.1.8"] = {
35+
["0.1.0"] = {
2636
url = {
27-
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/22.1.8.tar.gz",
28-
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/22.1.8/compiler-rt-builtins-22.1.8.tar.gz",
37+
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/0.1.0.tar.gz",
38+
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/0.1.0/compiler-rt-builtins-0.1.0.tar.gz",
2939
},
30-
sha256 = "fe00cb58128c00a3a47483f30a828bed52f4a35529c1bb0d4cb8f0376c9c492d",
40+
sha256 = "38830e71265c64a67774c3fe424e3033cdf8845f49382bcf3ceeb363ec491b17",
3141
},
3242
},
3343
macosx = {
34-
["22.1.8"] = {
44+
["0.1.0"] = {
3545
url = {
36-
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/22.1.8.tar.gz",
37-
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/22.1.8/compiler-rt-builtins-22.1.8.tar.gz",
46+
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/0.1.0.tar.gz",
47+
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/0.1.0/compiler-rt-builtins-0.1.0.tar.gz",
3848
},
39-
sha256 = "fe00cb58128c00a3a47483f30a828bed52f4a35529c1bb0d4cb8f0376c9c492d",
49+
sha256 = "38830e71265c64a67774c3fe424e3033cdf8845f49382bcf3ceeb363ec491b17",
4050
},
4151
},
4252
windows = {
43-
["22.1.8"] = {
53+
["0.1.0"] = {
4454
url = {
45-
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/22.1.8.tar.gz",
46-
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/22.1.8/compiler-rt-builtins-22.1.8.tar.gz",
55+
GLOBAL = "https://github.com/mcpplibs/compiler-rt-builtins/archive/refs/tags/0.1.0.tar.gz",
56+
CN = "https://gitcode.com/mcpp-res/compiler-rt-builtins/releases/download/0.1.0/compiler-rt-builtins-0.1.0.tar.gz",
4757
},
48-
sha256 = "fe00cb58128c00a3a47483f30a828bed52f4a35529c1bb0d4cb8f0376c9c492d",
58+
sha256 = "38830e71265c64a67774c3fe424e3033cdf8845f49382bcf3ceeb363ec491b17",
4959
},
5060
},
5161
},

pkgs/c/cortex-m-rt.lua

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
-- Board support for Cortex-M: startup, memory layout, a semihosting console,
2+
-- and the runners that reach an emulator or a debug probe.
3+
--
4+
-- ⭐⭐ ONE PACKAGE, TWO ENVIRONMENTS — AND SINCE 0.2.0, THREE FEATURES.
5+
--
6+
-- A board reached through an emulator and the same board reached through a
7+
-- debug probe differ in the argv of their runners and in NOTHING else: the
8+
-- linker script, the startup code, the memory map and the exported module are
9+
-- the same board. Publishing two packages to vary four strings would duplicate
10+
-- all of it and let the copies drift. So the environment is a FEATURE, and the
11+
-- consumer selects it where it selects everything else:
12+
--
13+
-- mcpp run # the emulator
14+
-- mcpp run --features hardware # the board, over a debug probe
15+
-- mcpp run --features libc # with a C library
16+
--
17+
-- ⭐ `mcpp run` IS THE WHOLE OF THE COMMON CASE, ON EITHER. On a device,
18+
-- running a program means writing it, resetting, attaching to its output and
19+
-- reading its exit status — ONE command, not several. So that is the DEFAULT
20+
-- runner in both environments, and the command a developer types does not
21+
-- change when the board arrives. `flash` and `serve` are named exceptions, and
22+
-- the engine knows neither name.
23+
--
24+
-- ⚠️ EACH ENVIRONMENT BRINGS ITS OWN TOOL, ON THE `run` TIER. `qemu-arm` under
25+
-- `[feature-xlings.emulator]`, `probe-rs` under `[feature-xlings.hardware]`,
26+
-- both `when = "run"` — so a consumer downloads exactly what the feature they
27+
-- selected needs, and a CI job that compiles firmware and never flashes it
28+
-- downloads nothing at all. Requires mcpp 2026.9.4.2.
29+
--
30+
-- ⚠️ AND THE BOARD SETS THE THREAD POINTER, which is what makes `libc` work.
31+
-- picolibc reaches `stdout` through thread-local storage, and a freestanding
32+
-- image has none until the startup file sets one. Measured without it: a
33+
-- `printf` program linked cleanly, ran, printed NOTHING and hung. There is no
34+
-- diagnostic for that state; the only evidence is silence.
35+
package = {
36+
spec = "1",
37+
namespace = "mcpplibs",
38+
name = "cortex-m-rt",
39+
description = "Board support for Cortex-M: startup, memory layout, semihosting console, and the runners that reach an emulator or a debug probe",
40+
licenses = {"Apache-2.0"},
41+
repo = "https://github.com/mcpplibs/cortex-m-rt",
42+
type = "package",
43+
44+
xpm = {
45+
linux = {
46+
["0.2.0"] = {
47+
url = {
48+
GLOBAL = "https://github.com/mcpplibs/cortex-m-rt/archive/refs/tags/0.2.0.tar.gz",
49+
CN = "https://gitcode.com/mcpp-res/cortex-m-rt/releases/download/0.2.0/cortex-m-rt-0.2.0.tar.gz",
50+
},
51+
sha256 = "00fa47d420e52b608805bbdb54e538e80ad727b0c214abe14ef61f29f2aabccb",
52+
},
53+
},
54+
macosx = {
55+
["0.2.0"] = {
56+
url = {
57+
GLOBAL = "https://github.com/mcpplibs/cortex-m-rt/archive/refs/tags/0.2.0.tar.gz",
58+
CN = "https://gitcode.com/mcpp-res/cortex-m-rt/releases/download/0.2.0/cortex-m-rt-0.2.0.tar.gz",
59+
},
60+
sha256 = "00fa47d420e52b608805bbdb54e538e80ad727b0c214abe14ef61f29f2aabccb",
61+
},
62+
},
63+
windows = {
64+
["0.2.0"] = {
65+
url = {
66+
GLOBAL = "https://github.com/mcpplibs/cortex-m-rt/archive/refs/tags/0.2.0.tar.gz",
67+
CN = "https://gitcode.com/mcpp-res/cortex-m-rt/releases/download/0.2.0/cortex-m-rt-0.2.0.tar.gz",
68+
},
69+
sha256 = "00fa47d420e52b608805bbdb54e538e80ad727b0c214abe14ef61f29f2aabccb",
70+
},
71+
},
72+
},
73+
74+
-- The package's own manifest, inside the tarball's wrap directory.
75+
mcpp = "*/mcpp.toml",
76+
}

pkgs/p/picolibc.lua

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,43 @@ package = {
3636
licenses = {"BSD-3-Clause", "BSD-2-Clause"},
3737
repo = "https://github.com/mcpplibs/picolibc",
3838
type = "package",
39-
39+
--
40+
-- ⚠️⚠️ 0.1.0 SUPERSEDES THE FIRST ENTRY, WHICH TOOK UPSTREAM'S VERSION. A
41+
-- package's version has to move when the PACKAGING changes, and the packaging
42+
-- is most of what is here — the source selection, the exclusions, the feature
43+
-- split, the per-target blocks. `openkal-musl` is 0.13.1 for musl 1.2.5 for the
44+
-- same reason.
45+
--
46+
-- The first entry is REMOVED rather than kept beside this one, and that is the
47+
-- exception rather than the rule: it shipped a `path =` dependency left over
48+
-- from local testing, so it resolves to nothing on any machine without a
49+
-- sibling checkout. Keeping a version that cannot install is not compatibility.
4050
xpm = {
4151
linux = {
42-
["1.8.12"] = {
52+
["0.1.0"] = {
4353
url = {
44-
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/1.8.12.tar.gz",
45-
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/1.8.12/picolibc-1.8.12.tar.gz",
54+
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/0.1.0.tar.gz",
55+
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/0.1.0/picolibc-0.1.0.tar.gz",
4656
},
47-
sha256 = "8f3d7a41d9981905d389b321edbfa2fac4946e5acc3a0677617b8184b21d4420",
57+
sha256 = "e64a9a99657723a135203c1ae08d31a2dd61f613b548e03c51a5e9072af58f78",
4858
},
4959
},
5060
macosx = {
51-
["1.8.12"] = {
61+
["0.1.0"] = {
5262
url = {
53-
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/1.8.12.tar.gz",
54-
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/1.8.12/picolibc-1.8.12.tar.gz",
63+
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/0.1.0.tar.gz",
64+
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/0.1.0/picolibc-0.1.0.tar.gz",
5565
},
56-
sha256 = "8f3d7a41d9981905d389b321edbfa2fac4946e5acc3a0677617b8184b21d4420",
66+
sha256 = "e64a9a99657723a135203c1ae08d31a2dd61f613b548e03c51a5e9072af58f78",
5767
},
5868
},
5969
windows = {
60-
["1.8.12"] = {
70+
["0.1.0"] = {
6171
url = {
62-
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/1.8.12.tar.gz",
63-
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/1.8.12/picolibc-1.8.12.tar.gz",
72+
GLOBAL = "https://github.com/mcpplibs/picolibc/archive/refs/tags/0.1.0.tar.gz",
73+
CN = "https://gitcode.com/mcpp-res/picolibc/releases/download/0.1.0/picolibc-0.1.0.tar.gz",
6474
},
65-
sha256 = "8f3d7a41d9981905d389b321edbfa2fac4946e5acc3a0677617b8184b21d4420",
75+
sha256 = "e64a9a99657723a135203c1ae08d31a2dd61f613b548e03c51a5e9072af58f78",
6676
},
6777
},
6878
},

0 commit comments

Comments
 (0)