oss-gate / workshop

OSSの開発に未参加または参加したことはあるけどまだ自信がない人を後押しするワークショップ用のリポジトリー
124 stars 547 forks source link

OSS Gate Workshop: PHP Lovers: 2024-01-15: 618knot: puma: Work log #1754

Closed 618knot closed 10 months ago

618knot commented 10 months ago

This is a work log of a "OSS Gate workshop". "OSS Gate workshop" is an activity to increase OSS developers. Here's been discussed in Japanese. Thanks.

作業ログ作成時の説明

以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。

OSS Gate Workshop: ${LOCATION}: ${YEAR}-${MONTH}-${DAY}: ${ACCOUNT_NAME}: ${OSS_NAME}: Work log

タイトル例↓:

OSS Gate Workshop: Tokyo: 2017-01-16: kou: Rabbit: Work log

OSS Gateワークショップ関連情報

618knot commented 10 months ago

rubocopを選んだ https://github.com/rubocop/rubocop

https://github.com/rubocop/rubocop/blob/master/LICENSE.txt MITライセンス

618knot commented 10 months ago

コントリビューティングガイド https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md

618knot commented 10 months ago

wsl(ubuntu)でruby環境を作って、git cloneした

618knot commented 10 months ago

Gemfileのgemを全部インストールしようとした

gem install bundler
bundle install

エラーが出た

Gem::Ext::BuildError: ERROR: Failed to build gem
native extension.

current directory:
/var/lib/gems/3.0.0/gems/bigdecimal-3.1.5/ext/bigdecimal
/usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r
./siteconf20240114-1790-15q76.rb extconf.rb
checking for __builtin_clz()... *** extconf.rb
failed ***
Could not create Makefile due to some reason,
probably lack of necessary
libraries and/or headers.  Check the mkmf.log file
for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME)3.0
/usr/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The
compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/3.0.0/mkmf.rb:597:in `block in
try_compile'
from /usr/lib/ruby/3.0.0/mkmf.rb:546:in
`with_werror'
from /usr/lib/ruby/3.0.0/mkmf.rb:597:in
`try_compile'
        from extconf.rb:6:in `block in have_builtin_func'
from /usr/lib/ruby/3.0.0/mkmf.rb:971:in `block in
checking_for'
from /usr/lib/ruby/3.0.0/mkmf.rb:361:in `block (2
levels) in postpone'
        from /usr/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /usr/lib/ruby/3.0.0/mkmf.rb:361:in `block in
postpone'
        from /usr/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from /usr/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
from /usr/lib/ruby/3.0.0/mkmf.rb:970:in
`checking_for'
        from extconf.rb:5:in `have_builtin_func'
        from extconf.rb:18:in `<main>'

To see why this extension failed to compile, please
check the mkmf.log which can be found here:

/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/bigdecimal-3.1.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/var/lib/gems/3.0.0/gems/bigdecimal-3.1.5 for
inspection.
Results logged to
/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/bigdecimal-3.1.5/gem_make.out

/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:95:in
`run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  /usr/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:161:in
`build_extension'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:195:in
`block in build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:847:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/source/rubygems.rb:205:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:54:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:62:in
`apply_func'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:57:in
`block in process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`loop'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing
bigdecimal (3.1.5), and Bundler cannot continue.

In Gemfile:
  bigdecimal

Gem::Ext::BuildError: ERROR: Failed to build gem
native extension.

current directory:
/var/lib/gems/3.0.0/gems/json-2.7.1/ext/json/ext/generator
/usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r
./siteconf20240114-1790-bv6mvy.rb extconf.rb
creating Makefile

current directory:
/var/lib/gems/3.0.0/gems/json-2.7.1/ext/json/ext/generator
make DESTDIR\= clean
current directory:
/var/lib/gems/3.0.0/gems/json-2.7.1/ext/json/ext/generator
make DESTDIR\=
make failedNo such file or directory - make

Gem files will remain installed in
/var/lib/gems/3.0.0/gems/json-2.7.1 for inspection.
Results logged to
/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/json-2.7.1/gem_make.out

/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:70:in
`rescue in run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:67:in
`run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:44:in
`block in make'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:36:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:36:in
`make'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:63:in
`block in build'
  /usr/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:161:in
`build_extension'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:195:in
`block in build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:847:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/source/rubygems.rb:205:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:54:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:62:in
`apply_func'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:57:in
`block in process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`loop'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing json
(2.7.1), and Bundler cannot continue.

In Gemfile:
rubocop-rspec was resolved to 2.26.1, which
depends on
rubocop-capybara was resolved to 2.20.0, which
depends on
rubocop was resolved to 1.59.0, which depends
on
        json

Gem::Ext::BuildError: ERROR: Failed to build gem
native extension.

current directory:
/var/lib/gems/3.0.0/gems/racc-1.7.3/ext/racc/cparse
/usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r
./siteconf20240114-1790-yhhyew.rb extconf.rb
creating Makefile

current directory:
/var/lib/gems/3.0.0/gems/racc-1.7.3/ext/racc/cparse
make DESTDIR\= clean
current directory:
/var/lib/gems/3.0.0/gems/racc-1.7.3/ext/racc/cparse
make DESTDIR\=
make failedNo such file or directory - make

Gem files will remain installed in
/var/lib/gems/3.0.0/gems/racc-1.7.3 for inspection.
Results logged to
/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/racc-1.7.3/gem_make.out

/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:70:in
`rescue in run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:67:in
`run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:44:in
`block in make'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:36:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:36:in
`make'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:63:in
`block in build'
  /usr/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:161:in
`build_extension'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:195:in
`block in build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:847:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/source/rubygems.rb:205:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:54:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:62:in
`apply_func'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:57:in
`block in process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`loop'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing racc
(1.7.3), and Bundler cannot continue.

In Gemfile:
rubocop-rspec was resolved to 2.26.1, which
depends on
rubocop-capybara was resolved to 2.20.0, which
depends on
rubocop was resolved to 1.59.0, which depends
on
rubocop-ast was resolved to 1.30.0, which
depends on
parser was resolved to 3.3.0.3, which
depends on
            racc

Gem::Ext::BuildError: ERROR: Failed to build gem
native extension.

current directory:
/var/lib/gems/3.0.0/gems/stackprof-0.2.25/ext/stackprof
/usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r
./siteconf20240114-1790-dz62cs.rb extconf.rb
checking for rb_postponed_job_register_one()... ***
extconf.rb failed ***
Could not create Makefile due to some reason,
probably lack of necessary
libraries and/or headers.  Check the mkmf.log file
for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME)3.0
/usr/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The
compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/3.0.0/mkmf.rb:564:in `try_link0'
        from /usr/lib/ruby/3.0.0/mkmf.rb:582:in `try_link'
        from /usr/lib/ruby/3.0.0/mkmf.rb:794:in `try_func'
from /usr/lib/ruby/3.0.0/mkmf.rb:1083:in `block in
have_func'
from /usr/lib/ruby/3.0.0/mkmf.rb:971:in `block in
checking_for'
from /usr/lib/ruby/3.0.0/mkmf.rb:361:in `block (2
levels) in postpone'
        from /usr/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /usr/lib/ruby/3.0.0/mkmf.rb:361:in `block in
postpone'
        from /usr/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from /usr/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
from /usr/lib/ruby/3.0.0/mkmf.rb:970:in
`checking_for'
from /usr/lib/ruby/3.0.0/mkmf.rb:1082:in
`have_func'
        from extconf.rb:8:in `<main>'

To see why this extension failed to compile, please
check the mkmf.log which can be found here:

/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/stackprof-0.2.25/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/var/lib/gems/3.0.0/gems/stackprof-0.2.25 for
inspection.
Results logged to
/var/lib/gems/3.0.0/extensions/x86_64-linux/3.0.0/stackprof-0.2.25/gem_make.out

/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:95:in
`run'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  /usr/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/usr/lib/ruby/vendor_ruby/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:161:in
`build_extension'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:195:in
`block in build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`each'
/usr/lib/ruby/vendor_ruby/rubygems/ext/builder.rb:192:in
`build_extensions'
/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:847:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/source/rubygems.rb:205:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:54:in
`install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:62:in
`apply_func'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:57:in
`block in process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`loop'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`process_queue'
/var/lib/gems/3.0.0/gems/bundler-2.5.4/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing
stackprof (0.2.25), and Bundler cannot continue.

