Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native version doesn't build since version 1.6.6 and Ruby 3.1.4 #411

Closed
sirux88 opened this issue Sep 30, 2023 · 4 comments
Closed

Native version doesn't build since version 1.6.6 and Ruby 3.1.4 #411

sirux88 opened this issue Sep 30, 2023 · 4 comments

Comments

@sirux88
Copy link

sirux88 commented Sep 30, 2023

When trying to use the native version e.g. gem 'sqlite3', force_ruby_platform: true' in gemfile the build is not successfull.

Steps to reproduce:

  • install ruby v3.1.4
  • try to run gem install sqlite3:1.6.6 --platform=ruby

results in

Details

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

    current directory: /home/matthias/PasswordPusher/tmp/bundle/ruby/3.1.0/gems/sqlite3-1.6.6/ext/sqlite3
/usr/local/rvm/rubies/ruby-3.1.4/bin/ruby -I /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
*** 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/local/rvm/rubies/ruby-3.1.4/bin/$(RUBY_BASE_NAME)
        --help
        --download-dependencies
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib
        --enable-system-libraries
        --disable-system-libraries
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib
/usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:455:in `parse_stream': undefined method `parse' for #<Psych::Parser:0x00007f39c70342a8 @handler=#<Psych::Handlers::DocumentStream:0x00007f39c70343c0 @stack=[], @last=nil, @root=nil, @start_line=nil, @start_column=nil,
@end_line=nil, @end_column=nil, @block=#<Proc:0x00007f39c70342f8 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:399>>, @external_encoding=0> (NoMethodError)

      parser.parse yaml, filename
            ^^^^^^
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:399:in `parse'
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:323:in `safe_load'
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:369:in `load'
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:671:in `block in load_file'
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:670:in `open'
        from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/psych.rb:670:in `load_file'
        from extconf.rb:157:in `mini_portile_config'
        from extconf.rb:152:in `sqlite3_config'
        from extconf.rb:136:in `minimal_recipe'
        from extconf.rb:51:in `configure_packaged_libraries'
        from extconf.rb:17:in `configure'
        from extconf.rb:280:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/matthias/PasswordPusher/tmp/bundle/ruby/3.1.0/gems/sqlite3-1.6.6 for inspection.
Results logged to /home/matthias/PasswordPusher/tmp/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/sqlite3-1.6.6/gem_make.out

  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in `run'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:in `build'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in `build_extension'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in `block in build_extensions'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `each'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `build_extensions'
  /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/installer.rb:843:in `build_extensions'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/source/rubygems.rb:202:in `install'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/installer/gem_installer.rb:54:in `install'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/installer/parallel_installer.rb:156:in `do_install'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/worker.rb:62:in `apply_func'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/worker.rb:57:in `block in process_queue'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/worker.rb:54:in `loop'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/worker.rb:54:in `process_queue'
  /usr/local/rvm/gems/ruby-3.1.4/gems/bundler-2.4.18/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing sqlite3 (1.6.6), and Bundler cannot continue.

In Gemfile:
  sqlite3

I did some testing and it seems this is tied to psych version >4.0.x

Two sidemarks:

@flavorjones
Copy link
Member

Hi, @sirux88, thanks for opening this issue. I've reproduced what you're seeing on my development machine. Will spend some time on a fix this week.

@sirux88
Copy link
Author

sirux88 commented Oct 9, 2023

Thanks @flavorjones for investigating on this.

@flavorjones
Copy link
Member

@sirux88 Ah, ok, I figured out what this is.

My advice is to update your system/container to Rubygems 3.4.9 or later to work around this!

Sorry for the inconvenience. I'm planning to get some work in on first-class musl support later this month, you can follow rake-compiler/rake-compiler-dock#75 for the upstream work that #372 is blocked on.

@sirux88
Copy link
Author

sirux88 commented Oct 9, 2023

Thank you @flavorjones for digging into this.

I'll check how to upgrade to rubygems >=3.4.9 and if this is ok on my project

halfbyte added a commit to honeybadger-io/honeybadger-ruby that referenced this issue Jan 25, 2024
joshuap added a commit to honeybadger-io/honeybadger-ruby that referenced this issue Feb 12, 2024
* Implements Honeybadger.event by sync log call

* API changes, add timestamp

* fix #event: Use Hash() and reverse merge order.

* feat: implement simple debug backend endpoint for events (#513)

* Implement simple debug backend endpoint for events

This currently is missing a queue and calls the backend directly from the agent.

Should I implement an events_worker within this PR or in the PR that adds the server backend?

* Refactor signature of events backend to take only one argument

* WIP: Add worker

* WIP start of worker spec

* Worker spec successfully duplicated

* Implement timeout mechanism using separate thread

Given that the worker relies on the Queue as the main scheduling mechanism I saw no other way than to
start a second thread that occasionally throws a message into the queue to check if the timeout is reached.

This seems to work in testing.

* Remove one timeout check, namespace config

* Remove unused code

* Add events worker to agent stop/flush commands

* Fix debug message in events worker

---------

Co-authored-by: Joshua Wood <josh@joshuawood.net>

* Slightly bump sleep values in test to fix jruby tests

There seems to be a slight difference in how sleep works in jruby so the timeouts in the tests did not hit predictably.

* install sqlite dev package for rails tests

* use sudo

* Okay, sqlite problem seems to be based on rubygems issue

sparklemotion/sqlite3-ruby#411

* I have no idea what I'm doing

* feat: http(s) backend implementation for events (#520)

* Implement simple debug backend endpoint for events

This currently is missing a queue and calls the backend directly from the agent.

Should I implement an events_worker within this PR or in the PR that adds the server backend?

* Refactor signature of events backend to take only one argument

* WIP: Add worker

* WIP start of worker spec

* Worker spec successfully duplicated

* Implement timeout mechanism using separate thread

Given that the worker relies on the Queue as the main scheduling mechanism I saw no other way than to
start a second thread that occasionally throws a message into the queue to check if the timeout is reached.

This seems to work in testing.

* Remove one timeout check, namespace config

* Remove unused code

* Add server back end functionality for events

This adds a minimal set of tests to ensure API conformance

I've tested the code manually against "the real thing(tm)"

* Add events worker to agent stop/flush commands

* Fix debug message in events worker

---------

Co-authored-by: Joshua Wood <josh@joshuawood.net>

* Support Hash as first argument to Honeybadger#event (#521)

This enables both signatures:

   # With event type as first argument (recommended):
   Honeybadger.event("user_signed_up", user_id: 123)

   # With just a payload:
   Honeybadger.event(event_type: "user_signed_up", user_id: 123)

* Don't memoize events config

The config is initialized after the agent is created (when the app loads).

* Lazy initialize events worker

This results in less change for current users—if you aren't using
insights, the extra threads don't need to run. We could change this back
in the future.

---------

Co-authored-by: Joshua Wood <josh@joshuawood.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants