Repository navigation
feat(ruby): add macOS (darwin) platform support - #1463
Conversation
Add support for publishing macOS gems to RubyGems, enabling OpenFeature and Remote Configuration on macOS for local Ruby development. Changes: - Add arm64-darwin and x86_64-darwin to LIB_GITHUB_RELEASES - Add darwin gems to push_to_rubygems task - Add darwin platform normalization (arm64-darwin-24 -> arm64-darwin) - Add .dylib to EXECUTABLE_FILES for macOS permissions This addresses the issue where macOS users see: "cannot load such file -- libdatadog_api.3.2_arm64-darwin24" The darwin binaries are already built in GitHub releases but were not being packaged and published to RubyGems.
dc38f5a to
4ac076a
Compare
BenchmarksComparisonBenchmark execution time: 2026-01-22 19:55:17 Comparing candidate commit e5e3db6 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 2 unstable metrics. scenario:profile_add_sample2_frames_x1000
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
Test the Ruby gem scaffolding on macOS in addition to Linux. - Ruby 2.7+ runs on macos-latest (ARM/Apple Silicon) - Ruby 2.5-2.6 runs on macos-13 (Intel x86_64)
4ac076a to
43d9d53
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1463 +/- ##
==========================================
+ Coverage 71.11% 71.12% +0.01%
==========================================
Files 419 419
Lines 67067 67067
==========================================
+ Hits 47694 47703 +9
+ Misses 19373 19364 -9
🚀 New features to boost your workflow:
|
Keep only arm64-darwin (Apple Silicon) support for now. x86_64-darwin can be added later if there's customer demand.
Tests now use Libdatadog.current_platform instead of Gem::Platform.local to match the normalization that happens in the actual code. This fixes test failures on macOS where Gem::Platform.local returns versioned platform names (e.g., "arm64-darwin-22") but the code normalizes them to unversioned names (e.g., "arm64-darwin").
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-apple-darwin
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-apple-darwin
x86_64-unknown-linux-gnu
|
ivoanjo
left a comment
There was a problem hiding this comment.
I think this is almost good BUT ;)
It's hard/annoying/awkward to test this without releasing on rubygems.org. Yet, if we release this as-is right now, it will start getting picked up by customers on macOS and if something is broken, we've just broken installing the latest stable dd-trace-rb on macOS, which would kinda suck.
Here's my suggestion: libdatadog v26 just dropped. Let's update the hashes and versions and release v26 for macOS first.
The difference is such a major release is not picked up by the latest stable dd-trace-rb (needs changing on master), so we are able to let the macOS stuff stew for a few days and we can poke at it easily without impacting customers.
(If everything proves out to be fine, then I think we could even go back and maybe still release v25 for macOS, but in that situation we'd already be a lot more confident that we're in good shape overall)
Alternatively, if we don't want to wait for a next dd-trace-rb release, we could re-release all of v25, including macOS, and bump the This would accomplish two things:
...and I think in this case the risk would be way lower to upload v25 macOS on rubygems.org |
- Update libdatadog version from v25 to v26 - Update SHA256 hashes for v26 release assets - Add arm64-darwin to fallback package for BUNDLE_FORCE_RUBY_PLATFORM users - Decouple test from implementation by inlining platform normalization logic
|
Targeting v26 is fine for this for the reasons you mentioned. Locally validated:
|
ivoanjo
left a comment
There was a problem hiding this comment.
👍 LGTM
After getting this merged it's just a matter of triggering the publish action -- https://github.com/DataDog/libdatadog/tree/main/ruby#releasing-a-new-version-to-rubygemsorg . Anyone from the Ruby guild or libdatadog can approve the release.
Hardcode arm64-darwin since that's the only darwin platform we support.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
fa16176
into
main
Motivation
A customer is unable to use the openfeature (FFE) SDKs in their local Ruby server which blocks their integration.
What does this PR do?
Add support for publishing macOS gems to RubyGems, enabling OpenFeature and Remote Configuration on macOS for local Ruby development.
Changes:
This addresses the issue where macOS users see:
"cannot load such file -- libdatadog_api.3.2_arm64-darwin24"
The darwin binaries are already built in GitHub releases but were not being packaged and published to RubyGems.
https://github.com/DataDog/libdatadog/releases/tag/v25.0.0
Decisions
Artifact naming normalization
On macOS, Gem::Platform.local includes the Darwin kernel version:
But we can't publish a separate gem for every macOS version - that would mean releasing libdatadog-1.0.0-arm64-darwin-22.gem, libdatadog-1.0.0-arm64-darwin-23.gem, libdatadog-1.0.0-arm64-darwin-24.gem, etc. And we'd need to release new gems every time Apple ships a new macOS.
How Linux avoids this:
On Linux, Gem::Platform.local returns just x86_64-linux or aarch64-linux - no version number. The libc variant (glibc vs musl) is a separate concern. So one gem works across all Linux versions.
The workaround:
We publish a single arm64-darwin gem, then normalize at runtime:
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Github CI was expanded to include these platforms and all supported ruby versions with available github runners:
Local builds
I compiled locally, and installed both libdatadog and dd-trace-rb into a ruby server; along with running dd agent I was able to perform an e2e test of the openfeature (FFE) SDKs.
Next Steps
Enable RC-based tests in dd-trace-rb to exercise loading
libdatadogin macos.