Skip to content

Commit 5306c42

Browse files
committed
docs(bench): xlings' deps do describe — the real boundary is a build-time generated module
1 parent 8055b93 commit 5306c42

2 files changed

Lines changed: 51 additions & 41 deletions

File tree

bench/projects/xlings/CMakeLists.txt

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@
2323
#
2424
# ⚠️ STATUS: CONFIGURES AND COMPILES xlings' OWN 110 UNITS; DOES NOT LINK.
2525
#
26-
# The blocker is not modules — it is dependency resolution, and it is worth
27-
# stating because it is the honest limit of a hand-written foreign description:
26+
# The dependencies themselves describe fine — every header one of them needs is
27+
# unpacked in mcpp's registry and the list below finds all of them, transitively
28+
# (mbedtls arrives via mcpplibs tinyhttps, lua via capi.lua).
2829
#
29-
# xlings declares 6 direct dependencies. Four ship source (mcpplibs cmdline /
30-
# xpkg / tinyhttps / capi.lua) and two ship source trees that mcpp builds
31-
# (ftxui, libarchive). Wiring those four in surfaced THEIR dependencies:
30+
# The blocker is one level past that, and it is specific:
3231
#
33-
# tinyhttps/src/tls.cppm:3 fatal error: mbedtls/ssl.h: No such file
34-
# capi.lua/.../lua_headers.h fatal error: lua.h: No such file
32+
# xpkg-executor.cppm:5 fatal error: unknown compiled module interface:
33+
# no such module [mcpplibs.xpkg.lua_stdlib]
3534
#
36-
# Following that graph to a link means reimplementing mcpp's package manager
37-
# inside a CMakeLists — and a hand-written version of it is stale on the first
38-
# upstream change, silently.
35+
# `mcpplibs.xpkg.lua_stdlib` is not a checked-in file. It is GENERATED at build
36+
# time by that package's `build.mcpp` program — mcpp's build-program protocol.
37+
# No foreign build system can produce it without implementing that protocol, so
38+
# this is not a gap in the description; it is the boundary of what a description
39+
# can be.
3940
#
4041
# So the xlings arm compares **mcpp against mcpp** (releases, schedules), which
4142
# is what a control target is for: it answers "does this engine change hold on a
@@ -160,29 +161,36 @@ xlings_add_source_dep(mcpplibs-x-xpkg 0.0.57)
160161
xlings_add_source_dep(mcpplibs-x-tinyhttps 0.2.9)
161162
xlings_add_source_dep(mcpplibs.capi-x-lua 0.0.3)
162163

