Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] allow building with -DWITH_OTLP_HTTP_COMPRESSION=OFF without zlib #3120

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

cfstras
Copy link
Contributor

@cfstras cfstras commented Nov 4, 2024

Issue

Currently, when building -DWITH_OTLP_HTTP_COMPRESSION=OFF, and not providing the libz dependency, we get this error:

...\opentelemetry-cpp\ext\src\http\client\curl\http_
client_curl.cc(6,10): error C1083: Cannot open include file: 'zconf.h': No such file or directory [...opentelemetry-cpp\build\ext\src\http\client\curl\opentelemetry_http_cli
ent_curl.vcxproj]

Changes

This fixes the issue by moving the #include <zconf.h> inside the corresponding #ifdef block, letting the build pass.

Do I need to do any of these? LMK, happy to :)

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@cfstras cfstras requested a review from a team as a code owner November 4, 2024 16:28
Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit d059280
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/6728f62d3eacbe0008cc31f0

@marcalff
Copy link
Member

marcalff commented Nov 4, 2024

This makes sense.

Note however that ENABLE_OTLP_COMPRESSION_PREVIEW is what we call a "feature flag":

  • the extra code path is protected with an ifdef, for now
  • building without the feature is allowed, for now

By the time the compression code is deemed stable, the feature flag will be removed, so the dependency at build time on zlib will become mandatory.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.88%. Comparing base (497eaf4) to head (d059280).
Report is 152 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3120      +/-   ##
==========================================
+ Coverage   87.12%   87.88%   +0.76%     
==========================================
  Files         200      195       -5     
  Lines        6109     6137      +28     
==========================================
+ Hits         5322     5393      +71     
+ Misses        787      744      -43     

see 99 files with indirect coverage changes

@marcalff marcalff added the ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) label Nov 4, 2024
@marcalff marcalff merged commit d16f781 into open-telemetry:main Nov 4, 2024
55 of 56 checks passed
@cfstras cfstras deleted the no-compression-compile branch November 5, 2024 13:18
@cfstras
Copy link
Contributor Author

cfstras commented Nov 5, 2024

Hi @marcalff Thanks for the note. I guess once it's stable, we'll have to bite the bullet and add that to our build scripts.

FWIW, for our situation compression is pretty unnecessary, we have a native binary running alongside a DataDog daemon on the same box, so data never leaves the box. More dependencies just complicate the already quite complex build process. Anyway, thanks for maintaining this, it's very helpful for us! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants