boazsegev / iodine

iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
MIT License
912 stars 51 forks source link

Master does not bundle install #116

Closed graywolf-at-work closed 2 years ago

graywolf-at-work commented 2 years ago

Description

I cannot bundle install locally for development. Ruby 3.0.2.

6044542c95da:~/iodine$ bundle install
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Fetching rake 12.3.3
Installing rake 12.3.3
Using bundler 2.2.31
Using iodine 0.7.44 from source at `.` and installing its executables
Fetching numerizer 0.1.1
Fetching unf_ext 0.0.8
Fetching public_suffix 4.0.6
Fetching diff-lcs 1.4.4
Fetching ffi 1.15.4
Fetching http-form_data 2.3.0
Fetching coderay 1.1.3
Fetching method_source 1.0.0
Installing numerizer 0.1.1
Installing http-form_data 2.3.0
Installing method_source 1.0.0
Installing diff-lcs 1.4.4
Installing public_suffix 4.0.6
Fetching minitest 5.14.4
Installing coderay 1.1.3
Fetching rack 2.2.3
Installing minitest 5.14.4
Fetching rake-compiler 1.1.1
Installing unf_ext 0.0.8 with native extensions
Installing rack 2.2.3
Fetching rspec-support 3.10.3
Installing rake-compiler 1.1.1
Fetching chronic_duration 0.10.6
Fetching addressable 2.8.0
Installing rspec-support 3.10.3
Installing chronic_duration 0.10.6
Fetching pry 0.14.1
Installing addressable 2.8.0
Fetching spec 5.3.4
Installing ffi 1.15.4 with native extensions
Installing spec 5.3.4
Fetching rspec-core 3.10.1
Fetching rspec-expectations 3.10.1
Installing pry 0.14.1
Fetching rspec-mocks 3.10.2
Installing rspec-expectations 3.10.1
Installing rspec-core 3.10.1
Installing rspec-mocks 3.10.2
Fetching rspec 3.10.0
Installing rspec 3.10.0
Fetching unf 0.1.4
Installing unf 0.1.4
Fetching domain_name 0.5.20190701
Installing domain_name 0.5.20190701
Fetching http-cookie 1.0.4
Installing http-cookie 1.0.4
Fetching ffi-compiler 1.0.1
Installing ffi-compiler 1.0.1
Fetching http-parser 1.2.3
Installing http-parser 1.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/builder/iodine/.bundle/vendor/ruby/3.0.0/gems/http-parser-1.2.3/ext
/usr/bin/ruby -I/usr/lib/ruby/3.0.0 -rrubygems /home/builder/iodine/.bundle/vendor/ruby/3.0.0/gems/rake-12.3.3/exe/rake
RUBYARCHDIR\=/home/builder/iodine/.bundle/vendor/ruby/3.0.0/extensions/x86_64-linux-musl/3.0.0/http-parser-1.2.3
RUBYLIBDIR\=/home/builder/iodine/.bundle/vendor/ruby/3.0.0/extensions/x86_64-linux-musl/3.0.0/http-parser-1.2.3
rake aborted!
ArgumentError: wrong number of arguments (given 2, expected 1)
/home/builder/iodine/.bundle/vendor/ruby/3.0.0/gems/rake-12.3.3/exe/rake:27:in `<main>'
Tasks: TOP => default => x86_64-linux/libhttp-parser-ext.so => x86_64-linux/http-parser/http_parser.o => x86_64-linux/http-parser
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in /home/builder/iodine/.bundle/vendor/ruby/3.0.0/gems/http-parser-1.2.3 for inspection.
Results logged to /home/builder/iodine/.bundle/vendor/ruby/3.0.0/extensions/x86_64-linux-musl/3.0.0/http-parser-1.2.3/gem_make.out

  /usr/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in `run'
  /usr/lib/ruby/3.0.0/rubygems/ext/rake_builder.rb:28:in `build'
  /usr/lib/ruby/3.0.0/rubygems/ext/builder.rb:159:in `build_extension'
  /usr/lib/ruby/3.0.0/rubygems/ext/builder.rb:193:in `block in build_extensions'
  /usr/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `each'
  /usr/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `build_extensions'
  /usr/lib/ruby/3.0.0/rubygems/installer.rb:845:in `build_extensions'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/source/rubygems.rb:200:in `install'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:54:in `install'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/worker.rb:62:in `apply_func'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/worker.rb:57:in `block in process_queue'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/worker.rb:54:in `loop'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/worker.rb:54:in `process_queue'
  /usr/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing http-parser (1.2.3), and Bundler cannot continue.

In Gemfile:
  http was resolved to 4.4.1, which depends on
    http-parser

Upgrading rake to 13 major in iodine.gemspec fixes the installation. Would probably deserve a patch release, since current "stable" (0.7.44) does not install.

graywolf-at-work commented 2 years ago

My local patch to get this working:

diff --git a/iodine.gemspec b/iodine.gemspec
index 5eaadd1..d3d3170 100644
--- a/iodine.gemspec
+++ b/iodine.gemspec
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
   spec.requirements << 'TLS requires OpenSSL >= 1.1.0'

   # spec.add_development_dependency 'bundler', '>= 1.10', '< 2.0'
-  spec.add_development_dependency 'rake', '~> 12.0', '< 13.0'
+  spec.add_development_dependency 'rake', '>= 12.0', '< 14.0'
   spec.add_development_dependency 'minitest', '>=5', '< 6.0'
   spec.add_development_dependency 'rspec', '>=3.9.0', '< 4.0'
   spec.add_development_dependency 'spec', '>=5.3.0', '< 6.0'
boazsegev commented 2 years ago

Thanks!

I cannot reproduce on my macOS machine, but it might be OS specific (I'm also still using Ruby 3.0.0).

I'll push the update anyway, I don't think we use rake all that much and I don't think anything is broken with rake 13...

...but just so we're clear - iodine does not require http-parser, so it's more of a compatibility issue with other gems than an actual iodine issue.

πŸ‘πŸ»πŸ‘πŸ»πŸ‘πŸ»

graywolf-at-work commented 2 years ago

I've left a comment on the commit in question.