In Gemfile:
  stackprof

今回はとりあえずrspecだけ入れたかったので

gem install rspec

だけした

618knot commented 10 months ago

テスト方法のドキュメントがなくてわかんない

gccやmakeをインストールした後に改めてgemfileのの中身をインストールした

618knot commented 10 months ago

Github Actionsのymlでテストにかかわりそうなコマンド群を発見 https://github.com/rubocop/rubocop/blob/d58940bb6ab5c88dd8b3aa73217cbd0588cfa01d/.github/workflows/rubocop.yml#L100

618knot commented 10 months ago

bundle exec rake spec したらちゃんとテストが走った

image
618knot commented 10 months ago

なんか1個pendingがいるので、どれがpendingになっているのか特定したい

618knot commented 10 months ago

https://github.com/rubocop/rubocop/issues issueを漁る

618knot commented 10 months ago

pumaにしました https://github.com/puma/puma

618knot commented 10 months ago

BSD 3-Clause "New" or "Revised" License https://github.com/puma/puma/blob/master/LICENSE

618knot commented 10 months ago

コントリビューションガイド https://github.com/puma/puma/blob/master/CONTRIBUTING.md

618knot commented 10 months ago

テストが2つ落ちた

Fabulous run in 91.532484s, 6.5332 runs/s, 18.6382 assertions/s.
Errors & Failures:

  1) Failure:
TestIntegrationCluster#test_hot_restart_does_not_drop_connections [test/helpers/integration.rb:490]:
Expected: 1000
  Actual: 999

  2) Failure:
TestIntegrationSingle#test_hot_restart_does_not_drop_connections [test/helpers/integration.rb:482]:
      0 unexpected_response
      1 refused
      0 read timeout
      0 reset
    499 success
    409 success after restart
      3 restart count
Expected no than 0 refused connections.
Expected 0 to be >= 1.

598 runs, 1706 assertions, 2 failures, 0 errors, 41 skips

You have skipped tests. Run with --verbose for details.
rake aborted!
Command failed with status (1)
/var/lib/gems/3.0.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => default => test:all => test
(See full trace by running task with --trace)
618knot commented 10 months ago
    if Puma.windows?
      assert_equal (num_threads * num_requests) - reset - refused, replies[:success]
    else
      assert_equal (num_threads * num_requests), replies[:success]
    end

windows?の分岐周りで落ちているので、windows環境で試す

618knot commented 10 months ago

windowsでコンパイルしようとしたら失敗した bundle exec rake -rdevkit compile

C:\Users\nam21\dev\puma>bundle exec rake -rdevkit compile
rake aborted!
Could not build wrapper using Ragel (it failed or not installed?)
C:/Users/nam21/dev/puma/Rakefile:28:in `rescue in block in <top (required)>'
C:/Users/nam21/dev/puma/Rakefile:25:in `block in <top (required)>'
C:/Users/nam21/.local/share/gem/ruby/3.2.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'

Caused by:
Command failed with status (127): [ragel ext/puma_http11/http11_parser.rl -C -G2 -I ext/puma_http11 -o ext/puma_http11/http11_parser.c]
C:/Users/nam21/dev/puma/Rakefile:26:in `block in <top (required)>'
C:/Users/nam21/.local/share/gem/ruby/3.2.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => compile => compile:x64-mingw-ucrt => compile:puma_http11:x64-mingw-ucrt => copy:puma_http11:x64-mingw-ucrt:3.2.2 => tmp/x64-mingw-ucrt/puma_http11/3.2.2/puma_http11.so => ext/puma_http11/http11_parser.c
(See full trace by running task with --trace)
github-actions[bot] commented 10 months ago

おつかれさまでした!

ワークショップの終了にともないissueを閉じますが、このまま作業メモとして使っても構いません :ok_hand:

ワークショップの感想を集めています!

ブログなどに書かれた際は、このページへリンクの追加をお願いします :pray:

またの参加をお待ちしています!