libdatadog 30.0.0.1.0 → 35.0.0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/libdatadog.gemspec +43 -0
  4. data/rust-toolchain.toml +6 -0
  5. data/tasks/build.rake +177 -0
  6. data/tasks/gem.rake +249 -0
  7. data/vendor/libdatadog-35.0.0/aarch64-linux/LICENSE-3rdparty.csv +550 -0
  8. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/bin/libdatadog-crashtracking-receiver +0 -0
  9. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux}/include/datadog/common.h +105 -19
  10. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux}/include/datadog/data-pipeline.h +154 -8
  11. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux}/include/datadog/ffe.h +7 -3
  12. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/profiling.h +36 -0
  13. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux}/include/datadog/telemetry.h +21 -0
  14. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/lib/libdatadog_profiling.so +0 -0
  15. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  16. data/vendor/libdatadog-35.0.0/aarch64-linux-musl/LICENSE-3rdparty.csv +550 -0
  17. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/bin/libdatadog-crashtracking-receiver +0 -0
  18. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/common.h +105 -19
  19. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/data-pipeline.h +154 -8
  20. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/ffe.h +7 -3
  21. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/profiling.h +36 -0
  22. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/telemetry.h +21 -0
  23. data/vendor/libdatadog-35.0.0/aarch64-linux-musl/lib/libdatadog_profiling.so +0 -0
  24. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  25. data/vendor/libdatadog-35.0.0/arm64-darwin/LICENSE-3rdparty.csv +550 -0
  26. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/bin/libdatadog-crashtracking-receiver +0 -0
  27. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/arm64-darwin}/include/datadog/common.h +105 -19
  28. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/data-pipeline.h +154 -8
  29. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/ffe.h +7 -3
  30. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/arm64-darwin}/include/datadog/profiling.h +36 -0
  31. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/arm64-darwin}/include/datadog/telemetry.h +21 -0
  32. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/lib/libdatadog_profiling.dylib +0 -0
  33. data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  34. data/vendor/libdatadog-35.0.0/x86_64-linux/LICENSE-3rdparty.csv +550 -0
  35. data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/bin/libdatadog-crashtracking-receiver +0 -0
  36. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/common.h +2900 -0
  37. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/data-pipeline.h +349 -0
  38. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/ffe.h +179 -0
  39. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/profiling.h +1130 -0
  40. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/telemetry.h +307 -0
  41. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux}/lib/libdatadog_profiling.so +0 -0
  42. data/vendor/libdatadog-35.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  43. data/vendor/libdatadog-35.0.0/x86_64-linux-musl/LICENSE-3rdparty.csv +550 -0
  44. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/bin/libdatadog-crashtracking-receiver +0 -0
  45. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/common.h +105 -19
  46. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/data-pipeline.h +154 -8
  47. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/ffe.h +7 -3
  48. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/profiling.h +36 -0
  49. data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/telemetry.h +21 -0
  50. data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/lib/libdatadog_profiling.so +0 -0
  51. data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  52. metadata +86 -82
  53. data/vendor/libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -53656
  54. data/vendor/libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -53656
  55. data/vendor/libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin/LICENSE-3rdparty.yml +0 -53656
  56. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -53656
  57. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +0 -2814
  58. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/data-pipeline.h +0 -203
  59. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ffe.h +0 -175
  60. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +0 -1094
  61. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +0 -286
  62. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  63. data/vendor/libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  64. data/vendor/libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -53656
  65. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/LICENSE +0 -0
  66. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/NOTICE +0 -0
  67. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/blazesym.h +0 -0
  68. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/crashtracker.h +0 -0
  69. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/ddsketch.h +0 -0
  70. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/library-config.h +0 -0
  71. /data/vendor/{libdatadog-30.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-35.0.0/aarch64-linux}/include/datadog/log.h +0 -0
  72. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/LICENSE +0 -0
  73. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/NOTICE +0 -0
  74. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/blazesym.h +0 -0
  75. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/crashtracker.h +0 -0
  76. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/ddsketch.h +0 -0
  77. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/library-config.h +0 -0
  78. /data/vendor/{libdatadog-30.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-35.0.0/aarch64-linux-musl}/include/datadog/log.h +0 -0
  79. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/LICENSE +0 -0
  80. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/NOTICE +0 -0
  81. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/blazesym.h +0 -0
  82. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/crashtracker.h +0 -0
  83. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/ddsketch.h +0 -0
  84. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/library-config.h +0 -0
  85. /data/vendor/{libdatadog-30.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-35.0.0/arm64-darwin}/include/datadog/log.h +0 -0
  86. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/LICENSE +0 -0
  87. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/NOTICE +0 -0
  88. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/include/datadog/blazesym.h +0 -0
  89. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/include/datadog/crashtracker.h +0 -0
  90. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/include/datadog/ddsketch.h +0 -0
  91. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/include/datadog/library-config.h +0 -0
  92. /data/vendor/{libdatadog-30.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-35.0.0/x86_64-linux}/include/datadog/log.h +0 -0
  93. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/LICENSE +0 -0
  94. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/NOTICE +0 -0
  95. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/blazesym.h +0 -0
  96. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/crashtracker.h +0 -0
  97. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/ddsketch.h +0 -0
  98. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/library-config.h +0 -0
  99. /data/vendor/{libdatadog-30.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-35.0.0/x86_64-linux-musl}/include/datadog/log.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e50b7ba6d9c8d7502219ed0dd2ae3797e12bf551c4845ee4c8730af1d97062c
