27 Commits

Author SHA1 Message Date
Arthur Sonzogni
068cf29e67 Merge c2df863e5d into 07fd3e685a 2025-04-26 17:24:43 +00:00
ArthurSonzogni
c2df863e5d tmp 2025-04-26 19:24:34 +02:00
ArthurSonzogni
2a5d7646da Add publish to BCR 2025-04-26 02:38:32 +02:00
ArthurSonzogni
8e055a5a61 update workflow 2025-04-26 01:29:39 +02:00
ArthurSonzogni
378e30bef0 update workflow 2025-04-26 01:25:29 +02:00
ArthurSonzogni
2270fe628f tmp 2025-04-26 01:14:09 +02:00
ArthurSonzogni
44d25564ee Fix MSVC 2025-04-26 01:10:42 +02:00
ArthurSonzogni
a9b54106d4 Fix /utf-8 2025-04-26 00:55:47 +02:00
ArthurSonzogni
31ec197811 Set c++ standard. 2025-04-26 00:44:44 +02:00
ArthurSonzogni
3184033f4d update workdflow. 2025-04-26 00:16:41 +02:00
ArthurSonzogni
632f8032bc Update workflow. 2025-04-26 00:05:25 +02:00
ArthurSonzogni
1d7d84c155 Update workflow 2025-04-24 15:07:17 +02:00
ArthurSonzogni
fd5e5c77e5 Update bazel workflow. 2025-04-24 14:48:55 +02:00
ArthurSonzogni
c8a14f5d70 Update workflow. 2025-04-24 14:43:35 +02:00
ArthurSonzogni
321c308a98 Update workflow file. 2025-04-24 14:41:44 +02:00
ArthurSonzogni
8feac77d8c Update workflow file. 2025-04-24 14:39:15 +02:00
ArthurSonzogni
dad4a67fcb Update workflow 2025-04-24 14:34:13 +02:00
ArthurSonzogni
d6006d3475 Update workflow. 2025-04-24 14:29:21 +02:00
ArthurSonzogni
f69adb605a Update workflow 2025-04-24 14:23:23 +02:00
ArthurSonzogni
e185d6d475 Fix workflow. 2025-04-24 03:36:04 +02:00
ArthurSonzogni
f8d4880517 fix workflow. 2025-04-24 03:20:03 +02:00
ArthurSonzogni
38869c4aaa fix workflow. 2025-04-24 03:16:12 +02:00
ArthurSonzogni
4a75d49478 Fix workflow file. 2025-04-24 03:12:57 +02:00
ArthurSonzogni
c3d03dc716 Fix workflow issue. 2025-04-24 03:11:13 +02:00
ArthurSonzogni
053a1d8290 Setup bazel in workflow 2025-04-24 03:05:01 +02:00
ArthurSonzogni
45bf24f8ea Add workflow + examples + tests 2025-04-24 03:02:10 +02:00
ArthurSonzogni
f128c442cc Support Bazel
BUG:https://github.com/ArthurSonzogni/FTXUI/issues/1032
2025-04-23 19:58:34 +02:00
10 changed files with 52 additions and 114 deletions

View File

@@ -1,24 +1,25 @@
# Copyright 2025 Arthur Sonzogni. All rights reserved.
# Use of this source code is governed by the MIT license that can be found in
# the LICENSE file.
matrix:
platform:
- centos7
- debian10
- ubuntu2004
- macos
- windows
bazel: [6.x, 7.x, 8.x]
tasks:
verify_targets:
name: Build and test.
bcr_test_module:
module_path: "."
matrix:
platform: [
"debian11",
"macos",
"macos-arm64",
"ubuntu2204",
"windows",
]
bazel: [
6.x,
7.x,
8.x,
]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@ftxui//:ftxui'
- '@ftxui//:screen'
- '@ftxui//:dom'
- '@ftxui//:component'
test_targets:
- '@ftxui//:tests'
- "//..."

View File

@@ -1,5 +1,5 @@
{
"integrity": "",
"strip_prefix": "",
"url": "https://github.com/ArthurSonzogni/FTXUI/releases/download/{TAG}/source.tar.gz"
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
}

View File

@@ -12,7 +12,7 @@ on:
jobs:
test_bazel:
name: "Bazel, ${{ matrix.compiler }}, ${{ matrix.os }}"
name: "Test Bazel"
strategy:
fail-fast: false
matrix:
@@ -44,7 +44,7 @@ jobs:
run: bazel run tests
test_cmake:
name: "CMake, ${{ matrix.compiler }}, ${{ matrix.os }}"
name: "Tests CMake"
strategy:
fail-fast: false
matrix:
@@ -173,7 +173,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build artifact for the release
package_compiled:
package:
name: "Build packages"
needs: release
strategy:
@@ -218,29 +218,6 @@ jobs:
asset_path: ${{ matrix.asset_path }}
overwrite: true
# Build "source" artifact for the release. This is the same as the github
# "source" archive, but with a stable URL. This is useful for the Bazel
# Central Repository.
package_source:
name: "Build source package"
needs: release
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Create source package"
run: >
git archive --format=tar.gz --prefix=ftxui/ -o source.tar.gz HEAD
- name: "Upload source package"
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: source.tar.gz
overwrite: true
documentation:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

View File

