Skip to content

Add an in-tree Conan recipe, tested by CI - #1315

Open
ArthurSonzogni wants to merge 5 commits into
mainfrom
conan-recipe
Open

Add an in-tree Conan recipe, tested by CI#1315
ArthurSonzogni wants to merge 5 commits into
mainfrom
conan-recipe

Conversation

@ArthurSonzogni

@ArthurSonzogni ArthurSonzogni commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add conanfile.py at the repository root: an in-tree Conan v2 recipe wrapping the existing CMake install (screen/dom/component components, shared/fPIC options).
  • Add test_package/ — the standard Conan self-test invoked by conan create ., building and running a small example against the packaged library.
  • Add .github/workflows/conan.yaml — CI matrix (Linux/macOS/Windows x static/shared) running conan create . on every push/PR to main.
  • Small doc addendum in doc/installation_conan.md pointing at the new in-tree recipe.

Related to #1296 — FTXUI currently only ships via the community-maintained Conan Center recipe, which lags behind releases. This doesn't replace that recipe, but gives the project its own tested recipe that can serve as the basis for keeping Conan Center up to date.

Verified locally with Conan 2.30.0: conan create . and conan create . -o "&:shared=True" both succeed, package the three libraries, and the test_package example builds, links, and runs correctly.

Test plan

  • conan create . (static) succeeds locally
  • conan create . -o "&:shared=True" (shared) succeeds locally
  • CI matrix in .github/workflows/conan.yaml passes on Linux/macOS/Windows

FTXUI is currently only consumable via Conan through the community-maintained
recipe on Conan Center, which lags behind releases. This adds a conanfile.py
at the repository root wrapping the existing CMake install, plus a
test_package smoke test and a GitHub Actions workflow (Linux/macOS/Windows,
static/shared) that runs `conan create .` on every push and PR.

Related to #1296
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

⚠️ ABI Compatibility Report

Comparing main (base) with HEAD (PR)

ABI fingerprints changed from d0578d99d54909d813dd510a85d45a4a1c1f0d7e8f179b0eac88c644218de938 to 12dc8a2e281a626a1939bd7883a4f0e98763bcc68b44621fd704a35bde414207.

Detailed ABI Analysis
Checking ABI changes between origin/main and HEAD...
Building origin/main...
Building HEAD...
--------------------------------------------------------------------------------
Comparing libftxui-screen.so...
ABI changes detected for libftxui-screen.so!

Summary of changes:
Functions changes summary: 0 Removed, 0 Changed, 0 Added (12 filtered out) functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Function symbols changes summary: 0 Removed, 0 Added function symbol not referenced by debug info
Variable symbols changes summary: 0 Removed, 5 Added variable symbols not referenced by debug info
5 Added variable symbols not referenced by debug info:

Detailed Report (filtered for ftxui::):
--------------------------------------------------------------------------------
Comparing libftxui-dom.so...
No ABI changes detected for libftxui-dom.so.
--------------------------------------------------------------------------------
Comparing libftxui-component.so...
No ABI changes detected for libftxui-component.so.
--------------------------------------------------------------------------------
No ABI changes detected.

GitHub Actions stringifies YAML booleans as lowercase true/false in
${{ }} interpolation, but Conan's shared option only accepts True/False.
- node.hpp: the friend declaration of Render() lacked FTXUI_EXPORT(DOM),
  conflicting with its later dllexport declaration and causing MSVC
  error C2375 on Windows shared-library builds.
- conanfile.py: force the Ninja generator on Windows so Conan doesn't
  fall back to the multi-config "Visual Studio" generator, which installs
  libraries into lib/<CONFIG>/ instead of lib/, where Conan expects them.
- conan.yaml: install ninja alongside conan on CI runners.
MSVC's dllexport/dllimport only applies to the first declarator in a
comma-separated declaration; the rest are treated as redundantly
re-declared with dll-interface, causing error C2487. Declare each
static const Event constant on its own line so all of them pick up the
class's dllexport/dllimport annotation correctly.
StringRef, ConstStringRef, and ConstStringListRef are exported
(FTXUI_EXPORT(SCREEN)), but every one of their member functions --
including ones inherited from Ref<string>/ConstRef<string> -- is defined
inline in the header and never odr-used from within libftxui-screen
itself. MSVC only emits (and therefore dllexports) an inline member
function into the DLL that first odr-uses it, so consumers linking
against the dllimport declaration got LNK2001 unresolved externals.

Add ref.cpp to the screen library across all build systems (CMake,
Bazel, Meson) with a throwaway function that exercises every member,
forcing MSVC to instantiate and export them.
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.

1 participant