From ada97fc85246d474b193ae74a82896e4419e5321 Mon Sep 17 00:00:00 2001 From: tz12323 <2760686250@qq.com> Date: Sun, 11 Oct 2026 17:07:33 +0800 Subject: [PATCH 1/2] feat: add etl package fix: make onnxruntime CI build portable --- mcpp.toml | 1 + pkgs/c/compat.etl.lua | 56 +++++++++++++++++++++++++ tests/examples/etl/mcpp.toml | 8 ++++ tests/examples/etl/tests/containers.cpp | 29 +++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 pkgs/c/compat.etl.lua create mode 100644 tests/examples/etl/mcpp.toml create mode 100644 tests/examples/etl/tests/containers.cpp diff --git a/mcpp.toml b/mcpp.toml index a96c9edc..7f61ff16 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -179,6 +179,7 @@ members = [ "tests/examples/httplib-zstd", "tests/examples/msdfgen", "tests/examples/gtl", + "tests/examples/etl", "tests/examples/galay", "tests/examples/miniaudio", "tests/examples/nanosvg", diff --git a/pkgs/c/compat.etl.lua b/pkgs/c/compat.etl.lua new file mode 100644 index 00000000..e0a5d1ea --- /dev/null +++ b/pkgs/c/compat.etl.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for the Embedded Template Library (ETL), a +-- header-only collection of fixed-capacity containers and utilities for +-- resource-constrained systems. +-- +-- The upstream CMake target is INTERFACE-only and exposes `include/`, so a +-- small C anchor gives mcpp a buildable library target while consumers use +-- headers such as ``. +-- +-- ETL supports older language modes, but this package is built by mcpp, whose +-- supported C++ standard starts at C++20. The package therefore uses C++23 +-- for its anchor and remains compatible with C++20 consumers. +package = { + spec = "1", + namespace = "compat", + name = "etl", + description = "Embedded Template Library — fixed-capacity containers and utilities (header-only)", + licenses = {"MIT"}, + repo = "https://github.com/ETLCPP/etl", + type = "package", + + xpm = { + linux = { + ["20.49.0"] = { + url = "https://github.com/ETLCPP/etl/archive/refs/tags/20.49.0.tar.gz", + sha256 = "b3e7a5544795ec8f4a1b2ab46f6e88fdb78be5a07738f008ce11dd37ed14b6e4", + }, + }, + macosx = { + ["20.49.0"] = { + url = "https://github.com/ETLCPP/etl/archive/refs/tags/20.49.0.tar.gz", + sha256 = "b3e7a5544795ec8f4a1b2ab46f6e88fdb78be5a07738f008ce11dd37ed14b6e4", + }, + }, + windows = { + ["20.49.0"] = { + url = "https://github.com/ETLCPP/etl/archive/refs/tags/20.49.0.tar.gz", + sha256 = "b3e7a5544795ec8f4a1b2ab46f6e88fdb78be5a07738f008ce11dd37ed14b6e4", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + c_standard = "c11", + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/etl_anchor.c"] = [==[ +int mcpp_compat_etl_headers_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/etl_anchor.c" }, + targets = { ["etl"] = { kind = "lib" } }, + deps = {}, + }, +} diff --git a/tests/examples/etl/mcpp.toml b/tests/examples/etl/mcpp.toml new file mode 100644 index 00000000..be6872d7 --- /dev/null +++ b/tests/examples/etl/mcpp.toml @@ -0,0 +1,8 @@ +# ETL test project: exercise a fixed-capacity vector and a queue without +# requiring dynamic allocation from the library. +[package] +name = "etl-tests" +version = "0.1.0" + +[dependencies.compat] +etl = "20.49.0" diff --git a/tests/examples/etl/tests/containers.cpp b/tests/examples/etl/tests/containers.cpp new file mode 100644 index 00000000..67a6800d --- /dev/null +++ b/tests/examples/etl/tests/containers.cpp @@ -0,0 +1,29 @@ +// compat.etl — exercise ETL's fixed-capacity containers and their observable +// capacity/ordering behaviour. +#include +#include + +int main() { + etl::vector values; + values.push_back(3); + values.push_back(1); + values.push_back(4); + + if (values.size() != 3 || values.capacity() != 4 || + values[0] != 3 || values[2] != 4) { + return 1; + } + + etl::queue queue; + queue.push(10); + queue.push(20); + if (queue.front() != 10 || queue.back() != 20) { + return 2; + } + queue.pop(); + if (queue.front() != 20 || queue.size() != 1) { + return 3; + } + + return 0; +} From 01537b45085b1f96b4a87ef21993bb209d8600bd Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Tue, 13 Oct 2026 21:51:19 +0900 Subject: [PATCH 2/2] fix(etl): resolve checkout package and repair selected LLVM tray test --- .agents/docs/2026-10-13-add-etl-plan.md | 15 +++++++++++++++ README.md | 2 ++ README.zh-CN.md | 2 ++ tests/examples/etl/mcpp.toml | 3 +++ tests/examples/eui-neo-tray/tests/tray.cpp | 1 + 5 files changed, 23 insertions(+) create mode 100644 .agents/docs/2026-10-13-add-etl-plan.md diff --git a/.agents/docs/2026-10-13-add-etl-plan.md b/.agents/docs/2026-10-13-add-etl-plan.md new file mode 100644 index 00000000..3a89e61d --- /dev/null +++ b/.agents/docs/2026-10-13-add-etl-plan.md @@ -0,0 +1,15 @@ +# Add compat.etl + +ETL 20.49.0 is a MIT-licensed header-only upstream release. A generated C +anchor gives mcpp a library target and exposes the original include directory. +The three platform entries share the pinned archive and SHA-256. No optional +compiled sources exist, so no sources-only features are advertised. + +The GLOBAL URL is kept as a plain string; CN users fall back to upstream +until a byte-identical mirror is published. The example redirects compat to +this checkout and asserts fixed-capacity vector and queue ordering. + +Local validation: mcpp 2026.10.1.2, gcc 16.1.0, `mcpp test -p etl`: +`test result ok. 1 passed; 0 failed`. The original LLVM CI failure belonged +to eui-neo-tray, which used setenv without stdlib.h; the follow-up includes +that declaration so the already selected CI member compiles correctly. diff --git a/README.md b/README.md index 0459ca25..a25b5a51 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ the online index; open a PR and confirm CI is green. A PR runs lint and tests only the workspace members that depend on the changed descriptors; after the merge, `deploy-site` publishes the site. +Additional example: [`compat.etl`](pkgs/c/compat.etl.lua) — Header-only; [`consumer test`](tests/examples/etl/mcpp.toml). + ## Documentation - [Library shapes and descriptor templates](docs/package-types.md) diff --git a/README.zh-CN.md b/README.zh-CN.md index a996bda4..565432a1 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -59,6 +59,8 @@ agent(如 Claude Code)即可: 提交 PR 后,CI 执行 lint,并只测试依赖了被修改描述符的 workspace 成员;合并后,`deploy-site` 发布站点。 +新增示例: [`compat.etl`](pkgs/c/compat.etl.lua) — Header-only; [`消费测试`](tests/examples/etl/mcpp.toml)。 + ## 文档 - [库形态与描述符模板](docs/zh/package-types.md) diff --git a/tests/examples/etl/mcpp.toml b/tests/examples/etl/mcpp.toml index be6872d7..55d51641 100644 --- a/tests/examples/etl/mcpp.toml +++ b/tests/examples/etl/mcpp.toml @@ -6,3 +6,6 @@ version = "0.1.0" [dependencies.compat] etl = "20.49.0" + +[indices] +compat = { path = "../../.." } diff --git a/tests/examples/eui-neo-tray/tests/tray.cpp b/tests/examples/eui-neo-tray/tests/tray.cpp index 3da357b9..e2f37d16 100644 --- a/tests/examples/eui-neo-tray/tests/tray.cpp +++ b/tests/examples/eui-neo-tray/tests/tray.cpp @@ -42,6 +42,7 @@ #if defined(__linux__) #include +#include #include #endif