@@ -1,12 +1,12 @@
on:
# On new releases:
# Run the publish workflow after a successful release.
workflow_call:
inputs:
tag_name:
required: true
type: string
# On manual trigger:
# Allow manual triggering of the workflow.
workflow_dispatch:
inputs:
tag_name:
@@ -15,9 +15,10 @@ on:
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@[version]
with:
tag_name: ${{ inputs.tag_name }}
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
registry_fork: ArthurSonzogni/bazel-central-registry
permissions:
attestations: write

View File

@@ -3,9 +3,13 @@
# the LICENSE file.
# TODO:
# - Build benchmark.
# - Build fuzzers.
# - Build documentation.
# - Windows/MSVC support.
# - Pass /utf-8 to MSVC users depending on FTXUI.
# - Pass "FTXUI_MICROSOFT_TERMINAL_FALLBACK" to windows users.
# - Support building benchmark.
# - Support building examples.
# - Support building fuzzer.
# - Support building documentation.
# - Enable the two tests timing out.
# - Support WebAssembly
@@ -13,7 +17,7 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(":bazel/ftxui.bzl", "ftxui_cc_library")
load(":bazel/ftxui.bzl", "generate_examples")
load(":bazel/ftxui.bzl", "cpp20")
load(":bazel/ftxui.bzl", "windows_copts")
load(":bazel/ftxui.bzl", "msvc_copts")
load(":bazel/ftxui.bzl", "pthread_linkopts")
package(default_visibility = ["//visibility:public"])
@@ -241,7 +245,7 @@ cc_test(
"include",
"src",
],
copts = cpp20() + windows_copts(),
copts = cpp20() + msvc_copts(),
deps = [
"//:ftxui",
"@googletest//:gtest_main",

View File

@@ -1,35 +1,11 @@
Changelog
=========
Future release
------------
6.1.0 (2025-04-29)
-----------------
Next release (2025-04-01)
-------------------------
### Build
- Feature: Support `bazel` build system. See #1032.
Proposed by Kostya Serebryany @kcc
If all goes well (pending), it should appear in the Bazel central repository.
It can be imported into your project using the following lines:
**MODULE.bazel**
```bazel
bazel_dep(name = "ftxui", version = "6.1.0")
```
**BUILD.bazel**
```bazel
deps = [
// Depend on the whole library:
"@ftxui//:ftxui",
// Choose a specific submodule:
"@ftxui//:component",
"@ftxui//:dom",
"@ftxui//:screen",
]
```
- Feature: Support `bazel`. See #1032. Proposed by @kcc.
### Component
- Bugfix: Fix a crash with ResizeableSplit. See #1023.

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
project(ftxui
LANGUAGES CXX
VERSION 6.1.0
VERSION 6.0.2
DESCRIPTION "C++ Functional Terminal User Interface."
)

View File

@@ -3,7 +3,7 @@
# the LICENSE file.
# FTXUI Module.
module(name = "ftxui", version = "6.1.0")
module(name = "ftxui", version = "6.0.3")
# Build deps.
bazel_dep(name = "rules_cc", version = "0.1.1")

View File

@@ -372,7 +372,7 @@ include(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v6.1.0
GIT_TAG v6.0.2
)
FetchContent_GetProperties(ftxui)

View File

@@ -20,42 +20,23 @@ def cpp20():
"//conditions:default": ["-std=c++20"],
})
# Microsoft terminal is a bit buggy ¯\_(ツ)_/¯ and MSVC uses bad defaults.
def windows_copts():
def msvc_copts():
MSVC_COPTS = [
# Microsoft Visual Studio must decode sources files as UTF-8.
# Force Microsoft Visual Studio to decode sources files in UTF-8.
"/utf-8",
# Microsoft Visual Studio must interpret the codepoint using unicode.
# Force Microsoft Visual Studio to interpret the source files as
# Unicode.
"/DUNICODE",
"/D_UNICODE",
# Fallback for Microsoft Terminal.
# This
# - Replace missing font symbols by others.
# - Reduce screen position pooling frequency to deals against a Microsoft
# race condition. This was fixed in 2020, but clients never not updated.
# - https://github.com/microsoft/terminal/pull/7583
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
"/DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
]
WINDOWS_COPTS = [
# Fallback for Microsoft Terminal.
# This
# - Replace missing font symbols by others.
# - Reduce screen position pooling frequency to deals against a Microsoft
# race condition. This was fixed in 2020, but clients never not updated.
# - https://github.com/microsoft/terminal/pull/7583
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
"-DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
];
return select({
# MSVC:
"@rules_cc//cc/compiler:msvc-cl": MSVC_COPTS,
"@rules_cc//cc/compiler:clang-cl": MSVC_COPTS,
"@platforms//os:windows": WINDOWS_COPTS,
"//conditions:default": [],
})
@@ -88,12 +69,10 @@ def ftxui_cc_library(
"include",
"src",
],
copts = cpp17() + windows_copts(),
copts = cpp17() + msvc_copts(),
visibility = ["//visibility:public"],
)
# Compile all the examples in the examples/ directory.
# This is useful to check the Bazel is synchronized with CMake definitions.
def generate_examples():
cpp_files = native.glob(["examples/**/*.cpp"])
@@ -111,5 +90,5 @@ def generate_examples():
name = name,
srcs = [src],
deps = ["//:component"],
copts = cpp20() + windows_copts(),
copts = cpp20() + msvc_copts(),
)