Allow profiler development on arm64 macOS #2573
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
This PR tweaks the ruby platform check prior to compiling the profiling native extension to allow compilation on arm64 macOS.
We already allowed for arm64 on Linux, but the architecture is reported differently on macOS than on Linux (aarch64 vs arm64). (Because of course it would be reported differently!)
Motivation:
We don't officially support the Continuous Profiler on macOS BUT it actually mostly works, and so we have a toggle to enable it for development and testing purposes.
But up until now all macOS development had been on x86-64, and thus I had not noticed that our checks were too restrictive to allow development on arm64 macOS.
Additional Notes:
If there's enough customer interest, we may explore officially supporting profiling on macOS at some point.
How to test the change?:
Change includes test coverage. You can also test it if you have an arm64 macOS machine, by checking that
DD_PROFILING_MACOS_TESTING=true bundle exec rake clean compile
does not complain about the architecture not being supported.
(It will probably complain about a missing libdatadog, which is another thing you'll need to compile manually on macOS).