serverengine 2.2.4-x86-mingw32 → 2.2.5-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14225458f5959eab0eefdff088da3f289816a4f0e9e871e291edbeb7aa1796df
4
- data.tar.gz: 3932f03c87996232a7a58645a8c77ffb2f57302f49b62c1cd6bfc944ab3e9faa
3
+ metadata.gz: e2bf21c7402ac1749bef9cbd1941165a40112cb2875efe533b1a862b425d76f0
4
+ data.tar.gz: a603493e2e261de52879964a871a240499c9f8131c9f30ee78e3cd836a8484e5
5
5
  SHA512:
6
- metadata.gz: 6db094c6723490b9f4fba7d62bc70a52239aa22f4b9ac3f598d2b734d70052b27460be326283be3f84107127749cf2ed957e1a6f6ad8b0a7cfe731103cc2531c
7
- data.tar.gz: 2982698d8a5762b8305f20d92f4e0d8766db9ee735a33a6a3b01c192414fd9a5f9492176e26afab848d9a986d35827cf4a84c14850f7094a69323b860d32bf60
6
+ metadata.gz: 5b5f80147a36a3089001dd07ddb680506a15f173d526202355451f8a10eb897bb942f74056093a1ecad4191b67c49cf0ce20c1c0998ceeb3729344f6bc0f7953
7
+ data.tar.gz: fa756ba5653d68631b8b6aaaf279e996fa7e3d1786ddd5f8c87bdae9f89dfd4519a0713aba73708de87afaa833b9187f5a779fa1fd6c907e5a79ef1b4ca40f6e
@@ -1,26 +1,31 @@
1
1
  name: Testing on Ubuntu
2
2
  on:
3
- - push
4
- - pull_request
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+
5
8
  jobs:
6
- build:
9
+ test:
7
10
  runs-on: ${{ matrix.os }}
8
11
  strategy:
9
12
  fail-fast: false
10
13
  matrix:
11
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
14
+ ruby: [ '3.1', '3.0', '2.7', '2.6' ]
12
15
  os:
13
16
  - ubuntu-latest
14
- name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
17
+ name: Unit testing with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
15
18
  steps:
16
- - uses: actions/checkout@v2
17
- - uses: ruby/setup-ruby@v1
18
- with:
19
- ruby-version: ${{ matrix.ruby }}
20
- - name: unit testing
21
- env:
22
- CI: true
23
- run: |
24
- gem install bundler rake
25
- bundle install --jobs 4 --retry 3
26
- bundle exec rake spec
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - name: Install dependencies
25
+ run: |
26
+ gem install bundler rake
27
+ bundle install --jobs 4 --retry 3
28
+ - name: Run tests
29
+ env:
30
+ CI: true
31
+ run: bundle exec rake spec
@@ -0,0 +1,42 @@
1
+ name: Testing on Windows
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [ '3.1', '2.7', '2.6' ]
15
+ os:
16
+ - windows-latest
17
+ include:
18
+ - ruby: '3.0.3'
19
+ os: windows-latest
20
+ # On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
21
+ # error code. In addition, we have to specify the path of fiddle by RUBYLIB
22
+ # because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
23
+ # See also:
24
+ # * https://github.com/ruby/fiddle/issues/72
25
+ # * https://bugs.ruby-lang.org/issues/17813
26
+ # * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
27
+ ruby-lib-opt: RUBYLIB=%RUNNER_TOOL_CACHE%/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/fiddle-1.1.0/lib
28
+
29
+ name: Unit testing with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ - name: Add Fiddle 1.1.0
37
+ if: ${{ matrix.ruby == '3.0.3' }}
38
+ run: gem install fiddle --version 1.1.0
39
+ - name: Install dependencies
40
+ run: ridk exec bundle install --jobs 4 --retry 3
41
+ - name: Run tests
42
+ run: bundle exec rake spec ${{ matrix.ruby-lib-opt }}
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 2022-01-13 version 2.2.5:
2
+
3
+ * Fix DLL load error on Ruby 3.1 on Windows
4
+
1
5
  2021-05-24 version 2.2.4:
2
6
 
3
7
  * Ensure to get correct Win32 socket error on Ruby 3.0
@@ -142,7 +142,11 @@ module ServerEngine
142
142
  return false unless @pmon