163-
# ftxui and libarchive arrive as SOURCE trees, unpacked one level below the
164-
# version directory (`compat-x-ftxui/6.1.9/FTXUI-6.1.9/include`,
165-
# `compat-x-libarchive/3.8.7/libarchive-3.8.7/libarchive`) — not as prebuilt
166-
# libraries. Globbing `<ver>/include` finds nothing and the first importer dies
167-
# with `fatal error: ftxui/component/event.hpp: No such file or directory`.
168-
#
169-
# ⚠️ THIS ARM IS INCOMPLETE, and that is stated rather than papered over: mcpp
170-
# BUILDS these two from source through its own package machinery, and
171-
# reproducing that here means compiling ftxui and libarchive with cmake as well.
172-
# Until that is done, this description configures and compiles xlings' own units
173-
# but cannot LINK. The headers are wired so the compile phase — which is what
174-
# the module-graph benchmark measures — is comparable.
175-
foreach(pkg IN ITEMS compat-x-ftxui compat-x-libarchive)
176-
file(GLOB pkgdirs "${MCPP_XPKGS}/${pkg}/*")
177-
foreach(pkgdir IN LISTS pkgdirs)
178-
file(GLOB inner "${pkgdir}/*")
164+
# Header-providing packages.
165+
#
166+
# Each arrives as a SOURCE tree unpacked one level below the version directory —
167+
# `compat-x-ftxui/6.1.9/FTXUI-6.1.9/include`,
168+
# `compat-x-lua/5.4.7/lua-5.4.7/src` — so globbing `<ver>/include` finds nothing
169+
# and the failure surfaces on the first importer rather than on the glob.
170+
#
171+
# The list is TRANSITIVE, and it is written out rather than discovered because
172+
# the discovery is what mcpp's package manager does: xlings names 6 direct
173+
# dependencies, and wiring the four source ones in surfaced two more
174+
# (`mbedtls/ssl.h` for tinyhttps, `lua.h` for capi.lua). Naming them keeps this
175+
# description honest about what it is — a hand-maintained copy of a resolved
176+
# dependency set, which is exactly why bench/projects/ carries a description
177+
# only for trees this repository can keep correct.
178+
set(XLINGS_HEADER_PKGS
179+
compat-x-ftxui # ftxui/component/event.hpp
180+
compat-x-libarchive # archive.h
181+
compat-x-mbedtls # mbedtls/ssl.h (via mcpplibs tinyhttps)
182+
compat-x-lua) # lua.h (via mcpplibs capi.lua)
183+
184+
foreach(pkg IN LISTS XLINGS_HEADER_PKGS)
185+
file(GLOB pkgvers "${MCPP_XPKGS}/${pkg}/*")
186+
foreach(pkgver IN LISTS pkgvers)
187+
file(GLOB inner "${pkgver}/*")
179188
foreach(d IN LISTS inner)
180-
if(IS_DIRECTORY "${d}/include")
181-
target_include_directories(xlings PRIVATE "${d}/include")
182-
endif()
183-
if(IS_DIRECTORY "${d}/libarchive")
184-
target_include_directories(xlings PRIVATE "${d}/libarchive")
185-
endif()
189+
foreach(sub include src libarchive)
190+
if(IS_DIRECTORY "${d}/${sub}")
191+
target_include_directories(xlings PRIVATE "${d}/${sub}")
192+
endif()
193+
endforeach()
186194
endforeach()
187195
endforeach()
188196
endforeach()

bench/projects/xlings/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,21 @@ units, and compiles them. **It does not link**, and the reason is worth having
5555
written down, because it is the honest limit of a hand-written foreign build
5656
description rather than a gap in effort:
5757

58-
xlings declares **6 direct dependencies**. Four ship source (mcpplibs
59-
`cmdline` / `xpkg` / `tinyhttps` / `capi.lua`), two ship source trees that mcpp
60-
builds (`ftxui`, `libarchive`). Wiring the four in surfaced *their*
61-
dependencies:
58+
The dependencies themselves describe fine: every header they need is unpacked
59+
in mcpp's registry, and `CMakeLists.txt` finds all of them **transitively**
60+
`mbedtls` arrives through mcpplibs `tinyhttps`, `lua` through `capi.lua`.
61+
62+
The blocker is one level past that, and it is specific:
6263

6364
```
64-
tinyhttps/src/tls.cppm:3 fatal error: mbedtls/ssl.h: No such file or directory
65-
capi.lua/.../lua_headers.h fatal error: lua.h: No such file or directory
65+
xpkg-executor.cppm:5 fatal error: unknown compiled module interface: no such module
66+
[mcpplibs.xpkg.lua_stdlib]
6667
```
6768

68-
Following that graph to a link means reimplementing mcpp's package manager
69-
inside a CMakeLists — and a hand-written copy of it is stale on the first
70-
upstream change, silently.
69+
`mcpplibs.xpkg.lua_stdlib` **is not a checked-in file**. That package generates
70+
it at build time with a `build.mcpp` program — mcpp's build-program protocol. No
71+
foreign build system can produce it without implementing that protocol, so this
72+
is not a gap in the description; it is the boundary of what a description can be.
7173

7274
**So the xlings arm compares mcpp against mcpp** (two releases, or two
7375
schedules). That is what a control target is for: it answers *"does this engine

0 commit comments

Comments
 (0)