Skip to content

Commit f2df1b0

Browse files
authored
GH-51632: [C++][CI] Link OpenTelemetry libs for parquet-arrow-reader-writer-tracing-test depending on System vs Bundled OpenTelemetry (#51633)
### Rationale for this change After merging #51606 some debian jobs that use System opentelemetry were failing with missing symbols. ### What changes are included in this PR? Change what we link depending on bundled vs system OpenTelemetry. ### Are these changes tested? Yes all the CI jobs that the previous issue and this new issue had failing have been exercised and are successful ### Are there any user-facing changes? No ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [x] Human - [ ] AI **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed * GitHub Issue: #51632 Authored-by: Raúl Cumplido <raulcumplido@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent dc90604 commit f2df1b0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎cpp/src/parquet/CMakeLists.txt‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,20 @@ add_parquet_test(arrow-reader-writer-test
413413
arrow/variant_test.cc)
414414

415415
if(ARROW_WITH_OPENTELEMETRY)
416+
if(opentelemetry-cpp_SOURCE STREQUAL "SYSTEM")
417+
# System OpenTelemetry is not bundled with libarrow.
418+
# We need to link against it explicitly otherwise we get missing symbols.
419+
set(EXTRA_TEST_LINK_LIBS ${ARROW_OPENTELEMETRY_LIBS})
420+
else()
421+
# Bundled OpenTelemetry is statically linked into libarrow; linking it
422+
# again duplicates globals and causes a double free at exit.
423+
set(EXTRA_TEST_LINK_LIBS opentelemetry-cpp::sdk)
424+
endif()
416425
add_parquet_test(arrow-reader-writer-tracing-test
417426
SOURCES
418427
arrow/arrow_reader_writer_tracing_test.cc
419428
EXTRA_LINK_LIBS
420-
opentelemetry-cpp::sdk)
429+
${EXTRA_TEST_LINK_LIBS})
421430
endif()
422431

423432
add_parquet_test(arrow-index-test SOURCES arrow/index_test.cc)

0 commit comments

Comments
 (0)