4
- data.tar.gz: 9235838a689be504cd9ac83f6ef25835f8ea3005e624091986a04a9acadc2792
3
+ metadata.gz: ab0a20f1852ac415e905e178e09208b0986f3119d936a3f8f8326df8e0f778a1
4
+ data.tar.gz: aadd3917949f04607ba2be0ea20dff98349b5a14844b87b6dcd7508b40ec1fcf
5
5
  SHA512:
6
- metadata.gz: a5d1929694a5bb8683592fc696270256c3002984ad1e6cd421896870a2f8522f68d811ca64028b34e9119c92aff9b545cedbb974270f1fc5a37b2eadaf3ae507
7
- data.tar.gz: deaa3c844646f9037f4b7007a397b806b9c96515b3c2c8ce2d0b92240a12994863f710d9486b78c92383933176fa43b5799493f7dcaaf575cb26d3d347f50b6e
6
+ metadata.gz: 538303506ea439d8a62e885f65ca62df32d62d4482bd61984c261d47652d814517a7e379038876c57e4bf0e78c5da40981b666f37f83eec2bb9cb40303b029f0
7
+ data.tar.gz: 7859de5265189b8b2e5faaf8c7ec6c91a6fbd2d0bc482dec4de443f5362a8458f2ae15390c7d6947d78785b12dd6c0a09d3c70c3aca9e865d8e464534dc4f92c
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Libdatadog
4
4
  # Current libdatadog version
5
- LIB_VERSION = "30.0.0"
5
+ LIB_VERSION = "35.0.0"
6
6
 
7
7
  GEM_MAJOR_VERSION = "1"
