ddtrace 1.23.1 → 1.23.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1957f7ac42439a5ec9b5c6c1d1700a91b226ccc06def53d0bf3fdd701c55436e
4
- data.tar.gz: 3a9ad0d54e59350c3718eb69ee854a756819567b7bd6d4218f0539c87156078e
3
+ metadata.gz: 836f8f52564c86b8ee1a4681309d3d168b1689f3742dfed4d1a8171e23852ffa
4
+ data.tar.gz: f0ad632313b36e6550e33f952da8e7ea89349fd8abc2122f41d649292a700028
5
5
  SHA512:
6
- metadata.gz: 60ce1f6e6e60cfbfe6f2a3241fc431b9357eefe3866912a82ea672838af323ba6ab441fe50f483a1bc6f26510d500fb00ab62107e770d4c427c6a5952225feac
7
- data.tar.gz: 90c4037291c16fa50614509bab19bf45f6283937466e6f9ee6b28fbe7cde73d39ffd14ecc8fb082104aa1d70c7c748ebccff1683dcda772a3665e4f7c94ad619
6
+ metadata.gz: 1021b4efd906f5cf362e27be17249ce82fad3100b62b9a39ba2fd65d508c07ac520cb94971d6986a5171d1575a7fc8e219ed2dc4785166d0bd0ec774cd447d19
7
+ data.tar.gz: 6ef6b7f391bb98e8e7f039cd72d6df56ee821df539803d3398ef7aaebe2c414eef87f4c2f0cf361ef3a066faf0490bb4b75831563a17729d11115c84243ab349
data/CHANGELOG.md CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.23.2] - 2024-06-13
6
+
7
+ ### Fixed
8
+
9
+ * Profiling: Fix rpath for linking to libdatadog when loading from extension dir ([#3683][])
10
+
5
11
  ## [1.23.1] - 2024-06-06
6
12
 
7
13
  ### Fixed
8
14
 
9
- AppSec: Fix undefined method error when Tracing disabled ([#3650][])
15
+ * AppSec: Fix undefined method error when Tracing disabled ([#3650][])
10
16
 
11
17
  ## [1.23.0] - 2024-05-09
12
18
 
@@ -2820,7 +2826,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
2820
2826
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2821
2827
 
2822
2828
 
2823
- [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.22.0...master
2829
+ [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.23.2...master
2830
+ [1.23.2]: https://github.com/DataDog/dd-trace-rb/compare/v1.23.1...v1.23.2
2824
2831
  [1.23.1]: https://github.com/DataDog/dd-trace-rb/compare/v1.23.0...v1.23.1
2825
2832
  [1.23.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.22.0...v1.23.0
2826
2833
  [1.22.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...v1.22.0
@@ -4134,6 +4141,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
4134
4141
  [#3619]: https://github.com/DataDog/dd-trace-rb/issues/3619
4135
4142
  [#3623]: https://github.com/DataDog/dd-trace-rb/issues/3623
4136
4143
  [#3650]: https://github.com/DataDog/dd-trace-rb/issues/3650
4144
+ [#3683]: https://github.com/DataDog/dd-trace-rb/issues/3683
4137
4145
  [@AdrianLC]: https://github.com/AdrianLC
4138
4146
  [@Azure7111]: https://github.com/Azure7111
4139
4147
  [@BabyGroot]: https://github.com/BabyGroot
@@ -4285,4 +4293,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
4285
4293
  [@y-yagi]: https://github.com/y-yagi
4286
4294
  [@yujideveloper]: https://github.com/yujideveloper
4287
4295
  [@yukimurasawa]: https://github.com/yukimurasawa
4288
- [@zachmccormick]: https://github.com/zachmccormick
4296
+ [@zachmccormick]: https://github.com/zachmccormick
@@ -225,13 +225,15 @@ unless have_type('atomic_int', ['stdatomic.h'])
225
225
  skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported::COMPILER_ATOMIC_MISSING)
226
226
  end
227
227
 
228
- # See comments on the helper method being used for why we need to additionally set this.
228
+ # See comments on the helper methods being used for why we need to additionally set this.
229
229
  # The extremely excessive escaping around ORIGIN below seems to be correct and was determined after a lot of
230
230
  # experimentation. We need to get these special characters across a lot of tools untouched...
231
- $LDFLAGS += \
232
- ' -Wl,-rpath,$$$\\\\{ORIGIN\\}/' \
233
- "#{Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_native_lib_folder}"
234
- Logging.message("[ddtrace] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n")
231
+ extra_relative_rpaths = [
232
+ Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_native_lib_folder,
233
+ *Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_ruby_extensions_folders,
234
+ ]
235
+ extra_relative_rpaths.each { |folder| $LDFLAGS += " -Wl,-rpath,$$$\\\\{ORIGIN\\}/#{folder.to_str}" }
236
+ Logging.message("[datadog] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n")
235
237
 
236
238
  # Tag the native extension library with the Ruby version and Ruby platform.
237
239
  # This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that
@@ -67,6 +67,52 @@ module Datadog
67
67
  Pathname.new(libdatadog_lib_folder).relative_path_from(Pathname.new(profiling_native_lib_folder)).to_s
68
68
  end
69
69
 
70
+ # In https://github.com/DataDog/dd-trace-rb/pull/3582 we got a report of a customer for which the native extension
71
+ # only got installed into the extensions folder.
72
+ #
73
+ # But then this fix was not enough to fully get them moving because then they started to see the issue from
74
+ # https://github.com/DataDog/dd-trace-rb/issues/2067 / https://github.com/DataDog/dd-trace-rb/pull/2125 :
75
+ #
76
+ # > Profiling was requested but is not supported, profiling disabled: There was an error loading the profiling
77
+ # > native extension due to 'RuntimeError Failure to load datadog_profiling_native_extension.3.2.2_x86_64-linux
78
+ # > due to libdatadog_profiling.so: cannot open shared object file: No such file or directory
79
+ #
80
+ # The problem is that when loading the native extension from the extensions directory, the relative rpath we add
81
+ # with the #libdatadog_folder_relative_to_native_lib_folder helper above is not correct, we need to add a relative
82
+ # rpath to the extensions directory.
83
+ #
84
+ # So how do we find the full path where the native extension is placed?
85
+ # * From https://github.com/ruby/ruby/blob/83f02d42e0a3c39661dc99c049ab9a70ff227d5b/lib/bundler/runtime.rb#L166
86
+ # `extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"] + Dir["#{Gem.dir}/bundler/gems/extensions/*/*/*"]`
87
+ # we get that's in one of two fixed subdirectories of `Gem.dir`
88
+ # * From https://github.com/ruby/ruby/blob/83f02d42e0a3c39661dc99c049ab9a70ff227d5b/lib/rubygems/basic_specification.rb#L111-L115
89
+ # we get the structure of the subdirectory (platform/extension_api_version/gem_and_version)
90
+ #
91
+ # Thus, `Gem.dir` of `/var/app/current/vendor/bundle/ruby/3.2.0` becomes (for instance)
92
+ # `/var/app/current/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/datadog-2.0.0/` or
93
+ # `/var/app/current/vendor/bundle/ruby/3.2.0/bundler/gems/extensions/x86_64-linux/3.2.0/datadog-2.0.0/`
94
+ #
95
+ # We then compute the relative path between these folders and the libdatadog folder, and use that as a relative path.
96
+ def self.libdatadog_folder_relative_to_ruby_extensions_folders(
97
+ gem_dir: Gem.dir,
98
+ libdatadog_pkgconfig_folder: Libdatadog.pkgconfig_folder
99
+ )
100
+ return unless libdatadog_pkgconfig_folder
101
+
102
+ # For the purposes of calculating a folder relative to the other, we don't actually NEED to fill in the
103
+ # platform, extension_api_version and gem version. We're basically just after how many folders it is deep from
104
+ # the Gem.dir.
105
+ expected_ruby_extensions_folders = [
106
+ "#{gem_dir}/extensions/platform/extension_api_version/datadog_version/",
107
+ "#{gem_dir}/bundler/gems/extensions/platform/extension_api_version/datadog_version/",
108
+ ]
109
+ libdatadog_lib_folder = "#{libdatadog_pkgconfig_folder}/../"
110
+
111
+ expected_ruby_extensions_folders.map do |folder|
112
+ Pathname.new(libdatadog_lib_folder).relative_path_from(Pathname.new(folder)).to_s
113
+ end
114
+ end
115
+
70
116
  # Used to check if profiler is supported, including user-visible clear messages explaining why their
71
117
  # system may not be supported.
72
118
  module Supported
@@ -4,7 +4,7 @@ module DDTrace
4
4
  module VERSION
5
5
  MAJOR = 1
6
6
  MINOR = 23
7
- PATCH = 1
7
+ PATCH = 2
8
8
  PRE = nil
9
9
  BUILD = nil
10
10
  # PRE and BUILD above are modified for dev gems during gem build GHA workflow
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.1
4
+ version: 1.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-06 00:00:00.000000000 Z
11
+ date: 2024-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -81,6 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.8.1
83
83
  description: |
84
+ NOTICE: This gem has been renamed to `datadog` since 2.0.0. Please use `datadog` instead of `ddtrace`.
84
85
  ddtrace is Datadog's tracing client for Ruby. It is used to trace requests
85
86
  as they flow across web servers, databases and microservices so that developers
86
87
  have great visiblity into bottlenecks and troublesome requests.
@@ -879,9 +880,9 @@ licenses:
879
880
  - Apache-2.0
880
881
  metadata:
881
882
  allowed_push_host: https://rubygems.org
882
- changelog_uri: https://github.com/DataDog/dd-trace-rb/blob/v1.23.1/CHANGELOG.md
883
- source_code_uri: https://github.com/DataDog/dd-trace-rb/tree/v1.23.1
884
- post_install_message:
883
+ changelog_uri: https://github.com/DataDog/dd-trace-rb/blob/v1.23.2/CHANGELOG.md
884
+ source_code_uri: https://github.com/DataDog/dd-trace-rb/tree/v1.23.2
885
+ post_install_message:
885
886
  rdoc_options: []
886
887
  require_paths:
887
888
  - lib
@@ -899,8 +900,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
899
900
  - !ruby/object:Gem::Version
900
901
  version: 2.0.0
901
902
  requirements: []
902
- rubygems_version: 3.4.21
903
- signing_key:
903
+ rubygems_version: 3.4.10
904
+ signing_key:
904
905
  specification_version: 4
905
906
  summary: Datadog tracing code for your Ruby applications
906
907
  test_files: []