From 27c0ecded747872c3b797eeec13fcdfd7d3445b9 Mon Sep 17 00:00:00 2001 From: Kubo Takehiro Date: Wed, 12 Jan 2022 22:15:37 +0900 Subject: [PATCH] Bump up version to 2.2.10 --- NEWS | 15 ++++++++ dist-files | 1 - lib/oci8/version.rb | 2 +- mkpkg-win32.rb | 84 ++++++++++++++++++++++++++------------------- 4 files changed, 64 insertions(+), 38 deletions(-) diff --git a/NEWS b/NEWS index 2ad93e27..5e0c7f33 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,20 @@ # @markup markdown +2.2.10 (2022-01-12) +=================== + +- Use `File.exist?` instead of removed `File.exists?` in Ruby 3.2 (GH-242) + + (contributed by Yasuo Honda) + +- Support ruby 3.1 distributed by rubyinstaller.org + +- Remove code for obsolete platforms + - Ruby compiled by Borland C++ + - macOS released several years ago + +- Detect arm64 macOS shared library in oraconf.rb in preparation for Instant Client for Apple Silicon release. + 2.2.9 (2020-12-30) ================== diff --git a/dist-files b/dist-files index aaafc8d4..a3a8e72b 100644 --- a/dist-files +++ b/dist-files @@ -19,7 +19,6 @@ docs/install-instant-client.md docs/install-on-osx.md docs/ldap-auth-and-function-interposition.md docs/number-type-mapping.md -docs/osx-install-dev-tools.png docs/platform-specific-issues.md docs/report-installation-issue.md docs/timeout-parameters.md diff --git a/lib/oci8/version.rb b/lib/oci8/version.rb index f0a6974a..902e3262 100644 --- a/lib/oci8/version.rb +++ b/lib/oci8/version.rb @@ -1,3 +1,3 @@ class OCI8 - VERSION = "2.2.9" + VERSION = "2.2.10" end diff --git a/mkpkg-win32.rb b/mkpkg-win32.rb index a6efa4e8..8e5b1091 100644 --- a/mkpkg-win32.rb +++ b/mkpkg-win32.rb @@ -4,9 +4,15 @@ (line =~ /VERSION = "([^"]*)"/) && $1 end.compact[0] -case ARGV[0] -when '32' - $platform = 'x86' +$platform = ARGV[0] + +def run_cmd(cmd, raise_on_error = true) + system(cmd) + raise $?.to_s if raise_on_error && $?.to_i != 0 +end + +case $platform +when 'x86-mingw32' $ruby_base_dirs = [] $ruby_base_dirs = @@ -15,11 +21,10 @@ 'c:\ruby\rubyinstaller-2.6.0-1-x86', 'c:\ruby\rubyinstaller-2.7.0-1-x86', 'c:\ruby\rubyinstaller-3.0.0-1-x86', + 'c:\ruby\rubyinstaller-3.1.0-1-x86', ] $oracle_path = 'c:\oracle\instantclient_19_9-win32' - $devkit_tdm_setup = 'c:\ruby\devkit-tdm-32\devkitvars.bat' - $devkit_mingw64_setup = 'c:\ruby\devkit-mingw64-32\devkitvars.bat' $ridk_setup = 'ridk enable' $build_ruby_dirs = @@ -28,12 +33,10 @@ ['c:\ruby\rubyinstaller-2.6.0-1-x86', $ridk_setup], ['c:\ruby\rubyinstaller-2.7.0-1-x86', $ridk_setup], ['c:\ruby\rubyinstaller-3.0.0-1-x86', $ridk_setup], + ['c:\ruby\rubyinstaller-3.1.0-1-x86', $ridk_setup], ] - $cygwin_dir = 'c:\cygwin' - -when '64' - $platform = 'x64' +when 'x64-mingw32' $ruby_base_dirs = [ # RubyInstaller @@ -41,10 +44,10 @@ 'c:\ruby\rubyinstaller-2.6.0-1-x64', 'c:\ruby\rubyinstaller-2.7.0-1-x64', 'c:\ruby\rubyinstaller-3.0.0-1-x64', + 'c:\ruby\rubyinstaller-3.1.0-1-x64', ] $oracle_path = 'c:\oracle\instantclient_19_9-win64' - $devkit_mingw64_setup = 'c:\ruby\devkit-mingw64-64\devkitvars.bat' $ridk_setup = 'ridk enable' $build_ruby_dirs = [ @@ -52,24 +55,43 @@ ['c:\ruby\rubyinstaller-2.6.0-1-x64', $ridk_setup], ['c:\ruby\rubyinstaller-2.7.0-1-x64', $ridk_setup], ['c:\ruby\rubyinstaller-3.0.0-1-x64', $ridk_setup], + ['c:\ruby\rubyinstaller-3.1.0-1-x64', $ridk_setup], + ] + +when 'x64-mingw-ucrt' + $ruby_base_dirs = + [ + # RubyInstaller + 'c:\ruby\rubyinstaller-3.1.0-1-x64', + ] + + $oracle_path = 'c:\oracle\instantclient_19_9-win64' + $ridk_setup = 'ridk enable' + $build_ruby_dirs = + [ + ['c:\ruby\rubyinstaller-3.1.0-1-x64', $ridk_setup], ] - $cygwin_dir = 'c:\cygwin64' when 'all' - FileUtils.cp_r('.', 'c:\build\ruby-oci8-build-64') - FileUtils.cp_r('.', 'c:\build\ruby-oci8-build-32') - Dir.chdir('c:\build\ruby-oci8-build-64') do - system('ruby mkpkg-win32.rb 64') - end - Dir.chdir('c:\build\ruby-oci8-build-32') do - system('ruby mkpkg-win32.rb 32') + files = File.read('dist-files').split("\n") + ['x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt'].each do |platform| + FileUtils.rm_rf platform + files.each do |file| + dest = File.join(platform, file) + FileUtils.mkdir_p File.dirname(dest) + FileUtils.copy(file, dest) + end + Dir.chdir platform do + run_cmd("#{RbConfig.ruby} ../mkpkg-win32.rb #{platform}") + end end + exit 0 else - puts "#{ARGV[0]} (32|64|all)" + puts "#{ARGV[0]} (x86-mingw32|x64-mingw32|x64-mingw-ucrt|all)" exit 0 end -$gem_package = "ruby-oci8-#{$ruby_oci8_version}-#{$platform}-mingw32.gem" +$gem_package = "ruby-oci8-#{$ruby_oci8_version}-#{$platform}.gem" ENV['PATH'] = $oracle_path + ';c:\Windows\System32' def prepend_path(basedir, others = []) @@ -93,11 +115,6 @@ def ruby_oci8_gem_is_installed? false end -def run_cmd(cmd, raise_on_error = true) - system(cmd) - raise $?.to_s if raise_on_error && $?.to_i != 0 -end - def make_gem Dir.glob('ext/oci8/oci8lib_*.so') do |file| File.delete file @@ -132,22 +149,17 @@ def install_and_test raise "ruby-oci8 gem in #{base_dir} could not be uninstalled." end end - run_cmd("gem install ./#{$gem_package} --local") - run_cmd("ruby -I. test/test_all.rb", false) + begin + run_cmd("gem install ./#{$gem_package} --local") + run_cmd("ruby -I. test/test_all.rb", false) + ensure + run_cmd("gem uninstall ruby-oci8 --platform #{$platform}") + end end end end -def test_on_cygwin - prepend_path($cygwin_dir) do - run_cmd("ruby setup.rb config") - run_cmd("ruby setup.rb setup") - run_cmd("ruby -Iext/oci8 -Ilib -I. test/test_all.rb", false) - end -end - make_gem ENV['LOCAL'] ||= '//172.17.0.2/ORCLPDB1' ENV['NLS_LANG'] ||= 'American_America.AL32UTF8' install_and_test -test_on_cygwin