Skip to content

Make libdatadog fetching optional#514

Open
xroche wants to merge 1 commit intoDataDog:mainfrom
algolia:feat/optional-vendored-deps
Open

Make libdatadog fetching optional#514
xroche wants to merge 1 commit intoDataDog:mainfrom
algolia:feat/optional-vendored-deps

Conversation

@xroche
Copy link
Contributor

@xroche xroche commented Mar 19, 2026

Summary

Findlibdatadog.cmake unconditionally runs a shell script at configure time to download libdatadog. This prevents providing it externally through Conan or system packages.

Add a DDPROF_FETCH_LIBDATADOG cache option (ON by default, no behavior change). When OFF, the download is skipped and find_package(Datadog) resolves through standard CMake search paths.

Elfutils fetching is left unchanged. Its build applies musl patches that make an external-provider path harder to support without CI coverage.

🤖 Generated with Claude Code

@xroche xroche force-pushed the feat/optional-vendored-deps branch 2 times, most recently from 50d9ad6 to 24ac38c Compare March 19, 2026 09:29
@xroche xroche marked this pull request as ready for review March 19, 2026 12:49
Add DDPROF_FETCH_LIBDATADOG option (ON by default). When OFF, the fetch
script is skipped and find_package(Datadog) resolves through standard
CMake search paths. This lets build systems like Conan provide
libdatadog as a proper dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xroche xroche force-pushed the feat/optional-vendored-deps branch from 24ac38c to a14f5be Compare March 19, 2026 13:48
@xroche xroche changed the title Make elfutils and libdatadog fetching optional Make libdatadog fetching optional Mar 19, 2026
@xroche
Copy link
Contributor Author

xroche commented Mar 19, 2026

Fair point on elfutils. Dropped the elfutils part entirely -- the musl patches make it hard to support an external provider without CI coverage.

This PR now only covers libdatadog, which has no patches and a clean find_package(Datadog) fallback.

@xroche xroche requested a review from r1viollet March 19, 2026 13:59
execute_process(
COMMAND "${CMAKE_SOURCE_DIR}/tools/fetch_libdatadog.sh" ${TAG_LIBDATADOG} ${Datadog_ROOT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND_ERROR_IS_FATAL ANY)
if(DDPROF_FETCH_LIBDATADOG)
Copy link
Collaborator

Choose a reason for hiding this comment

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

are changes in https://github.com/DataDog/ddprof/pull/504/changes enough to point to a relevant libdatadog install ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added an option to iterate locally on libdatadog changes, though maybe this fits both use cases ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Humm, our use case is slightly different: Conan injects find_package config through CMAKE_PREFIX_PATH, so there's no single path to set Datadog_LOCAL_ROOT to.

If #504 also sets DataDog_DIR unconditionally (outside the if), then find_package(Datadog) would find it through standard search paths and both use cases would be covered.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it, I'll adjust after #504 is in.

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