From f5872bd9e7a69097d2b1356a261e8641a42545cb Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 8 Apr 2025 20:31:54 +0200 Subject: [PATCH 1/4] Drop testing against MSSQL 2017 The MSSQL container does no longer start on GitHub Actions since a couple of weeks. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f209ad03..96440a88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -425,7 +425,6 @@ jobs: - true mssql-version: - - 2017 - 2019 - 2022 From 33144c275a16ce4dffd547e72b26fab2e376217c Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 8 Apr 2025 20:33:13 +0200 Subject: [PATCH 2/4] Remove checkout when installing precompiled version on Windows --- .github/workflows/ci.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96440a88..232d3020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,6 @@ jobs: name: install-windows-mingw runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} @@ -80,13 +78,7 @@ jobs: - name: Install native gem shell: pwsh - run: | - $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() - $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - - Write-Host "Looking to install $gemToInstall" - gem install "$gemToInstall" + run: gem install "tiny_tds-*.gem" - name: Test if TinyTDS loads shell: pwsh @@ -191,8 +183,6 @@ jobs: name: install-windows-ucrt runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} @@ -205,13 +195,7 @@ jobs: - name: Install native gem shell: pwsh - run: | - $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() - $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - - Write-Host "Looking to install $gemToInstall" - gem install "$gemToInstall" + run: gem install "tiny_tds-*.gem" - name: Test if TinyTDS loads shell: pwsh From 71df0337b7e458b4e96731633c8f6a3da83b78a9 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 8 Apr 2025 20:51:58 +0200 Subject: [PATCH 3/4] Also include `bin` in directories to load native code --- CHANGELOG.md | 4 ++++ VERSION | 2 +- lib/tiny_tds.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a44bf42a..cc7e4b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.2.1 + +* Ensure the native Gem loads on Windows. Fixes #581. + ## 3.2.0 * Reduce number of files shipped with precompiled Windows gem diff --git a/VERSION b/VERSION index 944880fa..e4604e3a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.2.1 diff --git a/lib/tiny_tds.rb b/lib/tiny_tds.rb index e00c7373..3caa8dcf 100644 --- a/lib/tiny_tds.rb +++ b/lib/tiny_tds.rb @@ -11,7 +11,7 @@ module TinyTds # Is this file part of a fat binary gem with bundled freetds? # This path must be enabled by add_dll_directory on Windows. gplat = ::Gem::Platform.local - FREETDS_LIB_PATH = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/lib", __dir__)].first + FREETDS_LIB_PATH = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/{bin,lib}", __dir__)].first add_dll_path = proc do |path, &block| if RUBY_PLATFORM =~ /(mswin|mingw)/i && path From 01c2038721391c78f816fa9d272dcdce5833f3cf Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 8 Apr 2025 20:58:19 +0200 Subject: [PATCH 4/4] Also remove `checkout` step on Linux --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 232d3020..6d3781c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,8 +373,6 @@ jobs: name: install-linux runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - name: Download precompiled gem uses: actions/download-artifact@v4 with: @@ -391,7 +389,7 @@ jobs: sh -c " gem update --system 3.3.22 && ${{ matrix.bootstrap }} - gem install --no-document ./gems/tiny_tds-$(cat VERSION)-${{ matrix.platform }}.gem && + gem install --no-document ./gems/tiny_tds-*.gem && ruby -e \"require 'tiny_tds'; puts TinyTds::Gem.root_path\" && tsql-ttds -C && defncopy-ttds -v