chore: Give every SDK source file a unique name #451
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 371 lines diff across 4 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.354
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #451"
general
weight: 0.35
fuzzybinary
refs: RUM-19189
Several of dd-sdk-cpp's source files have the same filename, just in different directories. For example:
c/attribute.cpp: implementation ofdd_attribute_tAPIcpp/attribute.cpp: implementation ofdatadog::AttributeAPIimpl/types/json/attribute.cpp: JSON serialization for attributesA static library identifies each object by basename alone, so as a result,
libddsdkcpp.aholds several members namedattribute.cpp.o.On macOS, an application's debug map refers to an object in a static library by library path, member name and timestamp. When same-named members also share a timestamp, as they do when the application links with
ZERO_AR_DATE=1,dsymutilskips them, and their debug info is missing from the application's dSYM.This PR renames source files to ensure that every
.cppfile has a unique name. This ensures that dSYMs contain all SDK symbols.## Renaming API-layer TUs
Most of the conflicts are due to the
.cppfiles for API headers having the same name as other implementation files. This PR applies a new convention for.cppfiles that implement public APIs:Old:
datadog/c/core.cpp(implementsinclude-c/core.h)datadog/cpp/core.cpp(implementsinclude-cpp/core.hpp)New:
datadog/c/core_c_api.cpp(implementsinclude-c/core.h)datadog/cpp/core_cpp_api.cpp(implementsinclude-cpp/core.hpp)(As a result, the existing
datadog/impl/core/core.cppis now unique.)This convention matches what we already do for API-layer test files, e.g. we already use
core_c_api_test.cppandcore_cpp_api_test.cpp.This change trips up
clang-format's automatic#includereordering: it always puts the "main header" for a given.cppfile at the top, but since the.cppand header files for these API TUs now have different names, it no longer recognizes the "main header" correctly. We address this issue with a change to.clang-format:With the defaults inherited from
BasedOnStyle: Google, the implicit default value is:...hence the addition of those patterns in our new value.
## Resolving the one remaining filename conflict
With the API-layer implementation files renamed, the only remaining conflict was between
core/context.cppandrum/context.cpp. This was resolved with one more rename:rum/context.hpp->rum/rum_context.hpprum/context.cpp->rum/rum_context.cpptests/impl/rum/context_test.cpp->tests/impl/rum/rum_context_test.cpp## Testing
Before this change, linking
replagainst the static library withZERO_AR_DATE=1and runningdsymutilprinted warnings about skipping debug map objects with a duplicate name and timestamp, and the dSYM had only 64 of the 79 SDK compile units in the debug map.After this change,
dsymutilprints no warnings and the dSYM has all 79 compile units.