From 9226df166624db76896b755c5de0ffecd82b3961 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Thu, 14 Nov 2024 13:31:58 +0100 Subject: [PATCH 1/9] Replace `setup-mssql` action --- .github/workflows/ci.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7539edc..9c5fc133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: fail-fast: false matrix: mssql-version: - #- 2017 + - 2017 - 2019 - 2022 ruby-version: @@ -138,12 +138,11 @@ jobs: Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL - uses: potatoqualitee/mssqlsuite@v1.7 + uses: andyundso/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 shell: pwsh @@ -218,7 +217,7 @@ jobs: fail-fast: false matrix: mssql-version: - #- 2017 + - 2017 - 2019 - 2022 ruby-version: @@ -259,12 +258,11 @@ jobs: Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL - uses: potatoqualitee/mssqlsuite@v1.7 + uses: andyundso/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 shell: pwsh @@ -396,12 +394,11 @@ jobs: bundle exec rake build - name: Setup MSSQL - uses: potatoqualitee/mssqlsuite@v1.7 + uses: andyundso/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: | From 2bff820cdd8720e6c43f6302161a37394c039181 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 10:43:07 +0100 Subject: [PATCH 2/9] Add new `force encryption` scenario on Windows The new action allows us to specify if the MSSQL server should enforce encryption at all times. This helps us to verify that our precompiled build on Windows, where we compile OpenSSL ourselves, will work as expected. --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c5fc133..0c8ab185 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,9 @@ jobs: strategy: fail-fast: false matrix: + force-encryption: + - "false" + - "true" mssql-version: - 2017 - 2019 @@ -143,6 +146,7 @@ jobs: components: sqlcmd,sqlengine version: ${{ matrix.mssql-version }} sa-password: c0MplicatedP@ssword + force-encryption: ${{ matrix.force-encryption }} - name: Setup MSSQL database shell: pwsh @@ -216,6 +220,9 @@ jobs: strategy: fail-fast: false matrix: + force-encryption: + - "false" + - "true" mssql-version: - 2017 - 2019 @@ -263,6 +270,7 @@ jobs: components: sqlcmd,sqlengine version: ${{ matrix.mssql-version }} sa-password: c0MplicatedP@ssword + force-encryption: ${{ matrix.force-encryption }} - name: Setup MSSQL database shell: pwsh From c96642abbba25c75e88691fe387cf02aa5c95d15 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 10:52:33 +0100 Subject: [PATCH 3/9] Bump freetds to v1.4.23 --- CHANGELOG.md | 1 + README.md | 6 +++--- ext/tiny_tds/extconsts.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c7e7ab5..1f3ed0a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Drop support for SQL Server < 2017 * Drop support for FreeTDS < 1.0 * Raise error if FreeTDS is unable to sent command buffer to the server +* Use freetds v1.4.23 for Windows builds ## 2.1.7 * Add Ruby 3.3 to the cross compile list diff --git a/README.md b/README.md index 4aa68e69..de93787e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/ext/tiny_tds/extconsts.rb b/ext/tiny_tds/extconsts.rb index 0a362fa6..9bcdafee 100644 --- a/ext/tiny_tds/extconsts.rb +++ b/ext/tiny_tds/extconsts.rb @@ -5,5 +5,5 @@ 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' +FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || '1.4.23' FREETDS_SOURCE_URI = "http://www.freetds.org/files/stable/freetds-#{FREETDS_VERSION}.tar.bz2" From 645dd238d4d5cf36706f2e6936ad170a37cabd56 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 10:55:24 +0100 Subject: [PATCH 4/9] Bump libiconv to v1.17 --- CHANGELOG.md | 2 +- ext/tiny_tds/extconsts.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f3ed0a8..f95deac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * Drop support for SQL Server < 2017 * Drop support for FreeTDS < 1.0 * Raise error if FreeTDS is unable to sent command buffer to the server -* Use freetds v1.4.23 for Windows builds +* Use freetds v1.4.23 and libiconv v1.17 for Windows builds ## 2.1.7 * Add Ruby 3.3 to the cross compile list diff --git a/ext/tiny_tds/extconsts.rb b/ext/tiny_tds/extconsts.rb index 9bcdafee..19f9a133 100644 --- a/ext/tiny_tds/extconsts.rb +++ b/ext/tiny_tds/extconsts.rb @@ -1,5 +1,5 @@ -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' From aacd7ed69cddb66e4dbef0f7a3894f9e2539d16f Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 10:57:12 +0100 Subject: [PATCH 5/9] Fix cache restore keys for ports --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c8ab185..1ad2aafe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: uses: actions/cache@v4 with: path: ports - key: cross-compiled-${{ hashFiles('**/.ports_versions') }} + key: cross-compiled-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} restore-keys: | - cross-compiled-${{ hashFiles('**/.ports_versions') }} - cross-compiled-v2- + cross-compiled-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} + cross-compiled-${{ matrix.platform }}- - name: Build gem shell: bash @@ -351,10 +351,10 @@ jobs: uses: actions/cache@v4 with: path: ports - key: native-v2-${{ hashFiles('**/.ports_versions') }} + key: native-${{ hashFiles('**/.ports_versions') }} restore-keys: | native-${{ hashFiles('* */.ports_versions') }} - native-v2- + native- - name: Build required libraries run: | @@ -394,7 +394,7 @@ jobs: uses: actions/cache@v4 with: path: ports - key: native-v2-${{ hashFiles('**/.ports_versions') }} + key: native-${{ hashFiles('**/.ports_versions') }} fail-on-cache-miss: true - name: Build gem From c67e7c788f07f1b8f014272d832569a12ce5bac0 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 11:14:32 +0100 Subject: [PATCH 6/9] Bump OpenSSL to v3.4.0 Also bump the cache key to force a recompilation of freetds against the new OpenSSL version. --- .github/workflows/ci.yml | 14 +++++++------- CHANGELOG.md | 2 +- ext/tiny_tds/extconsts.rb | 2 +- tasks/ports.rake | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ad2aafe..0497589c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: uses: actions/cache@v4 with: path: ports - key: cross-compiled-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} + key: cross-compiled-v3-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} restore-keys: | - cross-compiled-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} - cross-compiled-${{ matrix.platform }}- + cross-compiled-v3-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }} + cross-compiled-v3-${{ matrix.platform }}- - name: Build gem shell: bash @@ -351,10 +351,10 @@ jobs: uses: actions/cache@v4 with: path: ports - key: native-${{ hashFiles('**/.ports_versions') }} + key: native-v3-${{ hashFiles('**/.ports_versions') }} restore-keys: | - native-${{ hashFiles('* */.ports_versions') }} - native- + native-v3-${{ hashFiles('* */.ports_versions') }} + native-v3- - name: Build required libraries run: | @@ -394,7 +394,7 @@ jobs: uses: actions/cache@v4 with: path: ports - key: native-${{ hashFiles('**/.ports_versions') }} + key: native-v3-${{ hashFiles('**/.ports_versions') }} fail-on-cache-miss: true - name: Build gem diff --git a/CHANGELOG.md b/CHANGELOG.md index f95deac6..9761fbbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * Drop support for SQL Server < 2017 * Drop support for FreeTDS < 1.0 * Raise error if FreeTDS is unable to sent command buffer to the server -* Use freetds v1.4.23 and libiconv v1.17 for Windows builds +* 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 diff --git a/ext/tiny_tds/extconsts.rb b/ext/tiny_tds/extconsts.rb index 19f9a133..64af1704 100644 --- a/ext/tiny_tds/extconsts.rb +++ b/ext/tiny_tds/extconsts.rb @@ -2,7 +2,7 @@ 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.4.23' diff --git a/tasks/ports.rake b/tasks/ports.rake index 451267f7..1ab6bf96 100644 --- a/tasks/ports.rake +++ b/tasks/ports.rake @@ -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 From 60c66740a11a74e84b7f9ba4eb372cffd7c72490 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 19 Nov 2024 11:16:22 +0100 Subject: [PATCH 7/9] Drop support for 32-bit Windows --- .github/workflows/ci.yml | 1 - CHANGELOG.md | 1 + Rakefile | 4 ---- ext/tiny_tds/extconf.rb | 1 - test/gem_test.rb | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0497589c..8477010b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: matrix: platform: - "x64-mingw32" - - "x86-mingw32" - "x64-mingw-ucrt" name: cross-compile-windows runs-on: ubuntu-22.04 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9761fbbb..14efc701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * 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 diff --git a/Rakefile b/Rakefile index be8c60e6..f7580918 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/ext/tiny_tds/extconf.rb b/ext/tiny_tds/extconf.rb index b1beabc4..d0691792 100644 --- a/ext/tiny_tds/extconf.rb +++ b/ext/tiny_tds/extconf.rb @@ -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) diff --git a/test/gem_test.rb b/test/gem_test.rb index 48b7a631..b05a8edc 100644 --- a/test/gem_test.rb +++ b/test/gem_test.rb @@ -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 From 8deb5b2c93a2a8d2ab2e2b049034ef6be0878e88 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Mon, 9 Dec 2024 17:01:57 +0100 Subject: [PATCH 8/9] Pass `force-encryption` as YAML boolean --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8477010b..18ed9305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,8 +96,8 @@ jobs: fail-fast: false matrix: force-encryption: - - "false" - - "true" + - false + - true mssql-version: - 2017 - 2019 @@ -220,8 +220,8 @@ jobs: fail-fast: false matrix: force-encryption: - - "false" - - "true" + - false + - true mssql-version: - 2017 - 2019 From 681301c4f53bbcf7c497b8bf9a94bfc4c76dd6f8 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Mon, 9 Dec 2024 17:05:55 +0100 Subject: [PATCH 9/9] `setup-mssql` is now owned by `rails-sqlserver` --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18ed9305..cd0c8a29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,7 @@ jobs: Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL - uses: andyundso/setup-mssql@v1 + uses: rails-sqlserver/setup-mssql@v1 with: components: sqlcmd,sqlengine version: ${{ matrix.mssql-version }} @@ -264,7 +264,7 @@ jobs: Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL - uses: andyundso/setup-mssql@v1 + uses: rails-sqlserver/setup-mssql@v1 with: components: sqlcmd,sqlengine version: ${{ matrix.mssql-version }} @@ -401,7 +401,7 @@ jobs: bundle exec rake build - name: Setup MSSQL - uses: andyundso/setup-mssql@v1 + uses: rails-sqlserver/setup-mssql@v1 with: components: sqlcmd,sqlengine version: ${{ matrix.mssql-version }}