kou commented on code in PR #51606:
URL: https://github.com/apache/arrow/pull/51606#discussion_r4121914360
##########
cpp/src/parquet/CMakeLists.txt:
##########
@@ -412,12 +412,18 @@ add_parquet_test(arrow-reader-writer-test
arrow/arrow_statistics_test.cc
arrow/variant_test.cc)
-if(ARROW_WITH_OPENTELEMETRY AND NOT ARROW_USE_ASAN)
+if(ARROW_WITH_OPENTELEMETRY)
+ # Use extra include directories and compile definitions for OpenTelemetry
+ # instead of linking otherwise we double link it, libarrow already contains
it
+ # and ASAN/TSAN fails with double free errors.
add_parquet_test(arrow-reader-writer-tracing-test
SOURCES
arrow/arrow_reader_writer_tracing_test.cc
- EXTRA_LINK_LIBS
- ${ARROW_OPENTELEMETRY_LIBS})
+ EXTRA_INCLUDES
+
$<TARGET_PROPERTY:opentelemetry-cpp::trace,INTERFACE_INCLUDE_DIRECTORIES>
+ DEFINITIONS
+
$<TARGET_PROPERTY:opentelemetry-cpp::trace,INTERFACE_COMPILE_DEFINITIONS>
Review Comment:
Can we use `opentelemetry-cpp::sdk` instead? It seems that
`opentelemetry-cpp::sdk` just provides include path and definitions.
```diff
diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt
index 59ac952652..a5519cc5a2 100644
--- a/cpp/src/parquet/CMakeLists.txt
+++ b/cpp/src/parquet/CMakeLists.txt
@@ -417,7 +417,7 @@ if(ARROW_WITH_OPENTELEMETRY AND NOT ARROW_USE_ASAN)
SOURCES
arrow/arrow_reader_writer_tracing_test.cc
EXTRA_LINK_LIBS
- ${ARROW_OPENTELEMETRY_LIBS})
+ opentelemetry-cpp::sdk)
endif()
add_parquet_test(arrow-index-test SOURCES arrow/index_test.cc)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]