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

[BUG] macOS CI: sim:libcxxtest can't find cxxabi.h #14774

Closed
1 task done
lupyuen opened this issue Nov 14, 2024 · 8 comments · Fixed by #15210 or #15774
Closed
1 task done

[BUG] macOS CI: sim:libcxxtest can't find cxxabi.h #14774

lupyuen opened this issue Nov 14, 2024 · 8 comments · Fixed by #15210 or #15774
Labels
Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working

Comments

@lupyuen
Copy link
Member

lupyuen commented Nov 14, 2024

Description / Steps to reproduce the issue

sim:libcxxtest build in macOS CI can't find cxxabi.h. We may need to disable the build in macOS CI because NuttX Mirror Build is failing twice daily:

From sim-02 macOS Log: https://github.com/NuttX/nuttx/actions/runs/11825497334/job/32949471137

Configuration/Tool: sim/libcxxtest
libcxx/libcxx/src/exception.cpp:14:12: fatal error: 'cxxabi.h' file not found
  #include <cxxabi.h>
           ^~~~~~~~~~
1 error generated.
make[1]: *** [libcxx/libcxx/src/exception.o] Error 1
In file included from libcxx/libcxx/src/stdexcept.cpp:16:
/Users/runner/work/nuttx/nuttx/sources/nuttx/libs/libxx/libcxx/libcxx/src/support/runtime/stdexcept_default.ipp:14:10: fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>
         ^~~~~~~~~~
1 error generated.
make[1]: *** [libcxx/libcxx/src/stdexcept.o] Error 1
make[1]: Target `libxx.a' not remade because of errors.
make: *** [libs/libxx/libxx.a] Error 2
./libcxx/libcxx/src/exception.cpp:14:12: fatal error: 'cxxabi.h' file not found
  #include <cxxabi.h>
           ^~~~~~~~~~
1 error generated.
ERROR: c++ failed: 1
       command: c++ -MT ./libcxx/libcxx/src/exception.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-nostdinc++' '-std=gnu++20' '-fno-pic' '-mcmodel=large' '-isystem' '/Users/runner/work/nuttx/nuttx/sources/nuttx/include/libcxx' '-isystem' '/Users/runner/work/nuttx/nuttx/sources/nuttx/include' '-D__NuttX__' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-Wno-cpp' '-Werror' '-DLIBCXX_BUILDING_LIBCXXABI' '-D_LIBCPP_DISABLE_AVAILABILITY' '-D_LIBCPP_BUILDING_LIBRARY' '-I' '/Users/runner/work/nuttx/nuttx/sources/nuttx/libs/libxx/libcxx/libcxx/src' '-D__GLIBCXX__' '-Wno-shadow' '-Wno-sign-compare' '-Wno-cpp' '-Wno-attributes' '-Wno-deprecated-declarations' ./libcxx/libcxx/src/exception.cpp
make[2]: *** [libcxx/libcxx/src/exception.ddp] Error 1
In file included from ./libcxx/libcxx/src/stdexcept.cpp:16:
/Users/runner/work/nuttx/nuttx/sources/nuttx/libs/libxx/libcxx/libcxx/src/support/runtime/stdexcept_default.ipp:14:10: fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>
         ^~~~~~~~~~
1 error generated.
ERROR: c++ failed: 1
       command: c++ -MT ./libcxx/libcxx/src/stdexcept.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-nostdinc++' '-std=gnu++20' '-fno-pic' '-mcmodel=large' '-isystem' '/Users/runner/work/nuttx/nuttx/sources/nuttx/include/libcxx' '-isystem' '/Users/runner/work/nuttx/nuttx/sources/nuttx/include' '-D__NuttX__' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-Wno-cpp' '-Werror' '-DLIBCXX_BUILDING_LIBCXXABI' '-D_LIBCPP_DISABLE_AVAILABILITY' '-D_LIBCPP_BUILDING_LIBRARY' '-I' '/Users/runner/work/nuttx/nuttx/sources/nuttx/libs/libxx/libcxx/libcxx/src' '-D__GLIBCXX__' '-Wno-shadow' '-Wno-sign-compare' '-Wno-cpp' '-Wno-attributes' '-Wno-deprecated-declarations' ./libcxx/libcxx/src/stdexcept.cpp
make[2]: *** [libcxx/libcxx/src/stdexcept.ddp] Error 1
make[2]: Target `makedepfile' not remade because of errors.
make[1]: *** [.depend] Error 2
make[1]: Target `depend' not remade because of errors.
make: *** [pass2dep] Error 2
make: Target `all' not remade because of errors.
/Users/runner/work/nuttx/nuttx/sources/nuttx/tools/testbuild.sh: line 385: /Users/runner/work/nuttx/nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS x64 at GitHub Actions

