Skip to content

Support Ruby 3.0 #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -173,6 +173,7 @@ workflows:
- '2.5'
- '2.6'
- '2.7'
- '3.0'

- test_windows:
matrix:
Expand All @@ -181,3 +182,4 @@ workflows:
- '2.5'
- '2.6'
- '2.7'
- '3.0'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 0 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
source 'https://rubygems.org'
gemspec

group :development do
end

group :test do
gem 'minitest'
end
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"],
Expand Down
2 changes: 1 addition & 1 deletion ext/tiny_tds/extconsts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is fine. Are the 1.1.1 release variants cross compatible with each other? Is there any downside to moving as far forward as the latest l (L) release?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, l doesn't refer to latest, they're just going through the alphabet on releases for 1.1.1, and s is the most recent at the moment

OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"

FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.1.24"
Expand Down
8 changes: 4 additions & 4 deletions tasks/native_gem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the similar lines in ports.rake (etc) also be changed?


# 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=#{RUBY_CC_VERSION} CFLAGS='-Wall' MAKE='make -j`nproc`' rake native:#{plat} gem", platform: plat
end
end
2 changes: 1 addition & 1 deletion tasks/ports.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down