Skip to content

Commit

Permalink
Merge pull request #567 from andyundso/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies for Windows build and drop 32-bit support
  • Loading branch information
andyundso authored Dec 9, 2024
2 parents bb1d8ae + 681301c commit d94efe6
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
matrix:
platform:
- "x64-mingw32"
- "x86-mingw32"
- "x64-mingw-ucrt"
name: cross-compile-windows
runs-on: ubuntu-22.04
Expand All @@ -35,10 +34,10 @@ jobs:
uses: actions/cache@v4
with:
path: ports
key: cross-compiled-${{ hashFiles('**/.ports_versions') }}
key: cross-compiled-v3-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }}
restore-keys: |
cross-compiled-${{ hashFiles('**/.ports_versions') }}
cross-compiled-v2-
cross-compiled-v3-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }}
cross-compiled-v3-${{ matrix.platform }}-
- name: Build gem
shell: bash
Expand Down Expand Up @@ -96,8 +95,11 @@ jobs:
strategy:
fail-fast: false
matrix:
force-encryption:
- false
- true
mssql-version:
#- 2017
- 2017
- 2019
- 2022
ruby-version:
Expand Down Expand Up @@ -138,12 +140,12 @@ jobs:
Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse
- name: Setup MSSQL
uses: potatoqualitee/mssqlsuite@v1.7
uses: rails-sqlserver/setup-mssql@v1
with:
install: sqlengine, sqlclient
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
sa-password: c0MplicatedP@ssword
show-log: true
force-encryption: ${{ matrix.force-encryption }}

- name: Setup MSSQL database
shell: pwsh
Expand Down Expand Up @@ -217,8 +219,11 @@ jobs:
strategy:
fail-fast: false
matrix:
force-encryption:
- false
- true
mssql-version:
#- 2017
- 2017
- 2019
- 2022
ruby-version:
Expand Down Expand Up @@ -259,12 +264,12 @@ jobs:
Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse
- name: Setup MSSQL
uses: potatoqualitee/mssqlsuite@v1.7
uses: rails-sqlserver/setup-mssql@v1
with:
install: sqlengine, sqlclient
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
sa-password: c0MplicatedP@ssword
show-log: true
force-encryption: ${{ matrix.force-encryption }}

- name: Setup MSSQL database
shell: pwsh
Expand Down Expand Up @@ -345,10 +350,10 @@ jobs:
uses: actions/cache@v4
with:
path: ports
key: native-v2-${{ hashFiles('**/.ports_versions') }}
key: native-v3-${{ hashFiles('**/.ports_versions') }}
restore-keys: |
native-${{ hashFiles('* */.ports_versions') }}
native-v2-
native-v3-${{ hashFiles('* */.ports_versions') }}
native-v3-
- name: Build required libraries
run: |
Expand Down Expand Up @@ -388,20 +393,19 @@ jobs:
uses: actions/cache@v4
with:
path: ports
key: native-v2-${{ hashFiles('**/.ports_versions') }}
key: native-v3-${{ hashFiles('**/.ports_versions') }}
fail-on-cache-miss: true

- name: Build gem
run: |
bundle exec rake build
- name: Setup MSSQL
uses: potatoqualitee/mssqlsuite@v1.7
uses: rails-sqlserver/setup-mssql@v1
with:
install: sqlengine, sqlclient
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
sa-password: "c0MplicatedP@ssword"
show-log: true

- name: Setup MSSQL database
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* Drop support for Ruby < 2.7
* Drop support for SQL Server < 2017
* Drop support for FreeTDS < 1.0
* No longer provide a 32-bit Windows build
* Raise error if FreeTDS is unable to sent command buffer to the server
* Use freetds v1.4.23, libiconv v1.17 and OpenSSL v3.4.0 for Windows builds

## 2.1.7
* Add Ruby 3.3 to the cross compile list
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $ apt-get install wget
$ apt-get install build-essential
$ apt-get install libc6-dev

$ wget http://www.freetds.org/files/stable/freetds-1.4.10.tar.gz
$ tar -xzf freetds-1.4.10.tar.gz
$ cd freetds-1.4.10
$ wget http://www.freetds.org/files/stable/freetds-1.4.23.tar.gz
$ tar -xzf freetds-1.4.23.tar.gz
$ cd freetds-1.4.23
$ ./configure --prefix=/usr/local --with-tdsver=7.4
$ make
$ make install
Expand Down
4 changes: 0 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ ruby_cc_ucrt_versions = "3.3.0:3.2.0:3.1.0".freeze
ruby_cc_mingw32_versions = "3.0.0:2.7.0".freeze

GEM_PLATFORM_HOSTS = {
'x86-mingw32' => {
host: 'i686-w64-mingw32',
ruby_versions: ruby_cc_mingw32_versions
},
'x64-mingw32' => {
host: 'x86_64-w64-mingw32',
ruby_versions: ruby_cc_mingw32_versions
Expand Down
1 change: 0 additions & 1 deletion ext/tiny_tds/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def do_help

# Make sure to check the ports path for the configured host
architecture = RbConfig::CONFIG['arch']
architecture = "x86-mingw32" if architecture == "i386-mingw32"

project_dir = File.expand_path("../../..", __FILE__)
freetds_ports_dir = File.join(project_dir, 'ports', architecture, 'freetds', FREETDS_VERSION)
Expand Down
6 changes: 3 additions & 3 deletions ext/tiny_tds/extconsts.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.15"
ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.17"
ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"

OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1s'
OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '3.4.0'
OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"

FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || '1.1.24'
FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || '1.4.23'
FREETDS_SOURCE_URI = "http://www.freetds.org/files/stable/freetds-#{FREETDS_VERSION}.tar.bz2"
4 changes: 2 additions & 2 deletions tasks/ports.rake
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ namespace :ports do
if libraries_to_compile[:openssl]
# freetds doesn't have an option that will provide an rpath
# so we do it manually
ENV['OPENSSL_CFLAGS'] = "-Wl,-rpath -Wl,#{libraries_to_compile[:openssl].path}/lib"
ENV['OPENSSL_CFLAGS'] = "-Wl,-rpath -Wl,#{libraries_to_compile[:openssl].path}/lib64"
# Add the pkgconfig file with MSYS2'ish path, to prefer our ports build
# over MSYS2 system OpenSSL.
ENV['PKG_CONFIG_PATH'] = "#{libraries_to_compile[:openssl].path.gsub(/^(\w):/i) { "/" + $1.downcase }}/lib/pkgconfig:#{ENV['PKG_CONFIG_PATH']}"
ENV['PKG_CONFIG_PATH'] = "#{libraries_to_compile[:openssl].path.gsub(/^(\w):/i) { "/" + $1.downcase }}/lib64/pkgconfig:#{ENV['PKG_CONFIG_PATH']}"
libraries_to_compile[:freetds].configure_options << "--with-openssl=#{libraries_to_compile[:openssl].path}"
end

Expand Down
1 change: 0 additions & 1 deletion test/gem_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class GemTest < MiniTest::Spec
{
'x64-mingw-ucrt' => 'x64-mingw-ucrt',
'x64-mingw32' => 'x64-mingw32',
'x86-mingw32' => 'x86-mingw32',
'x86_64-linux' => 'x86_64-linux',
}.each do |host,expected|
describe "on a #{host} architecture" do
Expand Down

0 comments on commit d94efe6

Please sign in to comment.