NuttX Version

master

Issue Architecture

[Arch: simulator]

Issue Area

[Area: Build System]

Verification

  • I have verified before submitting the report.
@lupyuen lupyuen added the Type: Bug Something isn't working label Nov 14, 2024
@github-actions github-actions bot added Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) labels Nov 14, 2024
@xiaoxiang781216
Copy link
Contributor

can we try CONFIG_LIBCXXABI=y

@lupyuen
Copy link
Member Author

lupyuen commented Nov 14, 2024

@xiaoxiang781216 Sorry CONFIG_LIBCXXABI doesn't work on macOS Arm64. Why does it warn about LIBSUPCXX_TOOLCHAIN?
https://gist.github.com/lupyuen/9ef79284c7aafd91a71ba8742ef31e27

$ tools/configure.sh sim/libcxxtest
$ kconfig-tweak --enable CONFIG_LIBCXXABI
$ grep CONFIG_LIBCXXABI .config
CONFIG_LIBCXXABI=y
$ make olddefconfig
.config:1480:warning: override: LIBSUPCXX_TOOLCHAIN changes choice state
$ make
CXX:  libcxx/libcxx/src/filesystem/path.cpp libcxx/libcxx/src/exception.cpp:14:12: fatal error: 'cxxabi.h' file not found
   14 |   #include <cxxabi.h>
      |            ^~~~~~~~~~
