[PROF-13732] Enable testing libdatadog-based features on macOS #5351
[PROF-13732] Enable testing libdatadog-based features on macOS #5351
Conversation
BenchmarksBenchmark execution time: 2026-03-16 15:36:22 Comparing candidate commit 9baf8ac in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 0 unstable metrics.
|
|
TODO for myself : Since this branch is not (yet) targeting master, most of CI checks are not running. Once #5274 is merged and this branch I should check that the extra tests are successfully running on our macOS CI jobs. |
29113a3 to
30c93b0
Compare
913e09d to
9330399
Compare
Use of libdatadog will make this helper more and more common so let's put it in a central location.
I chose to keep the `skip_if_libdatadog_not_supported` as I like seeing the skip on the rspec output but this is very debatable so if you're unconvinced I don't mind too much going the other way.
Now that we do have separate libdatadog testing, it's time to decouple this from profiling!
3a574e5 to
897c78c
Compare
|
Update: Rebased this on top of current master (to pull in latest libdatadog v28) |
This avoids the previous approach of manually keeping them in sync (and we were missing the new `libdatadog_extconf_helpers_spec.rb`). I've also removed any duplicates.
I think it's safe to assume folks on macOS on arm64 are not running 10 year old compilers.
|
Now that we have this up-and-running in CI I've found a new more things that need work (which is why "Test macOS" is failing) so I'm moving this to draft while I work on them |
Fix
```
../../../../ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c:245:14: error: unused function 'rescued_after_gvl_running_from_postponed_job' [-Werror,-Wunused-function]
245 | static VALUE rescued_after_gvl_running_from_postponed_job(VALUE self_instance);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c:1499:14: error: unused function 'handle_sampling_failure_rescued_after_gvl_running_from_postponed_job' [-Werror,-Wunused-function]
1499 | static VALUE handle_sampling_failure_rescued_after_gvl_running_from_postponed_job(VALUE self_instance, VALUE exception) {
|
```
BIG thanks to @y9v for helping me debug this!
2830ed2 to
0474675
Compare
Fix
```
../../../../ext/datadog_profiling_native_extension/collectors_thread_context.c:293:14: error: unused function '_native_on_gvl_waiting' [-Werror,-Wunused-function]
293 | static VALUE _native_on_gvl_waiting(DDTRACE_UNUSED VALUE self, VALUE thread);
| ^~~~~~~~~~~~~~~~~~~~~~
../../../../ext/datadog_profiling_native_extension/collectors_thread_context.c:294:14: error: unused function '_native_gvl_waiting_at_for' [-Werror,-Wunused-function]
294 | static VALUE _native_gvl_waiting_at_for(DDTRACE_UNUSED VALUE self, VALUE thread);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/datadog_profiling_native_extension/collectors_thread_context.c:295:14: error: unused function '_native_on_gvl_running' [-Werror,-Wunused-function]
295 | static VALUE _native_on_gvl_running(DDTRACE_UNUSED VALUE self, VALUE thread);
| ^~~~~~~~~~~~~~~~~~~~~~
../../../../ext/datadog_profiling_native_extension/collectors_thread_context.c:296:14: error: unused function '_native_sample_after_gvl_running' [-Werror,-Wunused-function]
296 | static VALUE _native_sample_after_gvl_running(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE thread, VALUE allow_exception);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ext/datadog_profiling_native_extension/collectors_thread_context.c:297:14: error: unused function '_native_apply_delta_to_cpu_time_at_previous_sample_ns' [-Werror,-Wunused-function]
297 | static VALUE _native_apply_delta_to_cpu_time_at_previous_sample_ns(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE thread, VALUE delta_ns);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This isn't working because of the wrong DYLIB issue + I suspect the rpath on the receiver is not correct, so for now we're disabling it and maybe we'll timebox a fix later.
|
So right now the macOS tests are passing by using the hacks in extconf.rb but we might wait until the actual upstream libdatadog fix lands in DataDog/libdatadog#1646 so we can remove them. |
…ibility Fix compatibility issues with MacOS
|
Update: Libdatadog v29 is now on rubygems.org; once master gets moved to it I expect we'll finally be ready to land this PR |
**What does this PR do?** This PR bumps the libdatadog dependency from version 28.0.2.1.0 to 29.0.0.1.0. This new version brings: * macOS build fixes needed to unblock #5351 * libdatadog support for the [OTel process context](open-telemetry/opentelemetry-specification#4719) (I plan to submit a PR with some integration for testing this separately -- commit is already waiting) **Motivation:** Adopt latest libdatadog. **Change log entry** Yes. Upgrade libdatadog dependency to version 29.0.0 **Additional Notes:** N/A **How to test the change?** Green CI is good, as usual.
|
We're finally good to go! macOS testing all green! |
|
I'm going to go ahead and merge this one: this PR hasn't substantially changed from when it was initially reviewed, the only difference was merging in master which brought in libdatadog 29 which fixed all the issues we saw before. |
This was changed in #5351 which was concurrently worked on with this PR.
What does this PR do?
With the upgrade to libdatadog v27 in #5274, we finally have libdatadog builds on rubygems.org. This PR adjusts our testing logic to:
I ended up also de-duplicating some of our helper code, hopefully simplifying how we do this kind of integration.
Motivation:
Make sure libdatadog features are working and keep working on macOS.
Change log entry
Yes. Enable libdatadog-based features on macOS
Additional Notes:
This PR is on top of #5274, so we can only merge it once that one's in good shape.
I don't have a macOS machine available myself, so please let me know if I missed a spot!
How to test the change?
The existing tests are now executed and not skipped on macOS so that should be the validation :)