From 86f15c26d98d1ff184310b10683ada5525e742a1 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 12:04:58 +0100 Subject: [PATCH 1/6] Use versions from gemspec When running `bundle install`, it tried to install the latest minitest version, as it was defined again in the Gemfile. This caused issues with Ruby 2.5, as support for it was dropped in v5.16.0. Removing this extra code makes bundler correctly install 5.14.0 as defined in the gemspec. --- Gemfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Gemfile b/Gemfile index 313a64f0..851fabc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,2 @@ source 'https://rubygems.org' gemspec - -group :development do -end - -group :test do - gem 'minitest' -end From 3c9d9e6eabb9e9d720f10602b433978a5d805b38 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 13:02:05 +0100 Subject: [PATCH 2/6] Lock bundler on CI to v2.3.26 This is the last release that supports Ruby 2.5. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eaf03ccd..89fc5aac 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,7 +112,7 @@ jobs: command: | $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH" ridk install 2 - gem install bundler + gem install bundler -v 2.3.26 - checkout From e0e73bbb0581df84edb2d19b6cd7a21437aa20c6 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 14:57:21 +0100 Subject: [PATCH 3/6] Update `native_gem.rake` according to example of rake-compiler-dock. https://github.com/rake-compiler/rake-compiler-dock#add-to-your-rakefile --- tasks/native_gem.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/native_gem.rake b/tasks/native_gem.rake index d19cdb85..c44678e0 100644 --- a/tasks/native_gem.rake +++ b/tasks/native_gem.rake @@ -5,10 +5,10 @@ task 'gem:windows' => ['ports:cross'] do require 'rake_compiler_dock' # make sure to install our bundle - build = ['bundle'] + sh "bundle package --all" # Avoid repeated downloads of gems by using gem files from the host. # and finally build the native gem - build << 'rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0 CFLAGS="-Wall" MAKE="make -j`nproc`"' - - RakeCompilerDock.sh build.join(' && ') + GEM_PLATFORM_HOSTS.keys.each do |plat| + RakeCompilerDock.sh "bundle --local && RUBY_CC_VERSION='2.7.0:2.6.0:2.5.0:2.4.0' CFLAGS='-Wall' MAKE='make -j`nproc`' rake native:#{plat} gem", platform: plat + end end From 941a100021b5411f333ee262ec0e81a5ac1840c1 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 14:57:52 +0100 Subject: [PATCH 4/6] Update openssl to v1.1.1s 1.1.1d threw error messages, but compiling against 1.1.1s seems to work. --- ext/tiny_tds/extconsts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/tiny_tds/extconsts.rb b/ext/tiny_tds/extconsts.rb index 1e1c1bf2..f3c5e249 100644 --- a/ext/tiny_tds/extconsts.rb +++ b/ext/tiny_tds/extconsts.rb @@ -2,7 +2,7 @@ ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.15" ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz" -OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1d' +OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1s' OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz" FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.1.24" From c82d25eeb7718c05cb8c85d8ff2f0f9f32925e3e Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 14:58:07 +0100 Subject: [PATCH 5/6] Build gem against Ruby 3.0 --- .circleci/config.yml | 2 ++ Rakefile | 1 + tasks/native_gem.rake | 2 +- tasks/ports.rake | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 89fc5aac..041848a6 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -173,6 +173,7 @@ workflows: - '2.5' - '2.6' - '2.7' + - '3.0' - test_windows: matrix: @@ -181,3 +182,4 @@ workflows: - '2.5' - '2.6' - '2.7' + - '3.0' diff --git a/Rakefile b/Rakefile index 3150afdc..c3de60ee 100644 --- a/Rakefile +++ b/Rakefile @@ -10,6 +10,7 @@ GEM_PLATFORM_HOSTS = { 'x86-mingw32' => 'i686-w64-mingw32', 'x64-mingw32' => 'x86_64-w64-mingw32' } +RUBY_CC_VERSION='3.0.0:2.7.0:2.6.0:2.5.0:2.4.0'.freeze # Add our project specific files to clean for a rebuild CLEAN.include FileList["{ext,lib}/**/*.{so,#{RbConfig::CONFIG['DLEXT']},o}"], diff --git a/tasks/native_gem.rake b/tasks/native_gem.rake index c44678e0..353c238b 100644 --- a/tasks/native_gem.rake +++ b/tasks/native_gem.rake @@ -9,6 +9,6 @@ task 'gem:windows' => ['ports:cross'] do # and finally build the native gem GEM_PLATFORM_HOSTS.keys.each do |plat| - RakeCompilerDock.sh "bundle --local && RUBY_CC_VERSION='2.7.0:2.6.0:2.5.0:2.4.0' CFLAGS='-Wall' MAKE='make -j`nproc`' rake native:#{plat} gem", platform: plat + RakeCompilerDock.sh "bundle --local && RUBY_CC_VERSION=#{RUBY_CC_VERSION} CFLAGS='-Wall' MAKE='make -j`nproc`' rake native:#{plat} gem", platform: plat end end diff --git a/tasks/ports.rake b/tasks/ports.rake index 86ee1e91..866891f7 100644 --- a/tasks/ports.rake +++ b/tasks/ports.rake @@ -75,7 +75,7 @@ namespace :ports do GEM_PLATFORM_HOSTS.each do |gem_platform, host| # make sure to install our bundle build = ['bundle'] - build << "rake ports:compile[#{host}] MAKE='make -j`nproc`'" + build << "RUBY_CC_VERSION=#{RUBY_CC_VERSION} rake ports:compile[#{host}] MAKE='make -j`nproc`'" RakeCompilerDock.sh build.join(' && '), platform: gem_platform end end From c3e13ed8968ed088a14f7007d478b2d5613c49c3 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Sat, 7 Jan 2023 17:57:54 +0100 Subject: [PATCH 6/6] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a063108..8b2aaac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (unreleased) +* Add Ruby 3.0 to the cross compile list. + ## 2.1.5 * Fix compilation errors for Amazon Linux 1. Fixes #495.