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

tiledb/stdx/test/compat.cc fails to build with libcxx (llvm-19) #5411

Closed
paparodeo opened this issue Dec 22, 2024 · 2 comments · Fixed by #5416
Closed

tiledb/stdx/test/compat.cc fails to build with libcxx (llvm-19) #5411

paparodeo opened this issue Dec 22, 2024 · 2 comments · Fixed by #5416

Comments

@paparodeo
Copy link

paparodeo commented Dec 22, 2024

libcxx from llvm-19 https://libcxx.llvm.org/ReleaseNotes/19.html does not yet support stop_token and jthread without the -fexperimental-library flag.

when building without the flag the polyfill implementations conflict with the libcxx std namespace.

tiledb: 2.27.0
os: macOS 15.2 with nixpkgs and and llvm-19

FAILED: tiledb/stdx/test/CMakeFiles/unit_stdx.dir/compat.cc.o 
/nix/store/wkadfwbhn9b4kdih88j7izzy20qw79bk-clang-wrapper-19.1.5/bin/clang++ -DNDEBUG -D_FILE_OFFSET_BITS=64 -I/tmp/nix-build-tiledb-2.27.0.drv-2/source -O3 -DNDEBUG -std=c++20 -isysroot /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIE -fvisibility=hidden -Wall -Wextra -O3 -Wno-unqualified-std-cast-call -MD -MT tiledb/stdx/test/CMakeFiles/unit_stdx.dir/compat.cc.o -MF tiledb/stdx/test/CMakeFiles/unit_stdx.dir/compat.cc.o.d -o tiledb/stdx/test/CMakeFiles/unit_stdx.dir/compat.cc.o -c /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:150:7: error: reference to '__stop_callback_base' is ambiguous
  150 |       __stop_callback_base* __cb,
      |       ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:38:8: note: candidate found by name lookup is 'std::__stop_callback_base'
   38 | struct __stop_callback_base {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:29:8: note: candidate found by name lookup is 'std::__1::__stop_callback_base'
   29 | struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
      |        ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:189:26: error: reference to '__stop_callback_base' is ambiguous
  189 |   void __remove_callback(__stop_callback_base* __cb) noexcept {
      |                          ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:38:8: note: candidate found by name lookup is 'std::__stop_callback_base'
   38 | struct __stop_callback_base {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:29:8: note: candidate found by name lookup is 'std::__1::__stop_callback_base'
   29 | struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
      |        ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:310:3: error: reference to '__stop_callback_base' is ambiguous
  310 |   __stop_callback_base* __head_ = nullptr;
      |   ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:38:8: note: candidate found by name lookup is 'std::__stop_callback_base'
   38 | struct __stop_callback_base {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:29:8: note: candidate found by name lookup is 'std::__1::__stop_callback_base'
   29 | struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
      |        ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:400:23: error: reference to '__stop_state' is ambiguous
  400 |   explicit stop_token(__stop_state* __state) noexcept
      |                       ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:56:8: note: candidate found by name lookup is 'std::__stop_state'
   56 | struct __stop_state {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:40:7: note: candidate found by name lookup is 'std::__1::__stop_state'
   40 | class __stop_state {
      |       ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:407:3: error: reference to '__stop_state' is ambiguous
  407 |   __stop_state* __state_;
      |   ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:56:8: note: candidate found by name lookup is 'std::__stop_state'
   56 | struct __stop_state {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:40:7: note: candidate found by name lookup is 'std::__1::__stop_state'
   40 | class __stop_state {
      |       ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:488:3: error: reference to '__stop_state' is ambiguous
  488 |   __stop_state* __state_;
      |   ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:56:8: note: candidate found by name lookup is 'std::__stop_state'
   56 | struct __stop_state {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:40:7: note: candidate found by name lookup is 'std::__1::__stop_state'
   40 | class __stop_state {
      |       ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:417:22: error: reference to '__stop_state' is ambiguous
  417 |       : __state_(new __stop_state()) {
      |                      ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:56:8: note: candidate found by name lookup is 'std::__stop_state'
   56 | struct __stop_state {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:40:7: note: candidate found by name lookup is 'std::__1::__stop_state'
   40 | class __stop_state {
      |       ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:497:45: error: reference to '__stop_callback_base' is ambiguous
  497 | class [[nodiscard]] stop_callback : private __stop_callback_base {
      |                                             ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:38:8: note: candidate found by name lookup is 'std::__stop_callback_base'
   38 | struct __stop_callback_base {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:29:8: note: candidate found by name lookup is 'std::__1::__stop_callback_base'
   29 | struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
      |        ^
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/test/compat.cc:34:
In file included from /tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/stop_token:41:
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:564:3: error: reference to '__stop_state' is ambiguous
  564 |   __stop_state* __state_;
      |   ^
/tmp/nix-build-tiledb-2.27.0.drv-2/source/tiledb/stdx/bits/stop_token.h:56:8: note: candidate found by name lookup is 'std::__stop_state'
   56 | struct __stop_state {
      |        ^
/nix/store/0nhi47d5ip48wprxnava6vv973zzzndf-libcxx-19.1.5-dev/include/c++/v1/__stop_token/stop_state.h:40:7: note: candidate found by name lookup is 'std::__1::__stop_state'
   40 | class __stop_state {
      |       ^
9 errors generated.
@ihnorton
Copy link
Member

Hi @paparodeo, thanks for opening the issue. We'll remove the polyfill namespace conflict soon. We added some conditional logic for this issue with AppleClang in https://github.com/TileDB-Inc/TileDB/pull/5364/files, but it looks like nixpkgs uses upstream Clang. Will making that check conditional only on work for you?

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "16")


[sc-61180]

@paparodeo
Copy link
Author

Hi @paparodeo, thanks for opening the issue. We'll remove the polyfill namespace conflict soon. We added some conditional logic for this issue with AppleClang in https://github.com/TileDB-Inc/TileDB/pull/5364/files, but it looks like nixpkgs uses upstream Clang. Will making that check conditional only on work for you?

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "16")

yes -- verified that replace AppleClang -> Clang fixes the build. thanks!

ihnorton added a commit that referenced this issue Jan 2, 2025
Fix compilation errors on newer Clang (upstream) versions which do not fully
support jthread and stop_token. Already used for AppleClang variant.

x-ref
  - #5364
  - #5411
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 a pull request may close this issue.

2 participants