Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build breaks with ftxui-5.0.0 #1186

Closed
yurivict opened this issue Aug 21, 2023 · 4 comments · Fixed by #1188
Closed

Build breaks with ftxui-5.0.0 #1186

yurivict opened this issue Aug 21, 2023 · 4 comments · Fixed by #1188
Assignees
Labels
enhancement New feature or request

Comments

@yurivict
Copy link

Problem Description

In file included from /wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/main.cpp:29:
In file included from /wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/tui/tui.hpp:31:
/wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/tui/style_sheet.hpp:103:23: error: no member named 'transform' in 'ftxui::ConstStringListRef'
    sheet.tab.entries.transform = [](EntryState state)
    ~~~~~~~~~~~~~~~~~ ^
/wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/tui/style_sheet.hpp:113:39: error: no member named 'Right' in 'ftxui::MenuOption'
    sheet.tab.direction = MenuOption::Right;
                          ~~~~~~~~~~~~^
/wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/tui/style_sheet.hpp:205:23: error: no member named 'transform' in 'ftxui::ConstStringListRef'
    sheet.tab.entries.transform = [](EntryState state) {
    ~~~~~~~~~~~~~~~~~ ^
/wrkdirs/usr/ports/net/ecal/work/ecal-5.12.0/app/mon/mon_tui/src/tui/style_sheet.hpp:212:39: error: no member named 'Right' in 'ftxui::MenuOption'
    sheet.tab.direction = MenuOption::Right;
                          ~~~~~~~~~~~~^
4 errors generated.

How to reproduce

Regular build

How did you get eCAL?

Custom Build / Built from source

Environment

FreeBSD 13.2

eCAL System Information

No response

@FlorianReimold FlorianReimold added the enhancement New feature or request label Aug 21, 2023
@KerstinKeller KerstinKeller self-assigned this Aug 21, 2023
@KerstinKeller
Copy link
Contributor

FTXUI had a breaking API change with the 5.0.0 release. We need to adapt the eCAL code to support 5.0.0 releases of FTXUI.

@KerstinKeller
Copy link
Contributor

@ArthurSonzogni do you think you can provide some insights on how to make the eCAL code compile with both FTXUI 3.0.0 and FTXUI 5.0.0.
E.g. pre 5.0.0 we have

struct MenuOption {
  // ... 
  MenuEntryOption entries;
}

but now we have

struct MenuOption {
  // ... 
  ConstStringListRef entries;
}

which is used here

In general I am not sure how to migrate this code to 5.0.0.
Also is there any variable / define to check the ftxui version? (e.g. defines / constexpr) - Searching the header files for version didn't yield anything.

@ArthurSonzogni
Copy link

ArthurSonzogni commented Aug 22, 2023

FTXUI adheres to semantic versioning. Increasing the major number means a breaking change is introduced.

The CHANGELOG documents them. In particular, you are looking for:

Breaking: MenuOption::entries is renamed MenuOption::entries_option.


About reporting the FTXUI version, you can use:

find_package(ftxui REQUIRED)
add_definitions(-DFTXUI_VERSION_MAJOR ${ftxui_VERSION_MAJOR})
#if FTXUI_VERSION_MAJOR == 5
  [...]
#endif

However, I recommand depending on a specific version of FTXUI. You can use git submodule, cmake FetchContent, or C++ package managers. See FTXUI documentation.

@yurivict
Copy link
Author

However, I recommand depending on a specific version of FTXUI. You can use git submodule, cmake FetchContent, or C++ package managers. See FTXUI documentation.

Please don't use FetchContent. It downloads files which isn't allowed from package builders.

Please consider fixing FTXUI version compatibility rather than just sticking to older versions which will have to be changed later anyways.

KerstinKeller added a commit that referenced this issue Aug 23, 2023
* Make version info of ftxui available to build.
FlorianReimold pushed a commit that referenced this issue Sep 20, 2023
* Make version info of ftxui available to build.
FlorianReimold pushed a commit that referenced this issue Oct 27, 2023
* Make version info of ftxui available to build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants