Skip to content
Open
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
39 changes: 27 additions & 12 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ on:
workflow_dispatch:

env:
# 0.0.106: SPEC-001 package identity (mcpp#280). `package.name` is a SINGLE
# ATOMIC SEGMENT — all hierarchy lives in `package.namespace` — and mcpp
# addresses a package by the LITERAL name it read, so descriptors no longer
# repeat their namespace inside `name`. This index is migrated to the short
# form, which is why min_mcpp/latest_mcpp move in lock-step: an older client
# re-derives `<ns>.<short>`, misses, and reports a bare E_NOT_FOUND. Bundles
# xlings 0.4.69, which keys its index by (namespace, name) so two packages
# sharing a short name in one index are both addressable (xlings#381) — this
# index now has three such pairs (imgui / ffmpeg / lua under compat vs the
# default namespace).
# 0.0.102: windows command-line ceiling (mcpp#261 — the clang scan rule got
# its P1689 JSON through shell redirection, which forced a `cmd /c` wrapper
# and with it cmd.exe's 8191-char limit; clang-scan-deps -o removes both, and
Expand Down Expand Up @@ -47,7 +57,7 @@ env:
# 0.0.94 fixed feature-gated `sources` under `mcpp test` (mcpp#218); 0.0.91
# added standard = "c++fly" to the resolver grammar, so c++fly descriptors
# get the lint WARN below, not a hard grammar-parse rejection.
MCPP_VERSION: "0.0.102"
MCPP_VERSION: "0.0.107"

