diff --git a/.gitlab/install_datadog_deps.rb b/.gitlab/install_datadog_deps.rb index 21f9118f144..79673ac6e1b 100755 --- a/.gitlab/install_datadog_deps.rb +++ b/.gitlab/install_datadog_deps.rb @@ -74,7 +74,7 @@ 'ffi', 'libddwaf', 'msgpack', - 'libdatadog', # libdatadog MUST be installed before datadog + 'libdatadog', # libdatadog MUST be installed before datadog to ensure libdatadog native extension is compiled 'datadog', ].each do |gem| version = gem_version_mapping.delete(gem) @@ -108,6 +108,11 @@ raise "#{gem_version_mapping.keys.join(',')} are not installed." if gem_version_mapping.any? +datadog_gem_path = versioned_path.join("gems/datadog-#{ENV.fetch('DATADOG_GEM_LOCATION') +libdatadog_so_file = "libdatadog_api.#{RUBY_VERSION[/\d+.\d+/]}_#{RUBY_PLATFORM}" + +raise "Missing #{libdatadog_so_file} under #{datadog_gem_path}." unless File.exist?("#{datadog_gem_path}/lib/#{libdatadog_so_file}") + FileUtils.cd(versioned_path.join("extensions/#{Gem::Platform.local}"), verbose: true) do # Symlink those directories to be utilized by Ruby compiled with shared libraries FileUtils.ln_sf Gem.extension_api_version, ruby_api_version