Skip to content

Compile-only coverage for installed public headers #4310

Description

@thc1006

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 [BUG] file_http_server.h does not compile on Windows #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions