tiny_tds 2.1.5-x64-mingw32 → 2.1.6-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +407 -0
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +7 -1
  5. data/Gemfile +0 -7
  6. data/README.md +2 -4
  7. data/Rakefile +19 -10
  8. data/VERSION +1 -1
  9. data/docker-compose.yml +19 -7
  10. data/ext/tiny_tds/client.c +2 -0
  11. data/ext/tiny_tds/extconf.rb +21 -2
  12. data/ext/tiny_tds/extconsts.rb +1 -1
  13. data/ext/tiny_tds/result.c +1 -0
  14. data/lib/tiny_tds/2.4/tiny_tds.so +0 -0
  15. data/lib/tiny_tds/2.5/tiny_tds.so +0 -0
  16. data/lib/tiny_tds/2.6/tiny_tds.so +0 -0
  17. data/lib/tiny_tds/2.7/tiny_tds.so +0 -0
  18. data/lib/tiny_tds/3.0/tiny_tds.so +0 -0
  19. data/lib/tiny_tds/gem.rb +1 -6
  20. data/ports/x64-mingw32/freetds/1.1.24/bin/bsqldb.exe +0 -0
  21. data/ports/x64-mingw32/freetds/1.1.24/bin/datacopy.exe +0 -0
  22. data/ports/x64-mingw32/freetds/1.1.24/bin/defncopy.exe +0 -0
  23. data/ports/x64-mingw32/freetds/1.1.24/bin/freebcp.exe +0 -0
  24. data/ports/x64-mingw32/freetds/1.1.24/bin/libct-4.dll +0 -0
  25. data/ports/x64-mingw32/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
  26. data/ports/x64-mingw32/freetds/1.1.24/bin/tdspool.exe +0 -0
  27. data/ports/x64-mingw32/freetds/1.1.24/bin/tsql.exe +0 -0
  28. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/freetds/1.1.24/lib/libct.dll.a +0 -0
  29. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/freetds/1.1.24/lib/libct.la +2 -2
  30. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/freetds/1.1.24/lib/libsybdb.dll.a +0 -0
  31. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/freetds/1.1.24/lib/libsybdb.la +2 -2
  32. data/ports/x64-mingw32/libiconv/1.15/bin/iconv.exe +0 -0
  33. data/ports/x64-mingw32/libiconv/1.15/bin/libcharset-1.dll +0 -0
  34. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/bin/libiconv-2.dll +0 -0
  35. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/lib/libcharset.dll.a +0 -0
  36. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/lib/libcharset.la +2 -2
  37. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/lib/libiconv.dll.a +0 -0
  38. data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/lib/libiconv.la +2 -2
  39. data/ports/x64-mingw32/openssl/1.1.1s/bin/c_rehash +251 -0
  40. data/ports/x64-mingw32/openssl/1.1.1s/bin/libcrypto-1_1-x64.dll +0 -0
  41. data/ports/x64-mingw32/openssl/1.1.1s/bin/libssl-1_1-x64.dll +0 -0
  42. data/ports/x64-mingw32/openssl/1.1.1s/bin/openssl.exe +0 -0
  43. data/ports/x64-mingw32/openssl/1.1.1s/lib/libcrypto.a +0 -0
  44. data/ports/{x86_64-w64-mingw32/openssl/1.1.1d → x64-mingw32/openssl/1.1.1s}/lib/libcrypto.dll.a +0 -0
  45. data/ports/x64-mingw32/openssl/1.1.1s/lib/libssl.a +0 -0
  46. data/ports/{x86_64-w64-mingw32/openssl/1.1.1d → x64-mingw32/openssl/1.1.1s}/lib/libssl.dll.a +0 -0
  47. data/setup_cimgruby_dev.sh +25 -0
  48. data/start_dev.sh +21 -0
  49. data/tasks/native_gem.rake +15 -6
  50. data/tasks/ports/libiconv.rb +0 -17
  51. data/tasks/ports/recipe.rb +16 -4
  52. data/tasks/ports.rake +58 -35
  53. data/test/bin/install-mssql.ps1 +31 -0
  54. data/test/bin/install-mssqltools.sh +9 -0
  55. data/test/bin/setup_tinytds_db.sh +7 -0
  56. data/test/bin/setup_volume_permissions.sh +10 -0
  57. data/test/client_test.rb +6 -6
  58. data/test/gem_test.rb +11 -13
  59. data/test/sql/db-create.sql +18 -0
  60. data/test/sql/db-login.sql +38 -0
  61. data/test/test_helper.rb +16 -7
  62. data/tiny_tds.gemspec +7 -6
  63. metadata +69 -50
  64. data/.travis.yml +0 -25
  65. data/appveyor.yml +0 -72
  66. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/bsqldb.exe +0 -0
  67. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/datacopy.exe +0 -0
  68. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/defncopy.exe +0 -0
  69. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/freebcp.exe +0 -0
  70. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/libct-4.dll +0 -0
  71. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
  72. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/tdspool.exe +0 -0
  73. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/tsql.exe +0 -0
  74. data/ports/x86_64-w64-mingw32/libiconv/1.15/bin/iconv.exe +0 -0
  75. data/ports/x86_64-w64-mingw32/libiconv/1.15/bin/libcharset-1.dll +0 -0
  76. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/c_rehash +0 -232
  77. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/libcrypto-1_1-x64.dll +0 -0
  78. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/libssl-1_1-x64.dll +0 -0
  79. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/openssl.exe +0 -0
  80. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib/libcrypto.a +0 -0
  81. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib/libssl.a +0 -0
  82. data/test/appveyor/dbsetup.ps1 +0 -27
  83. data/test/appveyor/dbsetup.sql +0 -9
  84. data/test/bin/setup.sh +0 -19
  85. /data/ports/{x86_64-w64-mingw32 → x64-mingw32}/freetds/1.1.24/bin/osql +0 -0
  86. /data/ports/{x86_64-w64-mingw32 → x64-mingw32}/libiconv/1.15/lib/charset.alias +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67f523a732b6d4b9e39320e3331465de0f566cddec1049460c9b2bbb1d5fc8c8
