opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Opentelemetry windows runtime issue

Open krishchanDr opened this issue 4 months ago • 6 comments

Opentelemtry is build on Windows 10 with shared libs on. When i linked to the test app and run the test app. i see below issue.

D:\workdir\win_shared_build\tc-monitor-cpp\build>.\bin\Release\runTests.exe WARNING: All log messages before absl::InitializeLog() is called are written to STDERR E0000 00:00:1758866127.468952 33748 descriptor_database.cc:633] File already exists in database: opentelemetry/proto/common/v1/common.proto F0000 00:00:1758866127.469228 33748 descriptor.cc:2236] Check failed: GeneratedDatabase()->Add(encoded_file_descriptor, size) *** Check failure stack trace: *** @ 00007FFCAF4B2499 (unknown) @ 00007FFC761C70DF (unknown) @ 00007FFC762234C6 (unknown) @ 00007FFC762234B2 (unknown) @ 00007FFC762234B2 (unknown) @ 00007FFD477AE473 (unknown) @ 00007FFD24900F86 (unknown) @ 00007FFD249010FC (unknown) @ 00007FFD49E29A1D (unknown) @ 00007FFD49E7D2F7 (unknown) @ 00007FFD49E7D08A (unknown) @ 00007FFD49E7D110 (unknown) @ 00007FFD49E7D110 (unknown) @ 00007FFD49EE3CB2 (unknown) @ 00007FFD49E85DEB (unknown) @ 00007FFD49E85C73 (unknown) @ 00007FFD49E85C1E (unknown)

krishchanDr avatar Sep 26 '25 05:09 krishchanDr

opentelemetry-cpp/cmake/opentelemetry-proto.cmake content,

if(CMAKE_SYSTEM_NAME MATCHES "Windows|MinGW|WindowsStore") list(APPEND OTELCPP_PROTO_TARGET_OPTIONS STATIC) elseif(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) list(APPEND OTELCPP_PROTO_TARGET_OPTIONS SHARED) else() list(APPEND OTELCPP_PROTO_TARGET_OPTIONS STATIC) endif()

Incase of windows the STATIC library is being build which further links same protobuf sources to multiple opentelemetry libs which is causing the issue. Is there any specific reason to hardcode like this ?

krishchanDr avatar Sep 30 '25 11:09 krishchanDr

Implemented in #2097. I mistakenly left the shared proto library without full support for non-Windows platforms. Apologies for the oversight. I’ll pick this up after my vacation and aim to finish it within a few days. I’ll update this thread once it’s done.

owent avatar Oct 03 '25 11:10 owent

Hi, Thanks for the update. Please reply in this thread once the code is updated.

Regards Chandra

krishchanDr avatar Oct 06 '25 08:10 krishchanDr

This issue was marked as stale due to lack of activity.

github-actions[bot] avatar Dec 06 '25 02:12 github-actions[bot]

#3714 is ready. Could this PR be marked as do-not-stale ?

owent avatar Dec 09 '25 13:12 owent

#3714 is ready. Could this PR be marked as do-not-stale ?

Done.

Note that stale as no effect, because the process to auto-close stale issues or PR is disabled.

marcalff avatar Dec 09 '25 13:12 marcalff