bazel: dd_cc_packaged: Introduce a new data attribute #58283
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 316 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #58283"
general
weight: 0.35
0intro
<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->
What does this PR do?
Introduce a new
data&modeattributes, meant to replace the existinginstalled_files&installed_executables.installed_filesis fully removed,installed_executableis only deprecated for now.The
dataattribute wasn't collectingpkg_fileswhile advertising so. This is now fixed and allows us to replaceinstalled_fileswithdata.Instead of guessing the file mode based on the versioning info (which usually works, but not for some of python's modules) we now provide a mode attribute that allows to enforce a given mode. If missing, the value is guess as it currently is, by assuming a binary with a version will denote a shared library, or an executable otherwise.
Motivation
Entries in
installed_filesandinstalled_executablesare not walked bydd_collect_dependencies,so their own dependencies are never collected, and
installed_filescannot take a packaged library.This blocks the native CPython build, where libpython must bring its extension modules, which
themselves depend on other libraries that need to end up in the packages.
These are runtime dependencies, for which
datais the natural Bazel attribute, already walked bythe
dd_collect_dependenciesaspect.The current API also forces executables to be attached to their library through
installed_executables, so packages depend on the library while what they install is the binary.With
data, curl and openscap now package their binaries separately, depending on thelibrary's package, which also removes their dependency cycle workarounds. The agent and heroku
packages depend on
@curl//:curl_bin_pkg, the agent package on//deps/msodbcsql18:msodbcsql_pkgdirectly, and
pkg/compliance/clion the openscap binaries' packages.installed_executablesremains for krb5, openssl and the current CPython build, until they move tonative Bazel builds. This is because the target we build there aren't regular cc_library. Since we will likely convert those to native bazel built libraries, handling them in this PR would be throwaway work.
Describe how you validated your changes
The list of installed files is equivalent before and after the change.
Also used to verify that with the migration of python to native bazel: https://github.com/DataDog/datadog-agent/pull/58194
Additional Notes