Skip to content

feat(ftxui): add 7.0.3 - #292

Merged
Sunrisepeak merged 3 commits into
mcpplibs:mainfrom
FarnaHerry:feat/ftxui-7.0.3
Sep 1, 2026
Merged

feat(ftxui): add 7.0.3#292
Sunrisepeak merged 3 commits into
mcpplibs:mainfrom
FarnaHerry:feat/ftxui-7.0.3

Conversation

@FarnaHerry

@FarnaHerry FarnaHerry commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

What

Adds FTXUI 7.0.3 (latest upstream release, 2026-08-06) alongside the existing 6.1.9, and bumps the core smoke member to it.

Descriptor impact

  • Layout unchanged: include/ftxui + src/ftxui/{screen,dom,component,util}, so the 6.1.9 globs apply verbatim. Test/fuzzer exclusions still cover 7.0.3's 47 *_test.cpp / 6 *_fuzzer.cpp.
  • Public API source-compatible for what the smoke test uses (hbox/text/separator, Dimension::Fit, Screen::Create(Dimensions, Dimensions), Render) — runtime.cpp needs no change.
  • Modules deliberately NOT enabled: 7.0.3 ships upstream .cppm units, and an earlier revision of this PR compiled them (import ftxui; worked on the llvm/macos/windows legs). The linux GCC leg failed: upstream's units put libstdc++ headers textually in the global module fragment, and GCC 16 cannot consume overlapping GMFs from the four sub-module BMIs (redefinitions of std::__terminate, std::allocator, …). Upstream's own CI builds modules llvm-only (# TODO add gcc / msvc in build.yaml), so the module units stay out until upstream supports more than clang.

The one skew: loop.cpp

FTXUI 7 moved Loop's method definitions from loop.cpp into app.cpp and dropped loop.cpp from the CMake build — but the stale file still ships in the 7.0.3 tarball. Our glob compiles it, duplicating Loop::{~Loop,RunOnce,...} at the consumer's link (a dependency's objects all enter the link; no lazy archive selection). 6.1.9 has no app.cpp and genuinely needs loop.cpp, and there are no per-version build blocks yet (mcpp-community/mcpp#290).

Fix: a small install() hook (same normalisation pattern as compat.eui-neo) deletes loop.cpp only when app.cpp exists — exactly the 7.x layout — keeping 6.1.9 intact.

CN mirror

Not published to mcpp-res; plain-string GLOBAL fallback (same precedent as eui-neo 0.5.7). sha256 double-checked against the GitHub tag archive: e7c62ffe19009759821b4f0f8df7f2a6fb83784c3a9f1477d81f56d3ee723c88.

Local verification (mcpp 2026.8.29.1)

  • mcpp test -p coreok on 7.0.3 (ftxui builds, smoke assertions pass)
  • mcpp test -p core re-pointed at 6.1.9ok through the new hook (loop.cpp kept)
  • Lints: check_mirror_urls, check_package_name, check_platform_version_parity, check_duplicate_versions, check_cross_package_refs, mcpp xpkg parse — all green

Source layout is unchanged (include/ftxui + src/ftxui/{screen,dom,
component,util}), so the 6.1.9 globs apply verbatim, and the public header
API the core smoke test uses (hbox/text/separator, Dimension::Fit,
Screen::Create(Dimensions, Dimensions), Render) is source-compatible with
6.1.9. Upstream added C++20 module units (src/ftxui/*.cppm,
FTXUI_BUILD_MODULES off by default); the `*.cpp` globs never match them.
7.0.3 ships 47 *_test.cpp / 6 *_fuzzer.cpp, still covered by the existing
exclusions.

One skew the globs cannot express (no per-version build blocks,
mcpp-community/mcpp#290): FTXUI 7 moved Loop's method definitions from
loop.cpp into app.cpp and dropped loop.cpp from the CMake build, but the
stale file still ships in the 7.0.3 tarball. Compiling both duplicates
Loop::{~Loop,RunOnce,...} at the consumer's link (a dependency's objects
all enter the link — no lazy archive selection). 6.1.9 has no app.cpp and
genuinely needs loop.cpp, so a small install() hook (same normalisation
pattern as compat.eui-neo) deletes loop.cpp only when app.cpp exists —
exactly the 7.x layout.

No CN mirror yet (never published to mcpp-res); plain-string GLOBAL
fallback, same as eui-neo 0.5.7. sha256 double-checked against the GitHub
tag archive.

Verified locally (mcpp 2026.8.29.1): `mcpp test -p core` passes on both
7.0.3 and 6.1.9 (the latter through the new hook, confirming loop.cpp is
kept there); check_mirror_urls, check_package_name,
check_platform_version_parity, check_duplicate_versions,
check_cross_package_refs and `mcpp xpkg parse` all green.
Upstream's new C++20 module units (src/ftxui/*.cppm) join the sources, so
7.0.3 consumers can `import ftxui;` — they are global-fragment includes +
`using` re-exports, every declaration stays attached to the global module,
and `#include`/`import` mix freely against the same compiled objects. On
6.1.9 the .cppm globs are zero-hit warnings (redis-plus-plus union
precedent). A new CompatModule smoke test imports ftxui and renders.

Verified locally (mcpp 2026.8.29.1): `mcpp test -p core` passes on 7.0.3
(both #include and `import ftxui;` smoke tests) and on 6.1.9 (loop.cpp
kept, zero-hit .cppm globs are warnings); `mcpp xpkg parse` green.
Comment thread pkgs/c/compat.ftxui.lua

import("xim.libxpkg.pkginfo")

function install()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里看 install hook 只是移动了目录, 好像没有其他额外功能,是不是可以省去

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 hook 除了保持默认解包目录结构外,还会在检测到 7.x 的 app.cpp 时删除 tarball 中遗留的 loop.cpp。FTXUI 7.0.3 同时编译 app.cpploop.cpp 会产生 Loop::* 重复定义,而 6.1.9 仍然需要 loop.cpp。目前描述符还不能按版本声明不同的 sourcesmcpp-community/mcpp#290),所以暂时需要在 install hook 中处理这个版本差异。这里的目录移动是自定义 install hook 接管默认安装流程后,为保持原有 */ glob 解包结构所需的。基于这个兼容约束,是否可以保留该 hook?我也可以进一步精简注释,让删除 loop.cpp 的目的更突出。

@Sunrisepeak
Sunrisepeak merged commit bd08677 into mcpplibs:main Sep 1, 2026
11 checks passed
Sunrisepeak pushed a commit that referenced this pull request Sep 1, 2026
FTXUI 7 ships upstream's own module units — an `ftxui` umbrella re-exporting
ftxui.component/.dom/.screen/.util — and #292 left them out after an
unconditional attempt went red on the linux gcc leg. They come back here
behind an opt-in `modules` feature whose source list is exactly upstream's
cmake/ftxui_modules.cmake: five .cppm, a pure addition that cannot collide
with the base **/*.cpp globs, so the default build does not move (76 compiled
units without the feature, 81 with).

What that gcc leg was reporting is narrower than "GCC 16 cannot consume these
modules". The sub-modules put the public headers, and transitively libstdc++,
into a global module fragment, so a consumer TU that writes `import ftxui;`
AND textually #includes a standard header hands gcc two copies of the standard
library and it refuses — redefinition of std::__terminate, conflicting
declaration of std::allocator / std::char_traits. #292's smoke TU did exactly
that, and the only object that failed there was that TU's own (obj/module.o),
after the package's five module units had already compiled. clang accepts the
mixed TU, which is why only gcc went red.

Kept off the textual surface, the units build and run on gcc 16.1.0 and
llvm 22.1.8 alike, so tests/examples/ftxui-module needs no toolchain pin and
runs on both linux legs: `import ftxui;` with a real render, plus each
sub-module imported alone, every TU on the module surface and not one textual
include.

The `modules` export list is documentation, not a guard: mcpp validates
[modules].exports only for a build's PRIMARY manifest, never for a
dependency's — measured by deleting one name and rebuilding with the package
cache bypassed, which passed.

Verified (mcpp 2026.8.27.2, the version CI pins): ftxui-module 5 passed on
both toolchains; `mcpp test -p core` green; the same import with the feature
off fails with `module 'ftxui' not found`; 6.1.9 and the 7.0.3 header path
unaffected; check_mirror_urls, check_package_name,
check_platform_version_parity, check_duplicate_versions,
check_cross_package_refs and `mcpp xpkg parse` over all 175 descriptors green.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants