open-telemetry / open-telemetry/opentelemetry-cpp

ext/src/dll/input.src hardcodes "v1", and thus WITH_ABI_VERSION_2=1 does not work

Open
#3,646 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Describe your environment
Windows 11, VS2022, cmake-4.1.1

Steps to reproduce
Attempt to build opentelemetry 1.22.0 on Windows as a single shared dll using v2 ABI using the following command (passing -DOPENTELEMETRY_BUILD_DLL=1 and -DWITH_ABI_VERSION_2=ON -DWITH_ABI_VERSION_1=OFF to cmake):

cmake %BUILD_ROOT%\otel-1.22.0\opentelemetry-cpp-1.22.0 -DCMAKE_CXX_FLAGS="/std:c++17 /EHsc" -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_BUILD_TYPE=Release -GNinja -DWITH_ABI_VERSION=2 -DWITH_ABI_VERSION_2=ON -DWITH_ABI_VERSION_1=OFF -DBUILD_TESTING=OFF -DWITH_ABSEIL=ON -DWITH_DEPRECATED_SDK_FACTORY=OFF -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DWITH_OTLP_HTTP=ON -DWITH_OTLP_HTTP_COMPRESSION=ON -DWITH_EXAMPLES=OFF -DWITH_EXAMPLES_HTTP=OFF -DWITH_OTLP_HTTP_SSL_PREVIEW=ON -DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=%BUILD_ROOT%\otel-1.22.0\openssl_home -DCURL_USE_STATIC_LIBS=TRUE -DOPENTELEMETRY_BUILD_DLL=1 -DOPENTELEMETRY_INSTALL=ON -DOTELCPP_PROTO_PATH=%BUILD_ROOT_UNIX%/otel-1.22.0/opentelemetry-proto-1.7.0 -DCMAKE_INSTALL_PREFIX=%BUILD_ROOT%\otel-1.22.0\Release\opentelemetry-cpp-1.22.0-bin -DCMAKE_PREFIX_PATH="%BUILD_ROOT%\otel-1.22.0\Release\json-3.12.0-bin;%BUILD_ROOT%\otel-1.22.0\Release\zlib-1.3.1-bin;%BUILD_ROOT%\otel-1.22.0\libcurl;%BUILD_ROOT%\otel-1.22.0\openssl;%BUILD_ROOT%\otel-1.22.0\Release\googletest-1.17.0-bin;%BUILD_ROOT%\otel-1.22.0\Release\benchmark-1.9.4-bin;%BUILD_ROOT%\otel-1.22.0\Release\protobuf-32.0-bin;%BUILD_ROOT%\otel-1.22.0\Release\abseil-cpp-20250512.1-bin"

What is the expected behavior?
What did you expect to see?
A working opentelemetry_cpp.dll is generated after building.

What is the actual behavior?
What did you see instead?
A stub opentelemetry_cpp.dll is generated after building because ext/src/dll/input.src hardcodes "v1" . Hence the pattern matching in ext\src\dll\make_def.ps1 fails and the generated build\ext\src\dll\opentelemetry_cpp.def file contains no exports...

Additional context
Add any other context about the problem here.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read ext/src/dll/input.src and ext/src/dll/make_def.ps1, then reproduce the Windows shared-DLL build with WITH_ABI_VERSION_2=ON and WITH_ABI_VERSION_1=OFF. Done means the generated build/ext/src/dll/opentelemetry_cpp.def contains exports and the resulting opentelemetry_cpp.dll is not a stub.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, powershell
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.