jobs:
lint:
Expand Down Expand Up @@ -90,14 +100,11 @@ jobs:
if ! lua5.4 tests/check_mirror_urls.lua "$f"; then
fail=1
fi
# 5. `name` must be the fully-qualified `<namespace>.<short>`.
# The split form (namespace = "chriskohlhoff", name = "asio")
# parses and passes `mcpp xpkg parse`, but xlings keys the index
# on the literal `name` while mcpp asks for the reconstructed
# FQN — they never meet, so the package is uninstallable on
# every platform (mcpp-community/mcpp#278). This check is cheap
# and catches in seconds what otherwise fails an hour into the
# workspace job.
# 5. `name` must be a SINGLE ATOMIC SEGMENT; hierarchy belongs in
# `namespace` (mcpp SPEC-001 §3.2). The legacy fully-qualified
# spelling stays accepted. Cheap second gate: it runs before the
# pinned mcpp is even downloaded, and mcpp >= 0.0.106 enforces
# the same rule inside `mcpp xpkg parse`.
if ! lua5.4 tests/check_package_name.lua "$f"; then
fail=1
fi
Expand All @@ -115,6 +122,14 @@ jobs:
done
[ $fail -eq 0 ] && echo "All package files valid."
exit $fail
# ── Whole-repository check (needs every descriptor at once) ──────
# An install() hook addressing a sibling package does so by
# `<namespace>:<literal package.name>`, and a miss returns nil rather
# than raising — so a stale spelling surfaces far downstream (a broken
# libxcb showed up as a libX11 link error). Verified across the repo
# because it needs the full set of declared identities.
- name: Lint cross-package references
run: lua5.4 tests/check_cross_package_refs.lua pkgs/*/*.lua
# ── Single-source-of-truth grammar check ─────────────────────────
# `mcpp xpkg parse` uses EXACTLY the resolver's parser, so what
# passes here is what builds for users of the pinned MCPP_VERSION.
Expand Down Expand Up @@ -207,21 +222,21 @@ jobs:
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
mcpp_version: "0.0.102" # keep in sync with env.MCPP_VERSION
mcpp_version: "0.0.107" # keep in sync with env.MCPP_VERSION
- platform: macos
os: macos-15
suffix: macosx-arm64
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
mcpp_version: "0.0.102" # keep in sync with env.MCPP_VERSION
mcpp_version: "0.0.107" # keep in sync with env.MCPP_VERSION
- platform: windows
os: windows-latest
suffix: windows-x86_64
ext: zip
mcpp: bin/mcpp.exe
xlings: registry/bin/xlings.exe
mcpp_version: "0.0.102" # keep in sync with env.MCPP_VERSION
mcpp_version: "0.0.107" # keep in sync with env.MCPP_VERSION
env:
MCPP_EFFECTIVE: ${{ matrix.mcpp_version }}
steps:
Expand Down
24 changes: 23 additions & 1 deletion docs/repository-and-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tests/examples/<member>/ 每库测试工程(workspace 成员;<member> 为包
([target.'cfg(...)'])
tests/*.cpp 行为断言(独立 main,退出码非 0 即失败)
tests/check_mirror_urls.lua lint:GLOBAL+CN 表完整性,以及 CN 指向 mcpp-res
tests/check_package_name.lua lint:身份形态(name 为单一原子段,层级归 namespace)
tests/list_cn_urls.lua 抽取 CN url,供 mirror-cn-reachable 使用
README.md 索引说明与贡献入口
.github/workflows/validate.yml CI:lint / mirror-cn-reachable / workspace(3 平台矩阵)
Expand All @@ -37,6 +38,24 @@ tools/compat-ffmpeg/ 等 compat 大包的描述符再生成流水线

`package` 必填字段:`spec`、`namespace`、`name`、`description`、`licenses`、`repo`、`type="package"`、`xpm`、`mcpp`。

### 包身份:`(namespace, name)`

身份是二元组 —— **`namespace` 是点分层级路径,`name` 是单一原子段**。层级一律放 `namespace`(mcpp SPEC-001 §3.2,`docs/spec/package-identity.md`):

```lua
namespace = "compat", name = "zlib" -- ✅
namespace = "mcpplibs.capi", name = "lua" -- ✅ 多级命名空间
namespace = "mcpplibs", name = "capi.lua" -- ❌ 短名仍带点
```

最后一种被拒绝而非重新解读:`name` 里多出的点描述的是一个**没人声明过的命名空间**。mcpp 曾按最后一个点切分、静默造出 `(mcpplibs.capi, lua)`,0.0.106 起改为拒绝。

**兼容形态**:SPEC-001 之前发布的描述符把命名空间重复写在 `name` 里(`namespace="compat", name="compat.zlib"`),仍被接受 —— 前缀会先剥离再判定,wire key 是字面 `name`,两种写法都可安装。本仓已统一迁到短名形态。

**同短名不同命名空间可共存**:本仓现有三对 —— `compat:imgui` 与默认命名空间的 `imgui`、`compat:ffmpeg` 与 `ffmpeg`、`compat:lua` 与 `mcpplibs.capi:lua`。需要 xlings ≥ 0.4.69([xlings#381](https://github.com/openxlings/xlings/issues/381));`(namespace, name)` 唯一即可,`name` 本身不必唯一。

**文件名不参与解析**,可以任意。推荐 `<name>.lua` 或 `<namespace>.<name>.lua`(命中 mcpp 的快路径),但描述符按**声明的身份**被发现,叫别的名字也能解析。

`xpm.<linux|macosx|windows>.<裸版本>`:

- `url`:字符串,或 `{ GLOBAL=…, CN=… }` 表(本仓统一使用表形式)。
Expand Down Expand Up @@ -76,7 +95,9 @@ mcpp 跑 `xpkg parse`(strict:未知键即失败),所以需要更新文法/键的
- 触发条件:PR(改动 `pkgs/**/*.lua`、`tests/**`、`README.md` 或本 workflow)、push 至 main、nightly cron、手动触发。
- `env.MCPP_VERSION` 为全部 job 使用的 mcpp 版本,本地验证应与之对齐。
- `lint`(始终运行):lua 语法 `loadfile(f,'t')`;须含 `spec=`/`name=`/`xpm=`;禁止前导 v 版本;执行
`check_mirror_urls.lua`;再用 CI pin 的 mcpp 对每个描述符跑 `mcpp xpkg parse`(strict,未知键即失败)。
`check_mirror_urls.lua`;执行 `check_package_name.lua`(身份形态,见上文「包身份」);再用 CI pin 的
mcpp 对每个描述符跑 `mcpp xpkg parse`(strict,未知键即失败)。mcpp ≥ 0.0.106 的 `xpkg parse` 自身
也强制身份形态,lua lint 因此是更早、更便宜的冗余闸门。
- `mirror-cn-reachable`(始终运行):逐个 `curl` CN url,均须返回 200。
- `workspace (linux|macos|windows)`:整个测试面就是一个 mcpp workspace,**唯一的构建/运行通道**——
没有任何 shell 驱动的例外(公开模块包 imgui/ffmpeg/opencv/tinyhttps 也是普通成员,经成员级
Expand All @@ -96,6 +117,7 @@ for f in pkgs/*/*.lua; do
for n in 'spec *=' 'name *=' 'xpm *='; do grep -q "$n" "$f" || { echo "MISS $n $f"; fail=1; }; done
grep -nqE '\["v[0-9]+|\["[^"]+"\][[:space:]]*=[[:space:]]*"v[0-9]+' "$f" && { echo "LEADING-V $f"; fail=1; }
lua5.4 tests/check_mirror_urls.lua "$f" >/dev/null 2>&1 || { echo "MIRROR $f"; fail=1; }
lua5.4 tests/check_package_name.lua "$f" || fail=1
done
[ $fail -eq 0 ] && echo "ALL LINT PASS"
```
Expand Down
4 changes: 2 additions & 2 deletions index.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# "floor first, new grammar after" rollout rule mechanically.
[index]
spec = "1"
min_mcpp = "0.0.102"
latest_mcpp = "0.0.102"
min_mcpp = "0.0.107"
latest_mcpp = "0.0.107"
2 changes: 1 addition & 1 deletion pkgs/c/chriskohlhoff.asio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ package = {
-- identity normalizes both spellings) but registers the index entry under
-- `asio`, which no consumer request can ever hit → E_NOT_FOUND at install.
-- See mcpp-community/mcpp#278; the lint in validate.yml enforces this.
name = "chriskohlhoff.asio",
name = "asio",
description = "Standalone asio exposed as the C++23 module `asio` (separate compilation)",
licenses = {"BSL-1.0"},
repo = "https://github.com/chriskohlhoff/asio",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/cmdline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package = {
spec = "1",
namespace = "mcpplibs",
name = "mcpplibs.cmdline",
name = "cmdline",
description = "A simple command-line parsing library/framework for modern C++",
licenses = {"Apache-2.0"},
repo = "https://github.com/mcpplibs/cmdline",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.bzip2.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.bzip2",
name = "bzip2",
description = "A freely available high-quality data compressor",
licenses = {"bzip2-1.0.6"},
repo = "https://sourceware.org/bzip2/",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.cjson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.cjson",
name = "cjson",
description = "Ultralightweight JSON parser in ANSI C",
licenses = {"MIT"},
repo = "https://github.com/DaveGamble/cJSON",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.eigen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.eigen",
name = "eigen",
description = "C++ template library for linear algebra (header-only)",
licenses = {"MPL-2.0"},
repo = "https://gitlab.com/libeigen/eigen",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.ffmpeg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-- include_dirs_after (-idirafter, mcpp#249) so libc++ <version> is not shadowed
-- by ffmpeg's VERSION file on case-insensitive macOS.
package = {
spec = "1", namespace = "compat", name = "compat.ffmpeg",
spec = "1", namespace = "compat", name = "ffmpeg",
description = "FFmpeg 8.1.2 multimedia libraries, full source build (LGPL profile, multi-platform)",
licenses = {"LGPL-2.1-or-later"}, repo = "https://ffmpeg.org", type = "package",
xpm = {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.ftxui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.ftxui",
name = "ftxui",
description = "C++ Functional Terminal User Interface (screen + dom + component)",
licenses = {"MIT"},
repo = "https://github.com/ArthurSonzogni/FTXUI",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.glfw.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.glfw",
name = "glfw",
description = "GLFW windowing and input library built from upstream sources",
licenses = {"Zlib"},
repo = "https://github.com/glfw/glfw",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.glx-runtime.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.glx-runtime",
name = "glx-runtime",
description = "Host GLVND/GLX/OpenGL runtime adapter for mcpp Linux window applications",
licenses = {"MIT"},
repo = "https://github.com/KhronosGroup/OpenGL-Registry",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.gtest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.gtest",
name = "gtest",
description = "Google's C++ test framework",
licenses = {"BSD-3-Clause"},
repo = "https://github.com/google/googletest",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.imgui.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.imgui",
name = "imgui",
description = "Dear ImGui immediate-mode GUI library core sources",
licenses = {"MIT"},
repo = "https://github.com/ocornut/imgui",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.khrplatform.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.khrplatform",
name = "khrplatform",
description = "Khronos KHR platform header for OpenGL/EGL compat packages",
licenses = {"Khronos"},
repo = "https://github.com/KhronosGroup/EGL-Registry",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.libarchive.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.libarchive",
name = "libarchive",
description = "Multi-format archive and compression library",
licenses = {"BSD-2-Clause", "BSD-3-Clause", "BSD-2-Clause-NetBSD", "CC0-1.0", "OpenSSL", "Apache-2.0", "public-domain"},
repo = "https://libarchive.org/",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.lua",
name = "lua",
description = "A powerful, efficient, lightweight, embeddable scripting language",
licenses = {"MIT"},
repo = "https://www.lua.org",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.lz4.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.lz4",
name = "lz4",
description = "LZ4 extremely fast compression",
licenses = {"BSD-2-Clause"},
repo = "https://github.com/lz4/lz4",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.mbedtls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.mbedtls",
name = "mbedtls",
description = "An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API",
licenses = {"Apache-2.0"},
repo = "https://github.com/Mbed-TLS/mbedtls",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.openblas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.openblas",
name = "openblas",
description = "OpenBLAS — optimized BLAS, built from source (BLAS-only, no Fortran/LAPACK)",
licenses = {"BSD-3-Clause"},
repo = "https://github.com/OpenMathLib/OpenBLAS",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.opengl.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.opengl",
name = "opengl",
description = "Khronos OpenGL API headers for mcpp packages",
licenses = {"MIT"},
repo = "https://github.com/KhronosGroup/OpenGL-Registry",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.spdlog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.spdlog",
name = "spdlog",
description = "Fast C++ logging library (header-only by default, compiled via the `compiled` feature)",
licenses = {"MIT"},
repo = "https://github.com/gabime/spdlog",
Expand Down
14 changes: 10 additions & 4 deletions pkgs/c/compat.x11.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.x11",
name = "x11",
description = "Xlib runtime library and public headers built from upstream sources",
licenses = {"BSD-1-Clause", "HPND-sell-variant", "ISC", "MIT", "MIT-Open-Group", "X11"},
repo = "https://gitlab.freedesktop.org/xorg/lib/libx11",
Expand Down Expand Up @@ -640,10 +640,16 @@ local function write_config(installdir)
end

local function generate_ks_tables(installdir)
local proto_dir = pkginfo.install_dir("compat:compat.xorgproto", "2025.1")
-- Addressed by declared identity `<namespace>:<package.name>` — see the
-- same ladder in compat.xcb.lua. The trailing spellings are pre-SPEC-001.
local proto_dir = pkginfo.install_dir("compat:xorgproto", "2025.1")
or pkginfo.install_dir("compat:compat.xorgproto", "2025.1")
or pkginfo.install_dir("compat.xorgproto", "2025.1")
if not proto_dir then
log.error("compat.xorgproto@2025.1 install dir not found")
-- `os.isdir` matters as much as the nil check: a miss can hand back a
-- plausible path that was never populated, and the keysym tables would
-- then be generated empty instead of the build failing here.
if not proto_dir or not os.isdir(proto_dir) then
log.error("xorgproto@2025.1 install dir not found")
return false
end

Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.xau.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.xau",
name = "xau",
description = "X authorization file management library",
licenses = {"MIT-Open-Group"},
repo = "https://gitlab.freedesktop.org/xorg/lib/libxau",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.xcb-proto.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.xcb-proto",
name = "xcb-proto",
description = "XCB protocol XML descriptions and xcbgen generator",
licenses = {"MIT"},
repo = "https://gitlab.freedesktop.org/xorg/proto/xcbproto",
Expand Down
13 changes: 10 additions & 3 deletions pkgs/c/compat.xcb.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package = {
spec = "1",
namespace = "compat",
name = "compat.xcb",
name = "xcb",
description = "X C Binding core library built from upstream sources",
licenses = {"MIT"},
repo = "https://gitlab.freedesktop.org/xorg/lib/libxcb",
Expand Down Expand Up @@ -135,10 +135,17 @@ function install()
os.tryrm(pkginfo.install_dir())
os.mv(srcroot, pkginfo.install_dir())

local proto_dir = pkginfo.install_dir("compat:compat.xcb-proto", "1.17.0")
-- A cross-package lookup addresses the sibling by its DECLARED identity
-- `<namespace>:<package.name>`. Since SPEC-001 that is `compat:xcb-proto`;
-- the two `compat.xcb-proto` spellings below are the pre-SPEC-001 forms,
-- kept so this descriptor still resolves against an index that has not
-- migrated yet. Getting this wrong is silent until install time: the
-- lookup simply misses and codegen has no protocol XML to read.
local proto_dir = pkginfo.install_dir("compat:xcb-proto", "1.17.0")
or pkginfo.install_dir("compat:compat.xcb-proto", "1.17.0")
or pkginfo.install_dir("compat.xcb-proto", "1.17.0")
if not proto_dir or not os.isdir(proto_dir) then
log.error("compat.xcb-proto@1.17.0 install dir not found")
log.error("xcb-proto@1.17.0 install dir not found")
return false
end

Expand Down
Loading
Loading