Skip to content

Conversation

@dskkato
Copy link
Contributor

@dskkato dskkato commented Dec 4, 2025

Summary

This PR fixes the Bazel build configuration to make FTXUI properly consumable from external workspaces using Bzlmod, and adds integration tests to prevent regressions.

Problem

The previous alias target for :ftxui did not properly re-export headers from the underlying modules (component, dom, screen), causing compilation failures when external projects tried to consume as @ftxui//:ftxui:

error: module //:smoke does not depend on a module exporting 'ftxui/dom/elements.hpp'

Solution

  1. Replace alias with ftxui_cc_library

Changed the top-level :ftxui target from a simple alias to a ftxui_cc_library that explicitly re-exports all public headers using glob(["include/ftxui/**/*.hpp"]). This ensures downstream consumers can access all FTXUI headers through the single @ftxui//:ftxui dependency.

  1. Add External Integration Test
    Created bazel_integration as a minimal external workspace that:
  • Uses Bzlmod with bazel_dep(name = "ftxui")
  • Overrides the dependency to test the local version
    Includes a smoke test that exercises all three modules
  • Validates that @ftxui//:ftxui works as a single dependency
  1. Add CI Validation
    Added a new CI job that builds the smoke test using:
bazel build //:smoke --enable_bzlmod --override_module=ftxui=..

This prevents future regressions in external visibility or API accessibility.

Testing

cd bazel_integration
bazel build //:smoke --enable_bzlmod --override_module=ftxui=..
./bazel-bin/smoke  # Successfully runs interactive UI

@dskkato dskkato force-pushed the fix/bazel_visibility branch 2 times, most recently from 66237ac to c0bc41a Compare December 4, 2025 07:40
@dskkato dskkato marked this pull request as draft December 4, 2025 08:27
@dskkato dskkato force-pushed the fix/bazel_visibility branch 2 times, most recently from 2daa53b to 5048eb9 Compare December 5, 2025 23:51
…e test

- Set `visibility = ["//visibility:public"]` on the top-level `:ftxui` alias
  so the library can be consumed from external Bazel workspaces.
- Add `bazel_integration/` minimal external workspace to validate
  external usage via Bzlmod.
- Introduce `smoke` target that depends on `@ftxui//:ftxui`.
- Add CI job to build the smoke target using:
    --enable_bzlmod
    --override_module=ftxui=..
  This prevents regressions in visibility or public API changes.
@dskkato dskkato force-pushed the fix/bazel_visibility branch from 5048eb9 to 8cef8c1 Compare December 6, 2025 00:16
@dskkato dskkato marked this pull request as ready for review December 6, 2025 00:31
@dskkato dskkato force-pushed the fix/bazel_visibility branch from c0186c1 to 7a2ea87 Compare December 6, 2025 05:19
Copy link
Owner

@ArthurSonzogni ArthurSonzogni left a comment

Choose a reason for hiding this comment

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

Thanks!

@ArthurSonzogni ArthurSonzogni merged commit 117417e into ArthurSonzogni:main Dec 13, 2025
10 checks passed
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