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 0d915c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,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
Expand Down

0 comments on commit 0d915c6

Please sign in to comment.