[crashtracker] Gate compilation using cargo features#541
Conversation
74f236f to
08aa381
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #541 +/- ##
==========================================
- Coverage 70.45% 70.45% -0.01%
==========================================
Files 208 213 +5
Lines 28414 28408 -6
==========================================
- Hits 20020 20014 -6
Misses 8394 8394
|
BenchmarksThis comment was omitted because it was over 65536 characters.Please check the Gitlab Job logs to see its output. |
Looks like this also needs changes to ffi
sanchda
left a comment
There was a problem hiding this comment.
LGTM--pretty reasonable-looking refactor with minimal changes to how the code operates.
| @@ -1,12 +1,13 @@ | |||
| // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | |||
There was a problem hiding this comment.
Silly question: do these copyright notices indicate the year of first existence for the noted file, or the last update?
There was a problem hiding this comment.
I assume first year of existence. At Amazon we stopped using years, and went to a SPDX header which was much cleaner
What does this PR do?
Adds two new cargo features:
collectorandreceiver. Refactors the code to make it easy to use thosecfgto define what gets built at compile time.Motivation
The current implementation of the library always builds in all code. This is not great, because it bloats binary size etc. We have users who
CrashInfoobjects, which they upload. They have no need or use for thereceiverorcollectorportions of this codeCrashInfoobject and send it on. They need all parts of the code.CrashInfoobject and send it on. The first binary needs thecollectorbut not thereceiver; the sidecar needs the opposite.Additional Notes
Currently, we don't have support when building the ffi library for feature selection. This is a first step towards making that worthwhile.
I did some refactoring as I moved code around, but there is still more refactoring that could be done.
How to test the change?
This is a refactor, existing tests cover the functionality
PROF-10245