Skip to content

Commit

Permalink
Fail pipeline when libdatadog.so is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Aug 15, 2024
1 parent 9682847 commit 11ee87c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .gitlab/install_datadog_deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -108,6 +108,12 @@

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}.so"
unless File.exist?("#{datadog_gem_path}/lib/#{libdatadog_so_file}")
raise "Missing #{libdatadog_so_file} in #{datadog_gem_path}."
end

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
Expand Down

0 comments on commit 11ee87c

Please sign in to comment.