143
143
 
144
144
  if stat = @pmon.try_join
145
- @worker.logger.info "Worker #{@wid} finished#{@stop ? '' : ' unexpectedly'} with #{ServerEngine.format_join_status(stat)}"
145
+ if @stop
146
+ @worker.logger.info "Worker #{@wid} finished with #{ServerEngine.format_join_status(stat)}"
147
+ else
148
+ @worker.logger.error "Worker #{@wid} finished unexpectedly with #{ServerEngine.format_join_status(stat)}"
149
+ end
146
150
  if stat.is_a?(Process::Status) && stat.exited? && @unrecoverable_exit_codes.include?(stat.exitstatus)
147
151
  @unrecoverable_exit = true
148
152
  @exitstatus = stat.exitstatus
@@ -1,3 +1,3 @@
1
1
  module ServerEngine
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  end
@@ -21,6 +21,7 @@ module ServerEngine
21
21
  require 'fiddle/import'
22
22
  require 'fiddle/types'
23
23
  require 'socket'
24
+ require 'rbconfig'
24
25
 
25
26
  extend Fiddle::Importer
26
27
 
@@ -101,14 +102,7 @@ module ServerEngine
101
102
  extern "int GetModuleFileNameA(int, char *, int)"
102
103
  extern "int CloseHandle(int)"
103
104
 
104
- ruby_bin_path_buf = Fiddle::Pointer.malloc(1000)
105
- GetModuleFileNameA(0, ruby_bin_path_buf, ruby_bin_path_buf.size)
106
-
107
- ruby_bin_path = ruby_bin_path_buf.to_s.gsub(/\\/, '/')
108
- ruby_dll_paths = File.dirname(ruby_bin_path) + '/*msvcr*ruby*.dll'
109
- ruby_dll_path = Dir.glob(ruby_dll_paths).first
110
- dlload ruby_dll_path
111
-
105
+ dlload RbConfig::CONFIG['LIBRUBY_SO']
112
106
  extern "int rb_w32_map_errno(int)"
113
107
 
114
108
  def self.raise_last_error(name)
@@ -197,7 +197,13 @@ describe ServerEngine::Supervisor do
197
197
  t.join
198
198
  end
199
199
 
200
- test_state(:worker_run).should == 3
200
+ if ServerEngine.windows?
201
+ # Because launching a process on Windows is high cost,
202
+ # it doesn't often reach to 3.
203
+ test_state(:worker_run).should <= 3
204
+ else
205
+ test_state(:worker_run).should == 3
206
+ end
201
207
  end
202
208
  end
203
209
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sigdump
@@ -102,6 +102,7 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".github/workflows/linux.yml"
105
+ - ".github/workflows/windows.yml"
105
106
  - ".gitignore"
106
107
  - ".rspec"
107
108
  - Changelog
@@ -110,7 +111,6 @@ files:
110
111
  - NOTICE
111
112
  - README.md
112
113
  - Rakefile
113
- - appveyor.yml
114
114
  - examples/server.rb
115
115
  - examples/spawn_worker_script.rb
116
116
  - lib/serverengine.rb
data/appveyor.yml DELETED
@@ -1,35 +0,0 @@
1
- ---
2
- image: Visual Studio 2019
3
-
4
- install:
5
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
6
- - ruby --version
7
- - gem --version
8
- - bundle install
9
- build: off
10
- test_script:
11
- - bundle exec rake spec
12
-
13
- environment:
14
- matrix:
15
- - ruby_version: "30-x64"
16
- - ruby_version: "27-x64"
17
- - ruby_version: "26-x64"
18
- - ruby_version: "25-x64"
19
-
20
- # On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
21
- # error code. In addition, we have to specify the path of fiddle by RUBYLIB
22
- # because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
23
- # See also:
24
- # * https://github.com/ruby/fiddle/issues/72
25
- # * https://bugs.ruby-lang.org/issues/17813
26
- # * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
27
- for:
28
- -
29
- matrix:
30
- only:
31
- - ruby_version: "30-x64"
32
- test_script:
33
- - gem install fiddle --version 1.0.8
34
- - set RUBYLIB=C:/Ruby%ruby_version%/lib/ruby/gems/3.0.0/gems/fiddle-1.0.8/lib
35
- - bundle exec rake spec