feat: C/C++ API shared library targets - #9878
Conversation
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Let BUILD_SHARED_LIBS select default builds and test/example linkage without controlling target availability. Generate the Linux export policy in the build tree, document linker settings, reject unsupported export platforms, and honor CMake output directories. Assert exact fixture results and cover explicit shared linkage with BUILD_SHARED_LIBS off. Remove the redundant CI debug-info flag while retaining full symbols through the default level of 2 for sanitizer diagnostics. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | words_gather_scalar_avx2[65536] |
8.3 µs | 9.4 µs | -11.73% |
| ⚡ | WallTime | arrow_checked_add_u32_avx512[16384] |
21.4 µs | 17.6 µs | +21.51% |
| ⚡ | WallTime | arrow_checked_add_u32_avx2[16384] |
21.4 µs | 17.6 µs | +21.15% |
| ⚡ | WallTime | filtered_owned_i64_avx512[OneNullInEight] |
26.3 µs | 22.7 µs | +15.71% |
| ⚡ | WallTime | mul_i32_nonnull_avx512 |
7.9 µs | 7.1 µs | +11.18% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ad/cxx-shared-lib (cd1c57b) with develop (fefcab0)2
Footnotes
-
218 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(a65c653) during the generation of this report, so fefcab0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Defer disabling linker depfiles until the FFI directory finishes configuring, preserving child settings and explicit archive and export-script dependencies. This avoids GNU ld's unescaped paths forcing relinks in build directories containing spaces. Format the shared-build freshness assertion for Ruff. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Rename vortex_cxx to vortex_cxx_static and update coverage and test references. Keep the public alias and archive filename unchanged, and document the PIC and visibility settings. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Cached GCC objects embed the original gcda output path, so sccache hits after the static target rename leave the coverage directory empty. Clear inherited and cached C++ compiler launchers in the coverage script while preserving caching for other builds. Add isolated CMake regression tests for environment and cache launcher settings, exercising real compilation, CTest, and coverage data generation. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Enable shared linkage for the C API test build and both FFI sanitizer jobs, matching the existing C++ API job. This avoids linking the Rust archive separately into each test and example executable. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Build shared libraries in the coverage script and collect data from vortex_cxx_shared.dir. Update the regression fixture to honor BUILD_SHARED_LIBS and require coverage in the shared target directory. Clarify how the empty environment assignment and CMake cache option disable compiler launchers for coverage builds. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Remove the coverage and shared-FFI integration tests and their supporting fixture changes. Preserve compatibility updates to existing tests and shorten the coverage launcher comment. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Keep the CMake cache option that disables caching for coverage targets and remove the environment override used only for compiler probes. Explain the stale gcda path issue next to the flag. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Namespace sccache entries by the CMake target's build directory and name so renamed targets cannot reuse GCC objects with stale gcda paths. Preserve the inherited launcher and any existing custom cache key while retaining warm-cache hits. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Pass --coverage through CMAKE_SHARED_LINKER_FLAGS so the C-linked FFI shared library resolves its gcov runtime internally. Document the runtime-linking and target-specific compiler cache settings. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Allow users to build and link against shared library targets for the C/C++ API:
To enable shared libs, enable:
BUILD_SHARED_LIBS=ON.As part of this, we switch to using shared libs on CI to cut down link time from static libs.