4
- data.tar.gz: f411a519c17e3a4ff53c187f84018ef3d0ebe516aaae2778ce18ef8fc6c21016
3
+ metadata.gz: 461f8afc462b448460737bc80db5e9e782fb0bf10749346e1addf5f0c38fb5fe
4
+ data.tar.gz: e6dd9cea5665ba468ad755542a22b9e3489b991e090324da393371e12df79493
5
5
  SHA512:
6
- metadata.gz: 46a60fddcfff07dbe8b7fe4c0a1aaf1520b9bcbeff5759dbcdade07b22b15cdf118fd8cf515f4750729c3e785a5d9a9fa7a463971a0b8229bfc030e1cea02650
7
- data.tar.gz: 27cffc6e51817b4d8d828079f7495ad8c4b683fe272246aab792a48547866e7e183d9d3f1d14c85a3bfadf9ebea4fb8be8542e94c8518836ce3054a1a73b34d9
6
+ metadata.gz: 841af9432755424f2272248dfbd012f12ae10b30cef484928c9a5070ae2f1fd1b33479400c9adceffa9d4052f336bbe78107a3dfddb07ee38da2282b3363215a
7
+ data.tar.gz: 7e155f33c0072f963e7949e72d2e7a2d48995638992e08cb59162ba1e3df6614f44e0a110ebae1e53d97644e897008253a1769430d488550be96c51c6cfba69d
@@ -0,0 +1,407 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ win: circleci/windows@4.1
5
+ ruby: circleci/ruby@2.0.0
6
+
7
+ commands:
8
+ install-ruby-windows:
9
+ description: "Install Ruby on Windows"
10
+ parameters:
11
+ ruby_version:
12
+ description: 'version tag for the cimg/ruby container'
13
+ type: string
14
+ steps:
15
+ - run:
16
+ name: remove pre-installed ruby
17
+ command: |
18
+ Get-ChildItem -path 'C:\tools\' -filter Ruby* | Remove-Item -Force -Recurse
19
+
20
+ - run:
21
+ name: download and install ruby devkit
22
+ command: |
23
+ $ProgressPreference='SilentlyContinue'
24
+
25
+ $uri = 'https://api.github.com/repos/oneclick/rubyinstaller2/tags?per_page=200'
26
+ $releases = ((Invoke-WebRequest $uri) | ConvertFrom-Json).name | select-string -Pattern '<< parameters.ruby_version >>'
27
+ $target_release = (($releases | Sort-Object -Descending)[0] | Out-String).Trim()
28
+ $target_version = $target_release.Substring($target_release.Length - 7)
29
+ $download_uri = "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-$target_version/rubyinstaller-devkit-$target_version-x64.exe"
30
+ echo "Ruby Target Version Found: $target_version"
31
+
32
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
33
+ Invoke-WebRequest -UseBasicParsing -uri $download_uri -OutFile C:\ruby-setup.exe
34
+
35
+ echo "Download finished, starting installation of $target_version"
36
+ C:\ruby-setup.exe /VERYSILENT /NORESTART /ALLUSERS /DIR=C:/Ruby<< parameters.ruby_version >>-x64
37
+
38
+ - run:
39
+ name: ruby diagnostics
40
+ command: |
41
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
42
+ echo "Perl Version:"
43
+ perl --version
44
+ echo "Ruby Version:"
45
+ ruby --version
46
+ echo "Gem Version:"
47
+ gem --version
48
+
49
+ - run:
50
+ name: install bundler
51
+ command: |
52
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
53
+ gem install bundler -v 2.3.26
54
+
55
+ jobs:
56
+ test_linux:
57
+ parameters:
58
+ ruby_version:
59
+ description: 'version tag for the cimg/ruby container'
60
+ type: string
61
+
62
+ machine:
63
+ image: ubuntu-2004:current
64
+
65
+ # be sure to update the ./setup_cimgruby_dev.sh if changes are made to steps below
66
+ steps:
67
+ - checkout
68
+
69
+ - run:
70
+ name: start docker-compose build environment
71
+ command: |
72
+ sudo ./test/bin/setup_volume_permissions.sh
73
+ docker-compose up -d
74
+ echo "Waiting for containers to start..."
75
+ sleep 10
76
+ environment:
77
+ RUBY_VERSION: << parameters.ruby_version >>
78
+
79
+ - run:
80
+ name: install sql prereqs
81
+ command: |
82
+ docker exec cimg_ruby bash -c 'sudo -E ./test/bin/install-mssqltools.sh'
83
+
84
+ - run:
85
+ name: setup tiny_tds test database
86
+ command: |
87
+ docker exec cimg_ruby bash -c './test/bin/setup_tinytds_db.sh'
88
+
89
+ - run:
90
+ name: bundle install gems
91
+ command: |
92
+ docker exec cimg_ruby bash -c 'bundle install'
93
+
94
+ - run:
95
+ name: Write used versions into file
96
+ command: |
97
+ docker exec cimg_ruby bash -c 'bundle exec rake ports:version_file'
98
+
99
+ - restore_cache:
100
+ name: restore ports cache
101
+ keys:
102
+ - ports-<< parameters.ruby_version >>-{{ arch }}-{{ checksum ".ports_versions" }}
103
+ - ports-<< parameters.ruby_version >>-{{ arch }}-
104
+
105
+ - run:
106
+ name: compile ports
107
+ command: |
108
+ docker exec cimg_ruby bash -c 'bundle exec rake ports'
109
+
110
+ - run:
111
+ name: build gem
112
+ command: |
113
+ docker exec cimg_ruby bash -c 'bundle exec rake build'
114
+
115
+ - run:
116
+ name: Fix permissions on ports directory
117
+ command: |
118
+ docker exec cimg_ruby bash -c 'sudo chown -R $(id -u):$(id -g) ports'
119
+
120
+ - run:
121
+ name: test gem
122
+ command: |
123
+ docker exec cimg_ruby bash -c 'bundle exec rake test'
124
+
125
+ - save_cache:
126
+ name: save ports cache
127
+ paths:
128
+ - ./ports
129
+ key: ports-<< parameters.ruby_version >>-{{ arch }}-{{ arch }}-{{ checksum ".ports_versions" }}
130
+
131
+ - store_test_results:
132
+ path: test/reports
133
+
134
+ test_windows:
135
+ parameters:
136
+ ruby_version:
137
+ description: 'version tag for rubydev environment'
138
+ type: string
139
+
140
+ executor:
141
+ name: win/server-2022
142
+ shell: powershell.exe
143
+
144
+ environment:
145
+ RAKEOPT: '-rdevkit'
146
+ TESTOPTS: '-v'
147
+ MAKE: 'make V=1 -j2'
148
+
149
+ steps:
150
+ - install-ruby-windows:
151
+ ruby_version: << parameters.ruby_version >>
152
+
153
+ - checkout
154
+
155
+ - restore_cache:
156
+ name: restore gem cache
157
+ keys:
158
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
159
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-
160
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-
161
+
162
+ - run:
163
+ name: bundle install gems
164
+ command: |
165
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
166
+ bundle install --path vendor/bundle
167
+
168
+ - save_cache:
169
+ name: save gem cache
170
+ paths:
171
+ - ./vendor/bundle
172
+ key: v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
173
+
174
+ - attach_workspace:
175
+ at: artifacts
176
+
177
+ - run:
178
+ name: install native gem and restore cross-compiled code from gem
179
+ command: |
180
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
181
+ $rubyArchitecture = (ruby -e 'puts RUBY_PLATFORM').Trim()
182
+ $gemVersion = (Get-Content VERSION).Trim()
183
+
184
+ gem install --local --install-dir=./tmp "artifacts/gems/tiny_tds-$gemVersion-$rubyArchitecture.gem"
185
+
186
+ # Restore precompiled code
187
+ $source = (Resolve-Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path
188
+ $destination = (Resolve-Path ".\lib\tiny_tds").Path
189
+ Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)}
190
+
191
+ # Restore ports
192
+ Copy-Item -Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse
193
+
194
+ - restore_cache:
195
+ name: restore mssql installation file
196
+ key: downloads-{{ checksum "test/bin/install-mssql.ps1" }}
197
+
198
+ - run:
199
+ name: setup mssql
200
+ command: |
201
+ .\test\bin\install-mssql.ps1
202
+
203
+ - save_cache:
204
+ name: save downloads cache
205
+ paths:
206
+ - C:\Downloads
207
+ key: downloads-{{ checksum "test/bin/install-mssql.ps1" }}
208
+
209
+ - run:
210
+ name: install toxiproxy-server
211
+ command: |
212
+ choco install toxiproxy-server --version=2.5.0 -y
213
+ Start-Process toxiproxy-server
214
+
215
+ - run:
216
+ name: test gem
217
+ command: |
218
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
219
+ bundle exec rake test
220
+ environment:
221
+ TOXIPROXY_HOST: "localhost"
222
+
223
+ - store_test_results:
224
+ path: test/reports
225
+
226
+ - run:
227
+ name: Rename gem to a consistent name to store artifact
228
+ command: |
229
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
230
+ $rubyArchitecture = (ruby -e 'puts RUBY_PLATFORM').Trim()
231
+ $gemVersion = (Get-Content VERSION).Trim()
232
+
233
+ New-Item -Path . -Name "tested_artifact" -ItemType "directory"
234
+ Move-Item "artifacts/gems/tiny_tds-$gemVersion-$rubyArchitecture.gem" "tested_artifact"
235
+
236
+ - store_artifacts:
237
+ path: tested_artifact
238
+
239
+ cross_compile_gem:
240
+ parameters:
241
+ platform:
242
+ description: "Platform to compile the gem resources"
243
+ type: string
244
+
245
+ docker:
246
+ - image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.3.0-mri-<< parameters.platform >>"
247
+
248
+ steps:
249
+ - checkout
250
+
251
+ - run:
252
+ name: bundle install gems
253
+ command: |
254
+ bundle install
255
+
256
+ - run:
257
+ name: Write used versions for ports into file
258
+ command: |
259
+ rake ports:version_file[<< parameters.platform >>]
260
+
261
+ - restore_cache:
262
+ name: restore ports cache
263
+ keys:
264
+ - ports-win-{{ arch }}-{{ checksum ".ports_versions" }}
265
+ - ports-win-{{ arch }}-
266
+
267
+ - run:
268
+ name: Build gem
269
+ command: |
270
+ rake gem:for_platform[<< parameters.platform >>]
271
+
272
+ - run:
273
+ name: Move gems into separate directory before caching
274
+ command: |
275
+ mkdir -p artifacts-<< parameters.platform >>/gems
276
+ mv pkg/*.gem artifacts-<< parameters.platform >>/gems
277
+
278
+ - run:
279
+ name: Remove non-native gem to avoid conflict in workspace
280
+ command: |
281
+ gemVersion=$(cat VERSION | tr -d "[:space:]")
282
+ rm -rf artifacts-<< parameters.platform >>/gems/tiny_tds-$gemVersion.gem
283
+
284
+ - store_artifacts:
285
+ path: artifacts-<< parameters.platform >>/gems
286
+
287
+ - save_cache:
288
+ name: save ports cache
289
+ paths:
290
+ - ./ports
291
+ key: ports-win-{{ arch }}-{{ checksum ".ports_versions" }}
292
+
293
+ - persist_to_workspace:
294
+ name: save gems into workspace
295
+ root: artifacts-<< parameters.platform >>
296
+ paths:
297
+ - gems
298
+
299
+ install_windows:
300
+ parameters:
301
+ ruby_version:
302
+ description: 'version tag for rubydev environment'
303
+ type: string
304
+
305
+ executor:
306
+ name: win/server-2022
307
+ shell: powershell.exe
308
+
309
+ environment:
310
+ RAKEOPT: '-rdevkit'
311
+ TESTOPTS: '-v'
312
+ MAKE: 'make V=1 -j2'
313
+
314
+ steps:
315
+ - install-ruby-windows:
316
+ ruby_version: << parameters.ruby_version >>
317
+
318
+ - run:
319
+ name: Ensure msys2 installation is complete
320
+ command: |
321
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
322
+
323
+ # on older Ruby version, the msys version shipped with RubyInstaller is quite old
324
+ # and RubyInstaller will be unable to install anything because of outdated keys
325
+ # With this those commands, we force to get a new set of keys
326
+ # see https://www.msys2.org/docs/updating/#potential-issues
327
+ ridk exec pacman-key --init
328
+ ridk exec pacman-key --refresh-keys
329
+ ridk install 1 2 3
330
+
331
+ - checkout
332
+
333
+ - restore_cache:
334
+ name: restore gem cache
335
+ keys:
336
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
337
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-
338
+ - v1-bundle-<< parameters.ruby_version >>-{{ arch }}-
339
+
340
+ - run:
341
+ name: bundle install gems
342
+ command: |
343
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
344
+ bundle install --path vendor/bundle
345
+
346
+ - save_cache:
347
+ name: save gem cache
348
+ paths:
349
+ - ./vendor/bundle
350
+ key: v1-bundle-<< parameters.ruby_version >>-{{ arch }}-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
351
+
352
+ - run:
353
+ name: build gem
354
+ command: |
355
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
356
+ gem build tiny_tds.gemspec
357
+
358
+ - run:
359
+ name: Install gem
360
+ command: |
361
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
362
+ $gemVersion = (Get-Content VERSION).Trim()
363
+ gem install --local "tiny_tds-$gemVersion.gem"
364
+
365
+ - run:
366
+ name: Check if gem loads correctly
367
+ command: |
368
+ $Env:PATH = "C:\\Ruby<< parameters.ruby_version >>-x64\\bin;$Env:PATH"
369
+ ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
370
+ exit $LASTEXITCODE
371
+
372
+ workflows:
373
+ test_supported_ruby_versions:
374
+ jobs:
375
+ - cross_compile_gem:
376
+ matrix:
377
+ parameters:
378
+ platform:
379
+ - "x86-mingw32"
380
+ - "x64-mingw32"
381
+ - "x64-mingw-ucrt"
382
+ - test_windows:
383
+ requires:
384
+ - cross_compile_gem
385
+ matrix: &ruby_versions
386
+ parameters:
387
+ ruby_version:
388
+ - '2.4'
389
+ - '2.5'
390
+ - '2.6'
391
+ - '2.7'
392
+ - '3.0'
393
+ - '3.1'
394
+ - '3.2'
395
+ - test_linux:
396
+ matrix: *ruby_versions
397
+
398
+ - install_windows:
399
+ matrix:
400
+ parameters:
401
+ ruby_version:
402
+ - '2.5'
403
+ - '2.6'
404
+ - '2.7'
405
+ - '3.0'
406
+ - '3.1'
407
+ - '3.2'
data/.gitignore CHANGED
@@ -18,3 +18,5 @@ misc
18
18
  /exe/*
19
19
  /ports/*
20
20
  !/ports/patches/
21
+ test/reports
22
+ .ports_versions
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- ## (unreleased)
1
+ ## 2.1.6
2
+
3
+ * Add Ruby 3.0, 3.1, and 3.2 to the cross compile list
4
+ * Fix segfault when asking if client was dead after closing it. Fixes #519.
5
+ * Mark `alloc` function as undefined on `TinyTds::Result`. Fixes #515.
6
+ * Fix Gem installation on Windows by adding default freetds msys path. Fixes #522
7
+ * Search for `freetds` in `/opt/homebrew` when installing on Apple Silicon. Fixes #484, #492 and #508.
2
8
 
3
9
  ## 2.1.5
4
10
 
data/Gemfile CHANGED
@@ -1,9 +1,2 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
-
4
- group :development do
5
- end
6
-
7
- group :test do
8
- gem 'minitest'
9
- end
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
2
2
 
3
- * [![TravisCI](https://travis-ci.org/rails-sqlserver/tiny_tds.svg?branch=master)](https://travis-ci.org/rails-sqlserver/tiny_tds) - TravisCI
4
- * [![Build Status](https://ci.appveyor.com/api/projects/status/g2bhhbsdkx0mal55/branch/master?svg=true)](https://ci.appveyor.com/project/rails-sqlserver/tiny-tds/branch/master) - Appveyor
3
+ * [![CircleCI](https://circleci.com/gh/rails-sqlserver/tiny_tds.svg?style=svg)](https://app.circleci.com/pipelines/github/rails-sqlserver/tiny_tds) - CircleCi
5
4
  * [![Gem Version](https://img.shields.io/gem/v/tiny_tds.svg)](https://rubygems.org/gems/tiny_tds) - Gem Version
6
5
  * [![Gitter chat](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/rails-sqlserver/activerecord-sqlserver-adapter) - Community
7
6
 
8
-
9
7
  ## About TinyTDS
10
8
 
11
9
  The TinyTDS gem is meant to serve the extremely common use-case of connecting, querying and iterating over results to Microsoft SQL Server or Sybase databases from Ruby using the FreeTDS's DB-Library API.
@@ -409,7 +407,7 @@ For the convenience of Windows users, TinyTDS ships pre-compiled gems for suppor
409
407
  Run the following rake task to compile the gems for Windows. This will check the availability of [Docker](https://www.docker.com/) (and boot2docker on Windows or OS-X) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
410
408
 
411
409
  ```
412
- $ rake gem:windows
410
+ $ rake gem:native
413
411
  ```
414
412
 
415
413
  The compiled gems will exist in `./pkg` directory.
data/Rakefile CHANGED
@@ -6,19 +6,33 @@ require 'rake/extensiontask'
6
6
  require_relative './ext/tiny_tds/extconsts'
7
7
 
8
8
  SPEC = Gem::Specification.load(File.expand_path('../tiny_tds.gemspec', __FILE__))
9
+
10
+ ruby_cc_ucrt_versions = "3.2.0:3.1.0".freeze
11
+ ruby_cc_mingw32_versions = "3.0.0:2.7.0:2.6.0:2.5.0:2.4.0".freeze
12
+
9
13
  GEM_PLATFORM_HOSTS = {
10
- 'x86-mingw32' => 'i686-w64-mingw32',
11
- 'x64-mingw32' => 'x86_64-w64-mingw32'
14
+ 'x86-mingw32' => {
15
+ host: 'i686-w64-mingw32',
16
+ ruby_versions: ruby_cc_mingw32_versions
17
+ },
18
+ 'x64-mingw32' => {
19
+ host: 'x86_64-w64-mingw32',
20
+ ruby_versions: ruby_cc_mingw32_versions
21
+ },
22
+ 'x64-mingw-ucrt' => {
23
+ host: 'x86_64-w64-mingw32',
24
+ ruby_versions: ruby_cc_ucrt_versions
25
+ },
12
26
  }
13
27
 
14
28
  # Add our project specific files to clean for a rebuild
15
29
  CLEAN.include FileList["{ext,lib}/**/*.{so,#{RbConfig::CONFIG['DLEXT']},o}"],
16
- FileList["exe/*"]
30
+ FileList["exe/*"]
17
31
 
18
32
  # Clobber all our temp files and ports files including .install files
19
33
  # and archives
20
34
  CLOBBER.include FileList["tmp/**/*"],
21
- FileList["ports/**/*"].exclude(%r{^ports/archives})
35
+ FileList["ports/**/*"].exclude(%r{^ports/archives})
22
36
 
23
37
  Dir['tasks/*.rake'].sort.each { |f| load f }
24
38
 
@@ -32,15 +46,11 @@ Rake::ExtensionTask.new('tiny_tds', SPEC) do |ext|
32
46
  # The fat binary gem doesn't depend on the freetds package, since it bundles the library.
33
47
  spec.metadata.delete('msys2_mingw_dependencies')
34
48
 
35
- platform_host_map = GEM_PLATFORM_HOSTS
36
- gemplat = spec.platform.to_s
37
- host = platform_host_map[gemplat]
38
-
39
49
  # We don't need the sources in a fat binary gem
40
50
  spec.files = spec.files.reject { |f| f =~ %r{^ports\/archives/} }
41
51
 
42
52
  # Make sure to include the ports binaries and libraries
43
- spec.files += FileList["ports/#{host}/**/**/{bin,lib}/*"].exclude do |f|
53
+ spec.files += FileList["ports/#{spec.platform.to_s}/**/**/{bin,lib}/*"].exclude do |f|
44
54
  File.directory? f
45
55
  end
46
56
 
@@ -50,4 +60,3 @@ end
50
60
 
51
61
  task build: [:clean, :compile]
52
62
  task default: [:build, :test]
53
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.5
1
+ 2.1.6
data/docker-compose.yml CHANGED
@@ -7,16 +7,28 @@ services:
7
7
  mssql:
8
8
  image: metaskills/mssql-server-linux-tinytds:2017-GA
9
9
  container_name: sqlserver
10
+ environment:
11
+ ACCEPT_EULA: Y
12
+ SA_PASSWORD: super01S3cUr3
10
13
  ports:
11
14
  - "1433:1433"
12
- networks:
13
- - main-network
15
+ network_mode: "host"
14
16
 
15
17
  toxiproxy:
16
18
  image: shopify/toxiproxy
17
19
  container_name: toxiproxy
18
- ports:
19
- - "8474:8474"
20
- - "1234:1234"
21
- networks:
22
- - main-network
20
+ command: '/toxiproxy -host=127.0.0.1'
21
+ network_mode: "host"
22
+
23
+ cimgruby:
24
+ image: "cimg/ruby:${RUBY_VERSION:-2.7}"
25
+ container_name: cimg_ruby
26
+ environment:
27
+ TESTOPTS: '-v'
28
+ TINYTDS_UNIT_HOST: '127.0.0.1'
29
+ SA_PASSWORD: super01S3cUr3
30
+ TOXIPROXY_HOST: '127.0.0.1'
31
+ command: tail -F anything
32
+ volumes:
33
+ - .:/home/circleci/project
34
+ network_mode: "host"
@@ -232,6 +232,7 @@ static void rb_tinytds_client_free(void *ptr) {
232
232
  dbloginfree(cwrap->login);
233
233
  if (cwrap->client && !cwrap->closed) {
234
234
  dbclose(cwrap->client);
235
+ cwrap->client = NULL;
235
236
  cwrap->closed = 1;
236
237
  cwrap->userdata->closed = 1;
237
238
  }
@@ -263,6 +264,7 @@ static VALUE rb_tinytds_close(VALUE self) {
263
264
  GET_CLIENT_WRAPPER(self);
264
265
  if (cwrap->client && !cwrap->closed) {
265
266
  dbclose(cwrap->client);
267
+ cwrap->client = NULL;
266
268
  cwrap->closed = 1;
267
269
  cwrap->userdata->closed = 1;
268
270
  }
@@ -21,9 +21,11 @@ end
21
21
  do_help if arg_config('--help')
22
22
 
23
23
  # Make sure to check the ports path for the configured host
24
- host = RbConfig::CONFIG['host']
24
+ architecture = RbConfig::CONFIG['arch']
25
+ architecture = "x86-mingw32" if architecture == "i386-mingw32"
26
+
25
27
  project_dir = File.expand_path("../../..", __FILE__)
26
- freetds_ports_dir = File.join(project_dir, 'ports', host, 'freetds', FREETDS_VERSION)
28
+ freetds_ports_dir = File.join(project_dir, 'ports', architecture, 'freetds', FREETDS_VERSION)
27
29
  freetds_ports_dir = File.expand_path(freetds_ports_dir)
28
30
 
29
31
  # Add all the special path searching from the original tiny_tds build
@@ -33,6 +35,23 @@ DIRS = %w(
33
35
  /usr/local
34
36
  )
35
37
 
38
+ if RbConfig::CONFIG['host_os'] =~ /darwin/i
39
+ # Ruby below 2.7 seems to label the host CPU on Apple Silicon as aarch64
40
+ # 2.7 and above print is as ARM64
41
+ target_host_cpu = Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7') ? 'aarch64' : 'arm64'
42
+
43
+ if RbConfig::CONFIG['host_cpu'] == target_host_cpu
44
+ # Homebrew on Apple Silicon installs into /opt/hombrew
45
+ # https://docs.brew.sh/Installation
46
+ # On Intel Macs, it is /usr/local, so no changes necessary to DIRS
47
+ DIRS.unshift("/opt/homebrew")
48
+ end
49
+ end
50
+
51
+ if ENV["RI_DEVKIT"] && ENV["MINGW_PREFIX"] # RubyInstaller Support
52
+ DIRS.unshift(File.join(ENV["RI_DEVKIT"], ENV["MINGW_PREFIX"]))
53
+ end
54
+
36
55
  # Add the ports directory if it exists for local developer builds
37
56
  DIRS.unshift(freetds_ports_dir) if File.directory?(freetds_ports_dir)
38
57
 
@@ -2,7 +2,7 @@
2
2
  ICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || "1.15"
3
3
  ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"
4
4
 
5
- OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1d'
5
+ OPENSSL_VERSION = ENV['TINYTDS_OPENSSL_VERSION'] || '1.1.1s'
6
6
  OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
7
7
 
8
8
  FREETDS_VERSION = ENV['TINYTDS_FREETDS_VERSION'] || "1.1.24"
@@ -584,6 +584,7 @@ void init_tinytds_result() {
584
584
  cDate = rb_const_get(rb_cObject, rb_intern("Date"));
585
585
  /* Define TinyTds::Result */
586
586
  cTinyTdsResult = rb_define_class_under(mTinyTds, "Result", rb_cObject);
587
+ rb_undef_alloc_func(cTinyTdsResult);
587
588
  /* Define TinyTds::Result Public Methods */
588
589
  rb_define_method(cTinyTdsResult, "fields", rb_tinytds_result_fields, 0);
589
590
  rb_define_method(cTinyTdsResult, "each", rb_tinytds_result_each, -1);
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/tiny_tds/gem.rb CHANGED
@@ -20,12 +20,7 @@ module TinyTds
20
20
  end
21
21
 
22
22
  def ports_host
23
- h = RbConfig::CONFIG['host']
24
-
25
- # Our fat binary builds with a i686-w64-mingw32 toolchain
26
- # but ruby for windows x32-mingw32 reports i686-pc-mingw32
27
- # so correct the host here
28
- h.gsub('i686-pc-mingw32', 'i686-w64-mingw32')
23
+ RbConfig::CONFIG["arch"]
29
24
  end
30
25
  end
31
26
  end