pbhogan / scrypt

A Ruby gem with native C extension for the scrypt password hashing algorithm.
https://github.com/pbhogan/scrypt
Other
260 stars 63 forks source link

Ruby 3 support #85

Closed Murphydbuffalo closed 2 months ago

Murphydbuffalo commented 2 years ago

Hi @pbhogan , is this project still maintained?

If so, are there plans to support Ruby 3?

Thanks!

pbhogan commented 2 years ago

I'm not the maintainer anymore. That was taken over by @johanns, @stakach and @tarcieri at various times. Not sure who is still actively working on it. Hopefully, one of them can comment on your query.

stakach commented 2 years ago

we ported our software over to crystal lang so not actively maintaining anymore either

Murphydbuffalo commented 2 years ago

Got it, thanks for the info!

johanns commented 2 years ago

I can continue to support and maintain.

@Murphydbuffalo Is there a specific issue with Ruby 3?

la-ruby commented 2 years ago

I think it has issues with ruby 3:

remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        current directory:
remote:        /tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/gems/scrypt-3.0.7/ext/scrypt
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/bin/ruby
remote:        -I/tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0 -rrubygem
remote:        /tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/gems/rake-10.5.0/bin/rake
remote:        RUBYARCHDIR\=/tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/scrypt-3.0.7
remote:        RUBYLIBDIR\=/tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/scrypt-3.0.7
remote:        rake aborted!
remote:        ArgumentError: wrong number of arguments (given 2, expected 1)
remote:        
remote:        Tasks: TOP => default => x86_64-linux/libscrypt_ext.so =>
remote:        x86_64-linux/crypto_scrypt.o => x86_64-linux
remote:        (See full trace by running task with --trace)
remote:        
remote:        rake failed, exit code 1
remote:        
remote:        Gem files will remain installed in
remote:        /tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/gems/scrypt-3.0.7 for inspection.
remote:        Results logged to
remote:        /tmp/build_2091c4bc/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/scrypt-3.0.7/gem_make.out
remote:        
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in
remote:        `run'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/rake_builder.rb:28:in
remote:        `build'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in
remote:        `build_extension'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in
remote:        `block in build_extensions'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
remote:        `each'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
remote:        `build_extensions'
remote:        /tmp/build_2091c4bc/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/installer.rb:853:in
skull-squadron commented 1 year ago

Anecdotally, I can't repro on either CentOS 8 Linux x86_64 or macOS 12.6 + MRI 3.1.2. Works great. Also, as long as no sec vulns have popped up, lack of churn doesn't imply lack of functionality. Functionality of code doesn't evaporate with time if nothing changes.

gthank commented 1 year ago

I'm on macOS Ventura (13.1) - arm64-darwin/aarch64-darwin

If I attempt to install via bundler (I just run bundle install in my project), it fails with the same error above:

ArgumentError: wrong number of arguments (given 2, expected 1)```

This happens with both Ruby 3.0.5 and 3.1.3.

If I just attempt to install via gem install scrypt -v '3.0.7' --source 'https://rubygems.org/', it succeeds (quite quickly, in fact).

$ gem install scrypt -v '3.0.7' --source 'https://rubygems.org/'
Fetching scrypt-3.0.7.gem
Building native extensions. This could take a while...
Successfully installed scrypt-3.0.7
Parsing documentation for scrypt-3.0.7
Installing ri documentation for scrypt-3.0.7
Done installing documentation for scrypt after 0 seconds
1 gem installed

So far, I haven't had much luck getting more detailed information out of the bundler failure.

Murphydbuffalo commented 1 year ago

Hi @johanns , sorry for the radio silence. I had stopped following this thread after our Ruby 3 upgrade was deprioritized. We're picking that work back up now and I am seeing the same error as @gthank and @la-ruby on my M1/ARM macbook.

Will let you know if I make any progress on getting the install to work.

Murphydbuffalo commented 1 year ago

OK I think the issue was the version of Rake I was using. Just like @gthank , I was able to successfully run gem install scrypt on my M1/ARM machine, but I was not able to get the install of the same scrypt version to succeed when running bundle install.

My system install of rake is using the latest, 13.06.

But my rails application has a couple dependencies that required a rake version less than 13. When I upgraded those dependencies I was able to install the latest version of rake, at which point the scrypt install succeeded.

cc @johanns @la-ruby

sbounmy commented 10 months ago

I confirm @Murphydbuffalo . I was on rake 12.X. Now with rake 13.0.6 it works

I changed another gem's dependency (cryptocoin_payable)

spec.add_development_dependency 'rake', '~> 13'

ilvez commented 4 months ago

Was working with Ruby 3.3 and could not build the project, so did those small changes and now project builds without errors. PR: https://github.com/pbhogan/scrypt/pull/88