Skip to content

Guard cppcheck dependency on target existence#510

Closed
xroche wants to merge 1 commit into
DataDog:mainfrom
algolia:fix/cppcheck-target-guard
Closed

Guard cppcheck dependency on target existence#510
xroche wants to merge 1 commit into
DataDog:mainfrom
algolia:fix/cppcheck-target-guard

Conversation

@xroche

@xroche xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Summary

CMake configure fails on systems without cppcheck installed because add_dependencies(cppcheck DDProf::Parser) references a target that only exists when find_program finds the cppcheck binary. This breaks CI containers, Conan builds, and minimal dev setups.

CMake's if(TARGET) is the recommended guard for conditionally-created targets.

How

Wrap the add_dependencies call in if(TARGET cppcheck). No behavior change when cppcheck is installed.

🤖 Generated with Claude Code

@xroche
xroche marked this pull request as ready for review March 19, 2026 09:13
@xroche
xroche marked this pull request as draft March 19, 2026 09:14
The `cppcheck` target is only created when CppcheckConfig.cmake finds
the cppcheck binary. The unconditional `add_dependencies(cppcheck ...)`
breaks CMake configure on systems without cppcheck installed (CI
containers, Conan builds, minimal dev setups).

Wrap the call in `if(TARGET cppcheck)` so the build works regardless.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@xroche
xroche force-pushed the fix/cppcheck-target-guard branch from f9463d3 to f630cd4 Compare March 19, 2026 09:16
@xroche
xroche marked this pull request as ready for review March 19, 2026 09:16
@xroche

xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

@r1viollet @nsavoire This is the first PR of 5 PRs to make the build more friendly towards packagers such as Conan. Let me know if this out-of-scope for you (we could keep the patches outside)

@r1viollet

Copy link
Copy Markdown
Collaborator

@xroche thanks for reaching out. I think a lot of these are fine. Please note that we are progressively reducing efforts on ddprof and moving towards the OTel profiler.
I would be interested in knowing if some of our efforts around eBPF OTel profiler fit your requirements. You would essentially get profiling either as a standalone OTel component or through the Datadog agent (deploying the OTel profiler for you).

@r1viollet r1viollet closed this Mar 19, 2026
@xroche

xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Please note that we are progressively reducing efforts on ddprof and moving towards the OTel profiler.

Thanks for the hint! We have two concerns though:

  • Unless I'm mistaken, The OTel eBPF profiler is CPU-only: there is no allocation tracking, no live heap profiling, and we really need this part.
  • Using a separate sidecar container is simpler, but this also means less control (currently we can programmatically start the profiling inside the code)

For now we haven't been able to use ddprof reliably though (due to issues crashing on production); but the traces seems to be doing exactly what we want for CPU and memory

@r1viollet

Copy link
Copy Markdown
Collaborator

Yes, it is CPU only. We will be working on bringing the memory story to OTel.
I'll reach out again when we have a memory solution compatible with OTel.

@xroche

xroche commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Yes, it is CPU only. We will be working on bringing the memory story to OTel. I'll reach out again when we have a memory solution compatible with OTel.

We also have concerns regarding symbolization: we host private binaries and libraries on pods, with dbgsym packages installed for resolving the addresses.

The dbgsym size is approximately 4GB for all services.

If the symbolization of OTel is done on a backend, does it mean we need to push 4GB of debugging info remotely each time we deploy (that is several times a day) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants