From b20be921e6d2e9c984bd60cfe802e6d95df91a06 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Tue, 22 Oct 2024 10:57:20 -0400 Subject: [PATCH] Replace debase with datadog --- ddtrace.gemspec | 2 +- .../NativeExtensionDesign.md | 6 +++--- ext/datadog_profiling_native_extension/extconf.rb | 8 ++++---- .../native_extension_helpers.rb | 2 +- .../private_vm_api_access.c | 2 +- lib-injection/host_inject.rb | 2 +- spec/ddtrace/release_gem_spec.rb | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index f652dc40d7a..7a7abaa5a73 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -62,7 +62,7 @@ Gem::Specification.new do |spec| # Used by the profiler native extension to support Ruby < 2.6 and > 3.2 # # We decided to pin it at the latest available version and will manually bump the dependency as needed. - spec.add_dependency 'debase-ruby_core_source', '= 3.3.1' + spec.add_dependency 'datadog-ruby_core_source', '= 3.3.6' # Used by appsec spec.add_dependency 'libddwaf', '~> 1.14.0.0.0' diff --git a/ext/datadog_profiling_native_extension/NativeExtensionDesign.md b/ext/datadog_profiling_native_extension/NativeExtensionDesign.md index 70a657e5afa..8bd966fb70c 100644 --- a/ext/datadog_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/datadog_profiling_native_extension/NativeExtensionDesign.md @@ -68,7 +68,7 @@ internal types, structures and functions). Because these private header files are not included in regular Ruby installations, we have two different workarounds: 1. for Ruby versions 2.6 to 3.2 we make use use the Ruby private MJIT header -2. for Ruby versions < 2.6 and > 3.2 we make use of the `debase-ruby_core_source` gem +2. for Ruby versions < 2.6 and > 3.2 we make use of the `datadog-ruby_core_source` gem Functions which make use of these headers are defined in the file. @@ -91,9 +91,9 @@ version. e.g. `rb_mjit_min_header-2.7.4.h`. This header was removed in Ruby 3.3. -### Approach 2: Using the `debase-ruby_core_source` gem +### Approach 2: Using the `datadog-ruby_core_source` gem -The [`debase-ruby_core_source`](https://github.com/ruby-debug/debase-ruby_core_source) contains almost no code; +The [`datadog-ruby_core_source`](https://github.com/ruby-debug/datadog-ruby_core_source) contains almost no code; instead, it just contains per-Ruby-version folders with the private VM headers (`.h`) files for that version. Thus, even though a regular Ruby installation does not include these files, we can access the copy inside this gem. diff --git a/ext/datadog_profiling_native_extension/extconf.rb b/ext/datadog_profiling_native_extension/extconf.rb index 4e2c62c3292..85680966637 100644 --- a/ext/datadog_profiling_native_extension/extconf.rb +++ b/ext/datadog_profiling_native_extension/extconf.rb @@ -269,16 +269,16 @@ def add_compiler_flag(flag) create_makefile EXTENSION_NAME else # The MJIT header was introduced on 2.6 and removed on 3.3; for other Rubies we rely on - # the debase-ruby_core_source gem to get access to private VM headers. + # the datadog-ruby_core_source gem to get access to private VM headers. # This gem ships source code copies of these VM headers for the different Ruby VM versions; - # see https://github.com/ruby-debug/debase-ruby_core_source for details + # see https://github.com/DataDog/datadog-ruby_core_source for details create_header - require 'debase/ruby_core_source' + require 'datadog/ruby_core_source' dir_config('ruby') # allow user to pass in non-standard core include directory - Debase::RubyCoreSource + Datadog::RubyCoreSource .create_makefile_with_core( proc do headers_available = diff --git a/ext/datadog_profiling_native_extension/native_extension_helpers.rb b/ext/datadog_profiling_native_extension/native_extension_helpers.rb index 7eebd875fe7..1e5307efaef 100644 --- a/ext/datadog_profiling_native_extension/native_extension_helpers.rb +++ b/ext/datadog_profiling_native_extension/native_extension_helpers.rb @@ -12,7 +12,7 @@ module NativeExtensionHelpers # Can be set to force rubygems to fail gem installation when profiling extension could not be built ENV_FAIL_INSTALL_IF_MISSING_EXTENSION = 'DD_PROFILING_FAIL_INSTALL_IF_MISSING_EXTENSION' - # The MJIT header was introduced on 2.6 and removed on 3.3; for other Rubies we rely on debase-ruby_core_source + # The MJIT header was introduced on 2.6 and removed on 3.3; for other Rubies we rely on datadog-ruby_core_source CAN_USE_MJIT_HEADER = RUBY_VERSION.start_with?('2.6', '2.7', '3.0.', '3.1.', '3.2.') LIBDATADOG_VERSION = '~> 7.0.0.1.0' diff --git a/ext/datadog_profiling_native_extension/private_vm_api_access.c b/ext/datadog_profiling_native_extension/private_vm_api_access.c index 6bb560b5802..86791d4a998 100644 --- a/ext/datadog_profiling_native_extension/private_vm_api_access.c +++ b/ext/datadog_profiling_native_extension/private_vm_api_access.c @@ -13,7 +13,7 @@ #include RUBY_MJIT_HEADER #else // The MJIT header was introduced on 2.6 and removed on 3.3; for other Rubies we rely on - // the debase-ruby_core_source gem to get access to private VM headers. + // the datadog-ruby_core_source gem to get access to private VM headers. // We can't do anything about warnings in VM headers, so we just use this technique to suppress them. // See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details. diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject.rb index 809bc00bc7a..aa90ca14430 100644 --- a/lib-injection/host_inject.rb +++ b/lib-injection/host_inject.rb @@ -63,7 +63,7 @@ def debug_log(msg) [ 'msgpack', 'ffi', - 'debase-ruby_core_source', + 'datadog-ruby_core_source', 'libdatadog', 'libddwaf', 'datadog-ci', diff --git a/spec/ddtrace/release_gem_spec.rb b/spec/ddtrace/release_gem_spec.rb index 450a247289d..6015b189075 100644 --- a/spec/ddtrace/release_gem_spec.rb +++ b/spec/ddtrace/release_gem_spec.rb @@ -94,7 +94,7 @@ # since it is used to alarm when dependencies modified. 'datadog-ci', 'ddtrace', - 'debase-ruby_core_source', + 'datadog-ruby_core_source', 'ffi', 'libdatadog', 'libddwaf',