diff --git a/.github/workflows/on_push_main.yml b/.github/workflows/on_push_main.yml index 64fb0acda553..d0216d0027a2 100644 --- a/.github/workflows/on_push_main.yml +++ b/.github/workflows/on_push_main.yml @@ -340,13 +340,13 @@ jobs: ## CMake fetch-content for C++ SDK ``` include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP ON URL https://build.rerun.io/commit/${{ env.SHORT_SHA }}/rerun_cpp_sdk.zip) + FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/${{ env.SHORT_SHA }}/rerun_cpp_sdk.zip) FetchContent_MakeAvailable(rerun_sdk) ``` or ``` include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP ON URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) + FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) FetchContent_MakeAvailable(rerun_sdk) ``` diff --git a/.gitignore b/.gitignore index 04cd8a798fb2..163740e6a2d6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ crates/re_types_builder/source_hash.txt *.a *.bin *.o +**/arrow/ **/build/ **/CMakeFiles/ **/CMakeCache.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d97b633069c4..b0c5df89199f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) project(rerun_cpp_proj LANGUAGES CXX) @@ -61,7 +61,7 @@ endif() # If using MSVC, always enable multi-process compiling for all targets. # Note that this setting is repeated for rerun_sdk's CMakeLists.txt since it should also work stand-alone. if(MSVC) - add_compile_options(/MP) + add_compile_options("/MP") endif() # Arrow requires a C++17 compliant compiler. diff --git a/crates/re_sdk/src/global.rs b/crates/re_sdk/src/global.rs index 0b9e8a05da45..9ee92ce1b1c9 100644 --- a/crates/re_sdk/src/global.rs +++ b/crates/re_sdk/src/global.rs @@ -44,7 +44,7 @@ impl ThreadLocalRecording { } } -#[cfg(target_os = "macos")] +#[cfg(any(target_os = "macos", target_os = "windows"))] impl Drop for ThreadLocalRecording { fn drop(&mut self) { if let Some(stream) = self.stream.take() { @@ -52,7 +52,7 @@ impl Drop for ThreadLocalRecording { // Calling drop on `self.stream` will panic the calling thread. // But we want to make sure we don't loose the data in the stream. // So how? - re_log::warn!("Using thread-local RecordingStream on macOS can result in data loss because of https://github.com/rerun-io/rerun/issues/3937"); + re_log::warn!("Using thread-local RecordingStream on macOS & Windows can result in data loss because of https://github.com/rerun-io/rerun/issues/3937"); // Give the batcher and sink threads a chance to process the data. std::thread::sleep(std::time::Duration::from_millis(500)); diff --git a/crates/re_viewer/data/quick_start_guides/cpp_connect.md b/crates/re_viewer/data/quick_start_guides/cpp_connect.md index d6b143bd3746..1dc6eeb9a3da 100644 --- a/crates/re_viewer/data/quick_start_guides/cpp_connect.md +++ b/crates/re_viewer/data/quick_start_guides/cpp_connect.md @@ -24,7 +24,7 @@ If you're using CMake, you can add the following to your `CMakeLists.txt`: ```cmake include(FetchContent) -FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP ON URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link +FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link FetchContent_MakeAvailable(rerun_sdk) ``` diff --git a/docs/code-examples/CMakeLists.txt b/docs/code-examples/CMakeLists.txt index eeaa9d81436f..de1b063735b1 100644 --- a/docs/code-examples/CMakeLists.txt +++ b/docs/code-examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # Setup builds for examples file(GLOB sources_list true ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/docs/code-examples/roundtrips.py b/docs/code-examples/roundtrips.py index 63dbaff0e975..2bff1eb0ffed 100755 --- a/docs/code-examples/roundtrips.py +++ b/docs/code-examples/roundtrips.py @@ -153,12 +153,21 @@ def main() -> None: if not args.no_py: active_languages.append("py") + # Running CMake in parallel causes failures during rerun_sdk & arrow build. + # TODO(andreas): Tell cmake in a single command to build everything at once. + if not args.no_cpp_build: + for example in examples: + example_opt_out_entirely = opt_out_run.get(example, []) + if "cpp" in example_opt_out_entirely: + continue + run_example(example, "cpp", args) + with multiprocessing.Pool() as pool: jobs = [] for example in examples: example_opt_out_entirely = opt_out_run.get(example, []) for language in active_languages: - if language in example_opt_out_entirely: + if language in example_opt_out_entirely or language == "cpp": # cpp already processed in series. continue job = pool.apply_async(run_example, (example, language, args)) jobs.append(job) diff --git a/docs/content/getting-started/cpp.md b/docs/content/getting-started/cpp.md index dad731e7cac6..76cb78aa8b68 100644 --- a/docs/content/getting-started/cpp.md +++ b/docs/content/getting-started/cpp.md @@ -32,7 +32,7 @@ add_executable(example_minimal main.cpp) You can add Rerun to your project using `FetchContent` ```cmake include(FetchContent) -FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP ON URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link +FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link FetchContent_MakeAvailable(rerun_sdk) ``` This will download a bundle with pre-built Rerun C static libraries for most desktop platforms, all Rerun C++ sources and headers, as well as CMake build instructions for them. @@ -49,14 +49,14 @@ target_link_libraries(example_minimal PRIVATE rerun_sdk) Combining the above, a minimal self-contained `CMakeLists.txt` looks like: ```cmake -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) project(example_minimal LANGUAGES CXX) add_executable(example_minimal main.cpp) # Download the rerun_sdk include(FetchContent) -FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP ON URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link +FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip) # TODO(#3962): update link FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/examples/cpp/clock/CMakeLists.txt b/examples/cpp/clock/CMakeLists.txt index 7c392d212ac5..d102da1e290e 100644 --- a/examples/cpp/clock/CMakeLists.txt +++ b/examples/cpp/clock/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # If you use the example outside of the Rerun SDK you need to specify # where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. @@ -16,7 +16,7 @@ else() # Download the rerun_sdk include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) + FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL}) FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/examples/cpp/custom_component_adapter/CMakeLists.txt b/examples/cpp/custom_component_adapter/CMakeLists.txt index cbd7347f7ed7..8d59f7c5e4a4 100644 --- a/examples/cpp/custom_component_adapter/CMakeLists.txt +++ b/examples/cpp/custom_component_adapter/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # If you use the example outside of the Rerun SDK you need to specify # where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. @@ -16,7 +16,7 @@ else() # Download the rerun_sdk include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) + FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL}) FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/examples/cpp/dna/CMakeLists.txt b/examples/cpp/dna/CMakeLists.txt index 698c82a8cfdc..29c3d87e3377 100644 --- a/examples/cpp/dna/CMakeLists.txt +++ b/examples/cpp/dna/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # If you use the example outside of the Rerun SDK you need to specify # where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. @@ -16,7 +16,7 @@ else() # Download the rerun_sdk include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) + FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL}) FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/examples/cpp/minimal/CMakeLists.txt b/examples/cpp/minimal/CMakeLists.txt index ecfebc476656..9399e58bad76 100644 --- a/examples/cpp/minimal/CMakeLists.txt +++ b/examples/cpp/minimal/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # If you use the example outside of the Rerun SDK you need to specify # where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. @@ -17,7 +17,7 @@ else() # Download the rerun_sdk include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) + FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL}) FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/examples/cpp/spawn_viewer/CMakeLists.txt b/examples/cpp/spawn_viewer/CMakeLists.txt index cf3f525e6a6a..de6ba5a6c9b7 100644 --- a/examples/cpp/spawn_viewer/CMakeLists.txt +++ b/examples/cpp/spawn_viewer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # If you use the example outside of the Rerun SDK you need to specify # where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. @@ -16,7 +16,7 @@ else() # Download the rerun_sdk include(FetchContent) - FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) + FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL}) FetchContent_MakeAvailable(rerun_sdk) # Rerun requires at least C++17, but it should be compatible with newer versions. diff --git a/pixi.toml b/pixi.toml index 13a87c8dcbb1..79b34c619803 100644 --- a/pixi.toml +++ b/pixi.toml @@ -93,7 +93,6 @@ cpp-test = { cmd = "export RERUN_STRICT=1 && ./build/rerun_cpp/tests/rerun_sdk_t ] } [dependencies] -arrow-cpp = "10.0.1" attrs = ">=23.1.0" blackdoc = "0.3.8" clang-tools = ">=15,<16" diff --git a/rerun_cpp/CMakeLists.txt b/rerun_cpp/CMakeLists.txt index 88c3807540ca..47c4f77f83f9 100644 --- a/rerun_cpp/CMakeLists.txt +++ b/rerun_cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # NOTE: CMake docs strongly discourages using GLOB, and instead suggests # manually listing all the files, like it's 1972. @@ -11,12 +11,15 @@ file(GLOB_RECURSE rerun_sdk_SRC CONFIGURE_DEPENDS add_library(rerun_sdk ${rerun_sdk_SRC}) +# Make sure the compiler can find include files for rerun when other libraries or executables link to rerun: +target_include_directories(rerun_sdk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) + # Rerun needs at least C++17. -set_property(TARGET rerun_sdk PROPERTY CXX_STANDARD 17) +set_target_properties(rerun_sdk PROPERTIES CXX_STANDARD 17) # Do multithreaded compiling on MSVC. if(MSVC) - target_compile_options(rerun_sdk PRIVATE /MP) + target_compile_options(rerun_sdk PRIVATE "/MP") endif() # ------------------------------------------------------------------------------ @@ -52,18 +55,8 @@ if(DEFINED RERUN_REPOSITORY) "${CMAKE_CURRENT_SOURCE_DIR}/src/rerun/c/rerun.h" NEWLINE_STYLE LF # Specify line endings, otherwise CMake wants to change them on Windows. ) - - # Add tests! - add_subdirectory(tests) endif() -# ------------------------------------------------------------------------------ - -# Make sure the compiler can find include files for rerun -# when other libraries or executables link to rerun: -# Note that we have to use different path for within the repo and exporting the project: -target_include_directories(rerun_sdk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) - # ------------------------------------------------------------------------------ # Setup rerun_c dependency: if(NOT DEFINED RERUN_C_LIB_DEFAULT) @@ -97,33 +90,136 @@ if("${RERUN_C_LIB}" STREQUAL "") message(FATAL_ERROR "RERUN_C_LIB is not set.") endif() -target_link_libraries(rerun_sdk PRIVATE ${RERUN_C_LIB}) +# For cleanliness, create a rerun_c target with the correct dependencies. +# This allows other targets to depend on rerun_c directly if they need to. +add_library(rerun_c STATIC IMPORTED) +set_target_properties(rerun_c PROPERTIES IMPORTED_LOCATION ${RERUN_C_LIB}) + +if(APPLE) + target_link_libraries(rerun_c INTERFACE "-framework CoreFoundation" "-framework IOKit") +elseif(UNIX) # if(LINUX) # CMake 3.25 + target_link_libraries(rerun_c INTERFACE "-lm -ldl -pthread") +elseif(WIN32) + target_link_libraries(rerun_c INTERFACE ws2_32.dll Bcrypt.dll Userenv.dll ntdll.dll) +endif() + +target_link_libraries(rerun_sdk PRIVATE rerun_c) # ----------------------------------------------------------------------------- # Arrow: -option(RERUN_ARROW_LINK_SHARED "Link to the Arrow shared library" ON) +if (WIN32) + # This makes the setup a lot easier on Windows where we otherwise need to put Arrow.dll either in path or copy it with the executable. + set(RERUN_ARROW_LINK_SHARED_DEFAULT OFF) +else() + # On non-windows platforms ld search path settings alleviate this concern and this makes linking faster! + set(RERUN_ARROW_LINK_SHARED_DEFAULT ON) +endif() +option(RERUN_ARROW_LINK_SHARED "Link to the Arrow shared library" ${RERUN_ARROW_LINK_SHARED_DEFAULT}) +option(RERUN_DOWNLOAD_AND_BUILD_ARROW "If enabled, arrow will be added as an external project and built with the minimal set required by the Rerun C++ SDK" ON) -find_package(Arrow REQUIRED) +if(RERUN_DOWNLOAD_AND_BUILD_ARROW) + include(ExternalProject) -if(RERUN_ARROW_LINK_SHARED) - message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}") - target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_shared) -else() - message(STATUS "Arrow version: ${ARROW_VERSION}") + set(ARROW_DOWNLOAD_PATH ${CMAKE_BINARY_DIR}/arrow) + + if(RERUN_ARROW_LINK_SHARED) + set(ARROW_BUILD_SHARED ON) + set(ARROW_BUILD_STATIC OFF) - if(WIN32) - message(WARNING "As of writing static linking with libarrow is broken on Windows. See https://github.com/apache/arrow/issues/33145") + if(APPLE) + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.dylib) + elseif(UNIX) # if(LINUX) # CMake 3.25 + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.so) + elseif(WIN32) + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/bin/arrow.dll) + else() + message(FATAL_ERROR "Unsupported platform.") + endif() + else() + set(ARROW_BUILD_SHARED OFF) + set(ARROW_BUILD_STATIC ON) + + if(APPLE) + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.a) + elseif(UNIX) # if(LINUX) # CMake 3.25 + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.a) + elseif(WIN32) + set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/arrow_static.lib) + else() + message(FATAL_ERROR "Unsupported platform.") + endif() endif() - target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_static) + # Enable multithreaded compiling of Arrow on MSVC. + if(MSVC) + set(DARROW_CXXFLAGS "/MP") + else() + set(DARROW_CXXFLAGS "") + endif() + + ExternalProject_Add( + arrow_cpp + PREFIX ${ARROW_DOWNLOAD_PATH} + GIT_REPOSITORY https://github.com/apache/arrow.git + GIT_TAG apache-arrow-10.0.1 + GIT_SHALLOW true + CMAKE_ARGS + --preset ninja-debug-minimal + -DARROW_IPC=ON + -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED} + -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC} + -DCMAKE_INSTALL_PREFIX=${ARROW_DOWNLOAD_PATH} + -DARROW_USE_ASAN=OFF + -DARROW_USE_TSAN=OFF + -DARROW_USE_UBSAN=OFF + -DARROW_JEMALLOC=OFF + -Dxsimd_SOURCE=BUNDLED + -DBOOST_SOURCE=BUNDLED + -DARROW_BOOST_USE_SHARED=OFF + -DARROW_CXXFLAGS=${DARROW_CXXFLAGS} + SOURCE_SUBDIR cpp + BUILD_BYPRODUCTS ${ARROW_LIBRARY_FILE} + ) + + # arrow_cpp target is not a library. Assemble one from it. + if(RERUN_ARROW_LINK_SHARED) + add_library(RerunArrowTarget SHARED IMPORTED) + + # For windows we need to know both the dll AND the import library. + if(WIN32) + set_target_properties(RerunArrowTarget PROPERTIES IMPORTED_IMPLIB ${ARROW_DOWNLOAD_PATH}/lib/arrow.lib) + endif() + else() + add_library(RerunArrowTarget STATIC IMPORTED) + target_compile_definitions(RerunArrowTarget INTERFACE ARROW_STATIC) + endif() + + add_dependencies(RerunArrowTarget arrow_cpp) + set_target_properties(RerunArrowTarget PROPERTIES + IMPORTED_LOCATION ${ARROW_LIBRARY_FILE} + INTERFACE_INCLUDE_DIRECTORIES ${ARROW_DOWNLOAD_PATH}/include + ) + + # Hack to propagate INTERFACE_INCLUDE_DIRECTORIES. + # via https://stackoverflow.com/a/47358004 + file(MAKE_DIRECTORY ${ARROW_DOWNLOAD_PATH}/include) +else() + find_package(Arrow REQUIRED) + + if(RERUN_ARROW_LINK_SHARED) + message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}") + add_library(RerunArrowTarget ALIAS Arrow::arrow_shared) + else() + message(STATUS "Arrow version: ${ARROW_VERSION}") + add_library(RerunArrowTarget ALIAS Arrow::arrow_static) + endif() endif() +target_link_libraries(rerun_sdk PRIVATE RerunArrowTarget) + # ----------------------------------------------------------------------------- -# Other dependencies: -if(APPLE) - target_link_libraries(rerun_sdk PRIVATE "-framework CoreFoundation" "-framework IOKit") -elseif(UNIX) # if(LINUX) # CMake 3.25 - target_link_libraries(rerun_sdk PRIVATE "-lm -ldl -pthread") -elseif(WIN32) - target_link_libraries(rerun_sdk PUBLIC ws2_32.dll Bcrypt.dll Userenv.dll ntdll.dll) +# Add test subfolder if we're inside the Rerun repository +# (we don't ship them in our fetch-content bundle) +if(DEFINED RERUN_REPOSITORY) + add_subdirectory(tests) endif() diff --git a/rerun_cpp/src/rerun/c/rerun.h b/rerun_cpp/src/rerun/c/rerun.h index d8cfd7d3eb44..ebe06a027c87 100644 --- a/rerun_cpp/src/rerun/c/rerun.h +++ b/rerun_cpp/src/rerun/c/rerun.h @@ -1,5 +1,5 @@ // ---------------------------------------------------------------------------- -// The Rerun C SDK for Rerun version 0.10.0-alpha.7+dev +// The Rerun C SDK for Rerun version 0.10.0-alpha.9+dev // ---------------------------------------------------------------------------- // This file is part of the rerun_c Rust crate. // EDITS TO COPIES OUTSIDE OF RERUN_C WILL BE OVERWRITTEN. diff --git a/rerun_cpp/tests/CMakeLists.txt b/rerun_cpp/tests/CMakeLists.txt index ca3108a42565..d32a4ba7c8d0 100644 --- a/rerun_cpp/tests/CMakeLists.txt +++ b/rerun_cpp/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) # Catch2: Include(FetchContent) @@ -17,25 +17,5 @@ add_executable(rerun_sdk_tests ${rerun_sdk_tests_SRC}) set_default_warning_settings(rerun_sdk_tests) - -# ----------------------------------------------------------------------------- -# Arrow: -option(ARROW_LINK_SHARED "Link to the Arrow shared library" ON) - -find_package(Arrow REQUIRED) - -# Arrow requires a C++17 compliant compiler -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -message(STATUS "Arrow version: ${ARROW_VERSION}") -message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}") - -if(ARROW_LINK_SHARED) - target_link_libraries(rerun_sdk_tests PRIVATE Arrow::arrow_shared) -else() - target_link_libraries(rerun_sdk_tests PRIVATE Arrow::arrow_static) -endif() - -# Include arrow explicitly again, otherwise the arrow headers won't be declared as system headers. -# and instead become regular headers, causing warnings to be emitted. -target_link_libraries(rerun_sdk_tests PRIVATE loguru::loguru Catch2::Catch2 rerun_sdk) +# Include arrow explicitly again, otherwise the arrow headers won't be found. +target_link_libraries(rerun_sdk_tests PRIVATE loguru::loguru Catch2::Catch2 rerun_sdk RerunArrowTarget) diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt index 95f66f5d5d33..cb94e680a274 100644 --- a/tests/cpp/CMakeLists.txt +++ b/tests/cpp/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) add_subdirectory(roundtrips) diff --git a/tests/cpp/roundtrips/CMakeLists.txt b/tests/cpp/roundtrips/CMakeLists.txt index 1711ce96aece..2cd9e55f352c 100644 --- a/tests/cpp/roundtrips/CMakeLists.txt +++ b/tests/cpp/roundtrips/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.27) file(GLOB sources_list LIST_DIRECTORIES true ${CMAKE_CURRENT_SOURCE_DIR}/*) diff --git a/tests/roundtrips.py b/tests/roundtrips.py index d673d1693c98..d53d39bb8f74 100755 --- a/tests/roundtrips.py +++ b/tests/roundtrips.py @@ -107,11 +107,20 @@ def main() -> None: print("----------------------------------------------------------") print(f"Building {len(archetypes)} archetypes…") + # Running CMake in parallel causes failures during rerun_sdk & arrow build. + # TODO(andreas): Tell cmake in a single command to build everything at once. + if not args.no_cpp_build: + for arch in archetypes: + arch_opt_out = opt_out.get(arch, []) + if "cpp" in arch_opt_out: + continue + build(arch, "cpp", args) + with multiprocessing.Pool() as pool: jobs = [] for arch in archetypes: arch_opt_out = opt_out.get(arch, []) - for language in ["cpp", "py", "rust"]: + for language in ["py", "rust"]: if language in arch_opt_out: continue job = pool.apply_async(build, (arch, language, args))