8
8
  GEM_MINOR_VERSION = "0"
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "libdatadog/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "libdatadog"
9
+ spec.version = Libdatadog::VERSION
10
+ spec.authors = ["Datadog, Inc."]
11
+ spec.email = ["dev@datadoghq.com"]
12
+
13
+ spec.summary = "Library of common code used by Datadog Continuous Profiler for Ruby"
14
+ spec.description =
15
+ "libdatadog is a Rust-based utility library for Datadog's ddtrace gem."
16
+ spec.homepage = "https://docs.datadoghq.com/tracing/"
17
+ spec.license = "Apache-2.0"
18
+ spec.required_ruby_version = ">= 2.5.0"
19
+
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ spec.metadata["source_code_uri"] = "https://github.com/datadog/libdatadog-rb"
24
+
25
+ # Require releases on rubygems.org to be coming from multi-factor-auth-authenticated accounts
26
+ spec.metadata["rubygems_mfa_required"] = "true"
27
+
28
+ # Specify which files should be added to the gem when it is released.
29
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
31
+ `git ls-files -z`
32
+ .split("\x0")
33
+ .reject do |f|
34
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|publish)/|\.(?:git|travis|circleci)|appveyor)})
35
+ end
36
+ .reject do |f|
37
+ [".rspec", ".standard.yml", "Rakefile", "docker-compose.yml", "Gemfile", "README.md", "CONTRIBUTING.md", "LICENSE-3rdparty.yml"].include?(f)
38
+ end
39
+ .reject { |f| f.end_with?(".tar.gz") }
40
+ .reject { |f| f.end_with?(".nix") || f.start_with?("flake.") }
41
+ end
42
+ spec.require_paths = ["lib"]
43
+ end
@@ -0,0 +1,6 @@
1
+ [toolchain]
2
+ # Rust toolchain used to build libdatadog from source. Keep the channel in sync
3
+ # with the libdatadog `rust-toolchain.toml` for the LIB_VERSION being packaged
4
+ # and with the CI `RUST_VERSION` in .github/workflows/build.yml.
5
+ channel = "1.87.0"
6
+ profile = "minimal"
data/tasks/build.rake ADDED
@@ -0,0 +1,177 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "etc"
4
+ require "pathname"
5
+
6
+ module BuildFromSource
7
+ module Target
8
+ # Mapping from Rust target triples to Ruby gem platform names.
9
+ # x86_64-apple-darwin is deliberately not supported.
10
+ RUST_TO_RUBY = {
11
+ "x86_64-unknown-linux-gnu" => "x86_64-linux",
12
+ "x86_64-unknown-linux-musl" => "x86_64-linux-musl",
13
+ "x86_64-alpine-linux-musl" => "x86_64-linux-musl",
14
+ "aarch64-unknown-linux-gnu" => "aarch64-linux",
15
+ "aarch64-unknown-linux-musl" => "aarch64-linux-musl",
16
+ "aarch64-alpine-linux-musl" => "aarch64-linux-musl",
17
+ "aarch64-apple-darwin" => "arm64-darwin"
18
+ }.freeze
19
+
20
+ class << self
21
+ def host_triple
22
+ @host_triple ||= begin
23
+ output = `rustc -vV`
24
+ raise "rustc not found or failed" unless $?.success?
25
+
26
+ triple = output[/^host:\s*(.+)$/, 1]
27
+ raise "Could not determine host triple from rustc output" unless triple
28
+
29
+ triple = triple.strip
30
+
31
+ triple
32
+ end
33
+ end
34
+
35
+ def ruby_platform(rust_triple = host_triple)
36
+ RUST_TO_RUBY.fetch(rust_triple) do
37
+ raise "Unsupported Rust target: #{rust_triple}. " \
38
+ "Supported: #{RUST_TO_RUBY.keys.join(", ")}"
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ module Paths
45
+ class << self
46
+ # Project root
47
+ def root
48
+ @root ||= (Pathname.new(__dir__) / "..").expand_path
49
+ end
50
+
51
+ # Intermediate build artifacts
52
+ def tmp
53
+ root / "tmp"
54
+ end
55
+
56
+ def builder_root
57
+ tmp / "builder"
58
+ end
59
+
60
+ def builder_bin
61
+ builder_root / "bin" / "release"
62
+ end
63
+
64
+ def cargo_target
65
+ tmp / "cargo-target"
66
+ end
67
+
68
+ def cmake_out
69
+ tmp / "cmake-out"
70
+ end
71
+
72
+ # Vendor output tree
73
+ def vendor
74
+ root / "vendor" / "libdatadog-#{Libdatadog::LIB_VERSION}"
75
+ end
76
+
77
+ def vendor_target(ruby_platform = Target.ruby_platform)
78
+ vendor / ruby_platform
79
+ end
80
+ end
81
+ end
82
+
83
+ module Builder
84
+ class << self
85
+ # Build the cargo install command for the builder crate's `release` binary.
86
+ #
87
+ # source: optional path to a local libdatadog checkout
88
+ # features: optional comma-separated feature override
89
+ def cargo_install_cmd(source: nil, features: nil)
90
+ cmd = %W[cargo install --bin release --root #{Paths.builder_root} --force]
91
+
92
+ cmd += if source
93
+ ["--path", (Pathname.new(source).expand_path / "builder").to_s]
94
+ else
95
+ [
96
+ "--git", "https://github.com/DataDog/libdatadog",
97
+ "--tag", "v#{Libdatadog::LIB_VERSION}",
98
+ "builder"
99
+ ]
100
+ end
101
+
102
+ cmd += ["--no-default-features", "--features", features] if features
103
+
104
+ cmd
105
+ end
106
+
107
+ # Environment variables required by the builder binary at runtime.
108
+ #
109
+ # The builder reads PROFILE, TARGET, and CARGO_PKG_VERSION via env::var()
110
+ # (they are NOT baked in at compile time despite the build script's cargo:rustc-env).
111
+ # CARGO_TARGET_DIR is needed because we are not inside a cargo workspace.
112
+ # HOST, OUT_DIR, OPT_LEVEL, DEBUG, and NUM_JOBS are required by the cmake crate
113
+ # used internally to build the crashtracker receiver.
114
+ def env(host_triple)
115
+ {
116
+ "PROFILE" => "release",
117
+ "OPT_LEVEL" => "3",
118
+ "DEBUG" => "false",
119
+ "TARGET" => host_triple,
120
+ "HOST" => host_triple,
121
+ "CARGO_PKG_VERSION" => Libdatadog::LIB_VERSION,
122
+ "CARGO_TARGET_DIR" => Paths.cargo_target.to_s,
123
+ "OUT_DIR" => Paths.cmake_out.to_s,
124
+ "NUM_JOBS" => begin
125
+ Etc.nprocessors
126
+ rescue
127
+ 1
128
+ end.to_s
129
+ }
130
+ end
131
+ end
132
+ end
133
+ end
134
+
135
+ namespace :libdatadog do
136
+ desc "Build libdatadog from source for the current platform"
137
+ task :build do
138
+ host_triple = BuildFromSource::Target.host_triple
139
+ ruby_platform = BuildFromSource::Target.ruby_platform(host_triple)
140
+ paths = BuildFromSource::Paths
141
+
142
+ # Install builder binary
143
+ source = ENV["LIBDATADOG_SOURCE"]
144
+ features = ENV["LIBDATADOG_FEATURES"]
145
+ install_cmd = BuildFromSource::Builder.cargo_install_cmd(source: source, features: features)
146
+
147
+ info = source ? "local: #{source}" : "v#{Libdatadog::LIB_VERSION}"
148
+ puts "Installing builder (#{info})..."
149
+ system(*install_cmd) || raise("Failed to install builder via cargo")
150
+
151
+ # Prepare output directories
152
+ target_dir = paths.vendor_target(ruby_platform)
153
+ [target_dir, paths.cargo_target, paths.cmake_out].each(&:mkpath)
154
+
155
+ # Invoke builder
156
+ env = BuildFromSource::Builder.env(host_triple)
157
+
158
+ puts "Building libdatadog for #{ruby_platform} (#{host_triple})"
159
+ puts "Output: #{target_dir}"
160
+ system(env, paths.builder_bin.to_s, "--out", target_dir.to_s) || raise("Builder failed")
161
+
162
+ # Fix file permissions to match expected values for packaging
163
+ Helpers.fix_file_permissions(target_dir.to_s)
164
+
165
+ puts "Done! Artifacts in #{target_dir}"
166
+ end
167
+
168
+ desc "Remove build intermediates and vendor tree"
169
+ task :clean do
170
+ [BuildFromSource::Paths.tmp, BuildFromSource::Paths.vendor].each do |dir|
171
+ if dir.exist?
172
+ puts "Removing #{dir}"
173
+ dir.rmtree
174
+ end
175
+ end
176
+ end
177
+ end
data/tasks/gem.rake ADDED
@@ -0,0 +1,249 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ require "rubygems/package"
5
+ require "rubygems/package/tar_reader"
6
+ require "zlib"
7
+ require "stringio"
8
+
9
+ # Builds .gem packages from vendored libdatadog artifacts.
10
+ #
11
+ # Intentionally duplicates some Rakefile logic so both can coexist during
12
+ # the migration; the Rakefile originals will be removed once the new tasks
13
+ # are fully adopted.
14
+ module GemPackaging
15
+ module Platform
16
+ # Mapping from gem platform names to the vendor platform directories
17
+ # included in that gem. We bundle glibc and musl variants together
18
+ # for Linux to work around https://github.com/rubygems/rubygems/issues/3174
19
+ GEM_TO_VENDOR = {
20
+ "x86_64-linux" => ["x86_64-linux", "x86_64-linux-musl"],
21
+ "aarch64-linux" => ["aarch64-linux", "aarch64-linux-musl"],
22
+ "arm64-darwin" => ["arm64-darwin"]
23
+ }.freeze
24
+
25
+ ALL_VENDOR = GEM_TO_VENDOR.values.flatten.freeze
26
+
27
+ class << self
28
+ # Resolve a RUBY_PLATFORM string (or gem platform name) to a known
29
+ # gem platform key.
30
+ #
31
+ # resolve("x86_64-linux") #=> "x86_64-linux"
32
+ # resolve("x86_64-linux-musl") #=> "x86_64-linux"
33
+ # resolve("arm64-darwin24") #=> "arm64-darwin"
34
+ def resolve(platform_string)
35
+ return platform_string if GEM_TO_VENDOR.key?(platform_string)
36
+
37
+ # musl suffix (x86_64-linux-musl -> x86_64-linux)
38
+ without_musl = platform_string.sub(/-musl\z/, "")
39
+ return without_musl if GEM_TO_VENDOR.key?(without_musl)
40
+
41
+ # macOS Darwin version suffix (arm64-darwin24 -> arm64-darwin)
42
+ GEM_TO_VENDOR.each_key do |gp|
43
+ return gp if platform_string.start_with?(gp)
44
+ end
45
+
46
+ raise "Could not resolve platform '#{platform_string}' to a supported gem platform. " \
47
+ "Supported: #{GEM_TO_VENDOR.keys.join(", ")}, ruby"
48
+ end
49
+
50
+ # Vendor platform directories needed for a given gem platform.
51
+ def vendor_platforms(gem_platform)
52
+ if gem_platform == "ruby"
53
+ ALL_VENDOR
54
+ else
55
+ GEM_TO_VENDOR.fetch(gem_platform) do
56
+ raise "Unknown gem platform: #{gem_platform}. " \
57
+ "Supported: #{GEM_TO_VENDOR.keys.join(", ")}, ruby"
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ module Paths
65
+ class << self
66
+ # Project root
67
+ def root
68
+ @root ||= (Pathname.new(__dir__) / "..").expand_path
69
+ end
70
+
71
+ # Vendor tree for the current library version
72
+ def vendor
73
+ root / "vendor" / "libdatadog-#{Libdatadog::LIB_VERSION}"
74
+ end
75
+
76
+ # Vendor directory for a specific platform
77
+ def vendor_platform(name)
78
+ vendor / name
79
+ end
80
+
81
+ # Output directory for built gems
82
+ def pkg
83
+ root / "pkg"
84
+ end
85
+
86
+ # The gemspec file
87
+ def gemspec
88
+ root / "libdatadog.gemspec"
89
+ end
90
+
91
+ # Expected .gem filename for a given gem platform
92
+ def gem_file_name(gem_platform)
93
+ spec = Gem::Specification.new do |s|
94
+ s.name = "libdatadog"
95
+ s.version = Libdatadog::VERSION
96
+ s.platform = gem_platform unless gem_platform == "ruby"
97
+ end
98
+ spec.file_name
99
+ end
100
+
101
+ # Full path to the .gem for a given gem platform
102
+ def gem(gem_platform)
103
+ pkg / gem_file_name(gem_platform)
104
+ end
105
+ end
106
+ end
107
+
108
+ module Packager
109
+ # Files that must have executable permissions (0755); everything else gets 0644.
110
+ EXECUTABLE_FILES = %w[
111
+ libdatadog-crashtracking-receiver
112
+ libdatadog_profiling.so
113
+ libdatadog_profiling.dylib
114
+ ].freeze
115
+
116
+ # Vendored files excluded from gems (not needed at runtime).
117
+ EXCLUDED_FILES = %w[
118
+ datadog_profiling.pc
119
+ libdatadog_profiling.a
120
+ datadog_profiling-static.pc
121
+ libdatadog_profiling.debug
122
+ DatadogConfig.cmake
123
+ ].freeze
124
+
125
+ class << self
126
+ # Collect vendored files for one or more vendor platform directories,
127
+ # filtering out tarballs and files not needed at runtime.
128
+ # Returns paths relative to the project root (what gemspec.files expects).
129
+ def vendor_files(*vendor_platforms)
130
+ vendor_platforms.flat_map { |vp|
131
+ Paths.vendor_platform(vp).glob("**/*")
132
+ .select(&:file?)
133
+ .map { |p| p.relative_path_from(Paths.root).to_s }
134
+ .reject { |p| p.end_with?(".tar.gz") }
135
+ .reject { |p| EXCLUDED_FILES.include?(File.basename(p)) }
136
+ }
137
+ end
138
+
139
+ # Verify that required vendor directories exist and contain files.
140
+ def check_vendor!(*vendor_platforms)
141
+ missing = vendor_platforms.reject { |vp|
142
+ dir = Paths.vendor_platform(vp)
143
+ dir.exist? && dir.glob("**/*").any?(&:file?)
144
+ }
145
+
146
+ return if missing.empty?
147
+
148
+ raise "Missing vendor artifacts for: #{missing.join(", ")}. " \
149
+ "Expected under #{Paths.vendor}/. " \
150
+ "Run `rake libdatadog:build` or download vendor artifacts first."
151
+ end
152
+
153
+ # Build a single .gem into pkg/.
154
+ def build_gem(gem_platform:, vendor_platforms:)
155
+ check_vendor!(*vendor_platforms)
156
+
157
+ spec = eval(Paths.gemspec.read, nil, Paths.gemspec.to_s) # standard:disable Security/Eval
158
+ spec.files += vendor_files(*vendor_platforms)
159
+ spec.platform = gem_platform unless gem_platform == "ruby"
160
+
161
+ Paths.pkg.mkpath
162
+
163
+ puts "Building gem for platform=#{gem_platform} including: (this can take a while)"
164
+ pp spec.files.select { |f| f.start_with?("vendor/") }
165
+
166
+ Gem::Package.build(spec)
167
+ # build creates the .gem in cwd; move it into pkg/
168
+ gem_path = Paths.gem(gem_platform)
169
+ Pathname.new(spec.file_name).rename(gem_path)
170
+ puts("-" * 80)
171
+
172
+ gem_path
173
+ end
174
+
175
+ # Inspect the built .gem and raise on unexpected file permissions.
176
+ def validate_permissions!(gem_path)
177
+ puts "Validating permissions in #{gem_path}..."
178
+
179
+ Gem::Package::TarReader.new(gem_path.open("rb")) do |tar|
180
+ data_entry = tar.find { |entry| entry.header.name == "data.tar.gz" }
181
+ next unless data_entry
182
+
183
+ Gem::Package::TarReader.new(Zlib::GzipReader.new(StringIO.new(data_entry.read))) do |data_tar|
184
+ data_tar.each do |entry|
185
+ next if entry.directory?
186
+
187
+ filename = File.basename(entry.header.name)
188
+ actual = entry.header.mode.to_s(8)[-3..-1]
189
+ expected = EXECUTABLE_FILES.include?(filename) ? "755" : "644"
190
+
191
+ next if actual == expected
192
+
193
+ raise "Bad permissions for #{filename} in #{gem_path}: " \
194
+ "got #{actual}, expected #{expected}"
195
+ end
196
+ end
197
+ end
198
+
199
+ puts "Permissions OK."
200
+ end
201
+
202
+ # Package a single gem platform (a GEM_TO_VENDOR key, or "ruby").
203
+ def package(platform)
204
+ if Platform::GEM_TO_VENDOR.key?(platform) || platform == "ruby"
205
+ build_gem(
206
+ gem_platform: platform,
207
+ vendor_platforms: Platform.vendor_platforms(platform)
208
+ )
209
+ else
210
+ resolved = Platform.resolve(platform)
211
+ puts "Resolved '#{platform}' -> gem platform '#{resolved}'"
212
+ package(resolved)
213
+ end
214
+ end
215
+
216
+ # Package every supported binary gem platform plus the ruby fallback gem.
217
+ def package_all
218
+ Platform::GEM_TO_VENDOR.each_key { |gp| package(gp) }
219
+ package("ruby")
220
+ end
221
+ end
222
+ end
223
+ end
224
+
225
+ namespace :gem do
226
+ desc "Package gem(s). No argument: all platforms + ruby. " \
227
+ "With argument: a specific gem platform, 'ruby', or a RUBY_PLATFORM value.\n" \
228
+ " Examples: rake gem:package # all\n" \
229
+ " rake gem:package[x86_64-linux] # one binary platform\n" \
230
+ " rake gem:package[ruby] # ruby platform gem\n" \
231
+ " rake gem:package[arm64-darwin24] # resolved to arm64-darwin"
232
+ task :package, [:platform] do |_t, args|
233
+ platform = args[:platform]
234
+
235
+ if platform.nil? || platform.strip.empty?
236
+ GemPackaging::Packager.package_all
237
+ else
238
+ GemPackaging::Packager.package(platform)
239
+ end
240
+ end
241
+
242
+ desc "Validate file permissions in all gems under pkg/"
243
+ task :validate do
244
+ gems = GemPackaging::Paths.pkg.glob("*.gem")
245
+ raise "No .gem files found in #{GemPackaging::Paths.pkg}" if gems.empty?
246
+
247
+ gems.each { |gem_path| GemPackaging::Packager.validate_permissions!(gem_path) }
248
+ end
249
+ end