Skip to content

Commit

Permalink
Merge pull request #3681 from DataDog/tonycthsu/fix-ffi
Browse files Browse the repository at this point in the history
Fix ffi version 1.16.3 in lib injection artifacts
  • Loading branch information
TonyCTHsu authored Jun 5, 2024
2 parents 45b2557 + 0f7a746 commit d64360b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ build-gem:
script:
- export RUBY_PACKAGE_VERSION=$(cat tmp/version.txt)
- export DATADOG_GEM_LOCATION=$(readlink -f pkg/datadog-*.gem)
- ruby -v
- gem -v
- bundler -v
- ruby .gitlab/install_datadog_deps.rb
artifacts:
paths:
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-2.7.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system 3.3.27;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.0.6
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.1.4
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image
# but compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -75,6 +76,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
5 changes: 4 additions & 1 deletion .gitlab/Dockerfile-3.2.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is copied from official Docker image, but compile Ruby with `--disable-shared` instead.
# This is copied from official Docker image, but
# compile Ruby with `--disable-shared` and update gem version

FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster

Expand Down Expand Up @@ -99,6 +100,8 @@ RUN set -eux; \
# verify we have no "ruby" packages installed
if dpkg -l | grep -i ruby; then exit 1; fi; \
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
# update gem version
gem update --system;\
# rough smoke test
ruby --version; \
gem --version; \
Expand Down
15 changes: 15 additions & 0 deletions .gitlab/install_datadog_deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@
require 'fileutils'
require 'pathname'

puts '=== RUBY_VERSION ==='
puts RUBY_VERSION
puts '=== RUBY_ENGINE ==='
puts RUBY_ENGINE
puts '=== RUBY_ENGINE_VERSION ==='
puts RUBY_ENGINE_VERSION
puts '=== RUBY_PLATFORM ==='
puts RUBY_PLATFORM
puts '=== GEM PLATFORM ==='
puts Gem::Platform.local

ruby_api_version = Gem.ruby_api_version

puts '=== RUBY API VERISON ==='
puts ruby_api_version

current_path = Pathname.new(FileUtils.pwd)

tmp_path = current_path.join('tmp')
Expand All @@ -19,6 +33,7 @@
File.open(gemfile_file_path, 'w') do |file|
file.write("source 'https://rubygems.org'\n")
file.write("gem 'datadog', '#{ENV.fetch('RUBY_PACKAGE_VERSION')}', path: '#{current_path}'\n")
file.write("gem 'ffi', '1.16.3'\n")
# Mimick outdated `msgpack` version, uncomment below line to test
# file.write("gem 'msgpack', '1.6.0'\n")
end
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"Dockerfile*": "dockerfile"
}
}
1 change: 1 addition & 0 deletions spec/datadog/release_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
|\.circleci
|\.github
|\.gitlab
|\.vscode
|lib-injection
|appraisal
|benchmarks
Expand Down

0 comments on commit d64360b

Please sign in to comment.