1 error generated.
make[1]: *** [libcxx/libcxx/src/exception.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from libcxx/libcxx/src/stdexcept.cpp:16:
libcxx/libcxx/src/support/runtime/stdexcept_default.ipp:14:10: fatal error: 'cxxabi.h' file not found
   14 | #include <cxxabi.h>
      |          ^~~~~~~~~~
1 error generated.
make[1]: *** [libcxx/libcxx/src/stdexcept.o] Error 1
make: *** [libs/libxx/libxx.a] Error 2
make: *** Waiting for unfinished jobs....
CP:  /Users/luppy/riscv/nuttx/include/nuttx/config.h
CP:  /Users/luppy/riscv/nuttx/include/nuttx/fs/hostfs.h
./libcxx/libcxx/src/exception.cpp:14:12: fatal error: 'cxxabi.h' file not found
   14 |   #include <cxxabi.h>
      |            ^~~~~~~~~~
1 error generated.
ERROR: c++ failed: 1
       command: c++ -MT ./libcxx/libcxx/src/exception.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-nostdinc++' '-std=gnu++20' '-fno-pic' '-mcmodel=large' '-isystem' '/Users/luppy/riscv/nuttx/include/libcxx' '-isystem' '/Users/luppy/riscv/nuttx/include' '-D__NuttX__' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-DLIBCXX_BUILDING_LIBCXXABI' '-D_LIBCPP_DISABLE_AVAILABILITY' '-D_LIBCPP_BUILDING_LIBRARY' '-I' '/Users/luppy/riscv/nuttx/libs/libxx/libcxx/libcxx/src' '-D__GLIBCXX__' '-Wno-shadow' '-Wno-sign-compare' '-Wno-cpp' '-Wno-attributes' '-Wno-deprecated-declarations' ./libcxx/libcxx/src/exception.cpp
make[2]: *** [libcxx/libcxx/src/exception.ddp] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ./libcxx/libcxx/src/stdexcept.cpp:16:
./libcxx/libcxx/src/support/runtime/stdexcept_default.ipp:14:10: fatal error: 'cxxabi.h' file not found
   14 | #include <cxxabi.h>
      |          ^~~~~~~~~~
1 error generated.
ERROR: c++ failed: 1
       command: c++ -MT ./libcxx/libcxx/src/stdexcept.o  -M '-g' '-fomit-frame-pointer' '-fno-common' '-fvisibility=hidden' '-ffunction-sections' '-fdata-sections' '-Wall' '-Wshadow' '-Wundef' '-Wno-attributes' '-Wno-unknown-pragmas' '-nostdinc++' '-std=gnu++20' '-fno-pic' '-mcmodel=large' '-isystem' '/Users/luppy/riscv/nuttx/include/libcxx' '-isystem' '/Users/luppy/riscv/nuttx/include' '-D__NuttX__' '-U_AIX' '-U_WIN32' '-U__APPLE__' '-U__FreeBSD__' '-U__NetBSD__' '-U__linux__' '-U__sun__' '-U__unix__' '-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' '-D__KERNEL__' '-DLIBCXX_BUILDING_LIBCXXABI' '-D_LIBCPP_DISABLE_AVAILABILITY' '-D_LIBCPP_BUILDING_LIBRARY' '-I' '/Users/luppy/riscv/nuttx/libs/libxx/libcxx/libcxx/src' '-D__GLIBCXX__' '-Wno-shadow' '-Wno-sign-compare' '-Wno-cpp' '-Wno-attributes' '-Wno-deprecated-declarations' ./libcxx/libcxx/src/stdexcept.cpp
make[2]: *** [libcxx/libcxx/src/stdexcept.ddp] Error 1
make[1]: *** [.depend] Error 2
make: *** [pass2dep] Error 2

@xiaoxiang781216
Copy link
Contributor

look like libcxxabi/Make.defs forget to add the search path.

@cuiziwei1
Copy link
Contributor

https://github.com/apache/nuttx/blob/3e3701b2721c216cea47b72835a13966da52b555/libs/libxx/libcxxabi/Make.defs
libcxxabi/Make.defs has already add include search path at line 38.
if enable CONFIG_LIBCXXABI, after build, you can look up whether cxxabi.h already in nuttx/include/libcxxabi.
but libcxxabi/CMakeList.txt have't add search path, I will add it.

in other way, if enable CONFIG_LIBSUPCXX_TOOLCHAIN, cxxabi.h may not be found, but if use CONFIG_LIBSUPCXX_TOOLCHAIN, we will disable LIBCXX_BUILDING_LIBCXXABI, so we can't use cxxabi.h.like this:

#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
#include <cxxabi.h>
using namespace __cxxabiv1;
#define HAVE_DEPENDENT_EH_ABI 1
#endif

yamt added a commit to yamt/incubator-nuttx that referenced this issue Dec 16, 2024
@xiaoxiang781216 xiaoxiang781216 linked a pull request Dec 16, 2024 that will close this issue
xiaoxiang781216 pushed a commit that referenced this issue Dec 16, 2024
jerpelea pushed a commit to jerpelea/nuttx that referenced this issue Dec 16, 2024
xiaoxiang781216 pushed a commit that referenced this issue Dec 17, 2024
linguini1 pushed a commit to CarletonURocketry/nuttx that referenced this issue Jan 15, 2025
@xiaoxiang781216
Copy link
Contributor

https://github.com/apache/nuttx/blob/3e3701b2721c216cea47b72835a13966da52b555/libs/libxx/libcxxabi/Make.defs libcxxabi/Make.defs has already add include search path at line 38. if enable CONFIG_LIBCXXABI, after build, you can look up whether cxxabi.h already in nuttx/include/libcxxabi. but libcxxabi/CMakeList.txt have't add search path, I will add it.

in other way, if enable CONFIG_LIBSUPCXX_TOOLCHAIN, cxxabi.h may not be found, but if use CONFIG_LIBSUPCXX_TOOLCHAIN, we will disable LIBCXX_BUILDING_LIBCXXABI, so we can't use cxxabi.h.like this:

#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) #include <cxxabi.h> using namespace __cxxabiv1; #define HAVE_DEPENDENT_EH_ABI 1 #endif

please provide the patch.

@xiaoxiang781216
Copy link
Contributor

@lupyuen do we have enough budget to bring back msvc and all macOS to ci?

@lupyuen
Copy link
Member Author

lupyuen commented Feb 5, 2025

@xiaoxiang781216 MSVC is already in, see below. Sorry we can't enable macOS, it will exceed our budget. Remember that 1 macOS Runner = 10 times the cost of a Linux Runner.

https://github.com/apache/nuttx/actions/runs/13151470353

Image

@xiaoxiang781216
Copy link
Contributor

so, we don't have any ci on macOS now:(.

cuiziweizw added a commit to cuiziweizw/nuttx that referenced this issue Feb 6, 2025
1. fix apache#14774.
2. fix apache#15491.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
cuiziweizw added a commit to cuiziweizw/nuttx that referenced this issue Feb 6, 2025
1. fix apache#14774.
Change the defconfig of libcxxtest and select libcxxabi by default to
fix sim:libcxxtest build in macOS CI can't find cxxabi.h.

2. fix apache#15491.
libcxxabi cannot be used with uclibc, so when compiling macos sim, libcxxabi cannot be selected by default in Kconfig.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
acassis pushed a commit that referenced this issue Feb 12, 2025
1. fix #14774.
Change the defconfig of libcxxtest and select libcxxabi by default to
fix sim:libcxxtest build in macOS CI can't find cxxabi.h.

2. fix #15491.
libcxxabi cannot be used with uclibc, so when compiling macos sim, libcxxabi cannot be selected by default in Kconfig.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working
Projects
None yet
3 participants