open-telemetry / open-telemetry/opentelemetry-cpp
Compile-only coverage for installed public headers
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 632
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 75
Description
Follow-up to #4299 / #4306.
#4299 was a compile error in an installed header (file_http_server.h) that no in-repo translation unit included, so CI never compiled it on any platform. #4306 resolved that specific case by removing the unused header, but the underlying gap remains: an installed public header that nothing in the repo includes is never compiled by CI, so a break in one only surfaces when a downstream consumer builds it (and platform-specific breaks, like a Windows-only error, are especially easy to miss).
Proposal
Add a compile-only target that #includes each installed public header and is built (not run) on Linux, macOS, and Windows, so CI fails if any installed header stops compiling standalone.
A few things I'd want input on before implementing, rather than sending a large PR cold:
- Scope: start with
ext/include/opentelemetry/ext/**(where #4299 was), or also cover the api/sdk/exporters installed headers? - Build-option conditionality: many headers are gated on options (
WITH_OTLP_*, etc.), so the target would compile whatever the current build config enables, matching each CI job's flags. Does that fit the existing CI matrix, or is there a preferred shape? - Discovery: glob the installed headers at configure time, or keep an explicit list?
- Build systems: cover both CMake and Bazel, or start with one?
If this is welcome I'm happy to implement it. If there's a known reason it hasn't been done (e.g. the option-conditionality makes it awkward), I'd rather hear that first.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading #4299 and #4306, then inspect file_http_server.h, the installed headers under ext/include/opentelemetry/ext/**, and the existing CMake and Bazel CI configuration. Resolve the proposed scope, option handling, header discovery, and build-system coverage before implementing. Done means standalone compilation of the selected installed public headers is exercised across Linux, macOS, and Windows CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100