Code Monkey home page Code Monkey logo

Comments (13)

technion avatar technion commented on August 15, 2024

Hi Thomvil.

Thank you for reporting this error. I've been trying to investigate what may have occurred here.

As you can see from Travis, the gem currently loads and runs in the environments I've been testing with. I also ran and tested from a different machine.

$ gem install argon2
Building native extensions.  This could take a while...
Successfully installed argon2-0.1.0

Can you try running the install, and ensure you see the above? The argon2_wrap function is a component of the native extensions, and if it fails to build, you'll see what you're seeing.

Assuming you can get past that, I haven't identified any issue with running the gem.

2.2.3 :001 > require 'argon2'
 => true
2.2.3 :002 > hasher = Argon2::Password.new(t_cost: 2, m_cost: 16)
 => #<Argon2::Password:0x00559a898de838 @t_cost=2, @m_cost=16, @salt="\xF5\x8FQP\x1CG\xA5\x85\x9E(<\x83\x99D\x81\xE7", @secret=nil>
2.2.3 :003 > hasher.hash("password")
 => "$argon2i$m=65536,t=2,p=1$9Y9RUBxHpYWeKDyDmUSB5w$sXszJXDoh7PmLSqxIl6xs+4e0D2y5Hjyp+P8lsoHGMo"

What OS are you running?

from ruby-argon2.

technion avatar technion commented on August 15, 2024

If the above doesn't leave any clues, can you please try building the gem extensions manually and see how we go.

$ git clone https://github.com/technion/ruby-argon2.git
Cloning into 'ruby-argon2'...
$ cd ruby-argon2
$ git submodule update --init --recursive
$ cd ext/argon2_wrap/
$ make && make test
$ cd ../../
$ bundle install
$ rake test

from ruby-argon2.

technion avatar technion commented on August 15, 2024

@thomvil Since you haven't responded I'm down to guess work, but I have noted that if you happen to be on a system that does not have gcc installed (many Mac users only have clang installed) you may have noted a failure to compile in the above steps.

I've pushed version 0.1.1 as a fix for this issue and will close this ticket based as "assumed fixed", please let me know if this is not the case.

from ruby-argon2.

thomvil avatar thomvil commented on August 15, 2024

thank you for the suggestion.

make test actually fails for me

clang -pthread -O3 -fsanitize=address -fsanitize=undefined -Wall -g ../phc-winner-argon2/src/argon2.c ../phc-winner-argon2/src/core.c ../phc-winner-argon2/src/blake2/blake2b.c ../phc-winner-argon2/src/thread.c ../phc-winner-argon2/src/encoding.c argon_wrap.c ../phc-winner-argon2/src/opt.c test.c -o tests
clang: error: unsupported argument 'undefined' to option 'fsanitize='
make: *** [test] Error 1

the compilation however completes without failure.

The compilation also completes during the gem installation process. The directory ~/.rvm/gems/ruby-2.2.1/gems/argon2-0.1.1/ext/argon2_wrap contains both libargon2_wrap.so and libargon2_wrap.so.dSYM


rake test fails for me.

/Users/me/.rvm/gems/ruby-2.2.1/gems/ffi-compiler-0.1.3/lib/ffi-compiler/loader.rb:21:in `find': cannot find 'argon2_wrap' library (LoadError)
    from /Users/me/workspace/ruby-argon2/lib/argon2/ffi_engine.rb:8:in `<module:Ext>'
    from /Users/me/workspace/ruby-argon2/lib/argon2/ffi_engine.rb:6:in `<module:Argon2>'
    from /Users/me/workspace/ruby-argon2/lib/argon2/ffi_engine.rb:4:in `<top (required)>'
    from /Users/me/workspace/ruby-argon2/lib/argon2.rb:2:in `require'
    from /Users/me/workspace/ruby-argon2/lib/argon2.rb:2:in `<top (required)>'
    from /Users/me/workspace/ruby-argon2/test/test_helper.rb:6:in `require'
    from /Users/me/workspace/ruby-argon2/test/test_helper.rb:6:in `<top (required)>'
    from /Users/me/workspace/ruby-argon2/test/api_test.rb:1:in `require'
    from /Users/me/workspace/ruby-argon2/test/api_test.rb:1:in `<top (required)>'
    from /Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_test_loader.rb:15:in `require'
    from /Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_test_loader.rb:15:in `block in <main>'
    from /Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `select'
    from /Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:test:lib" -I"/Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0" "/Users/me/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_test_loader.rb" "test/api_test.rb" "test/engine_test.rb" "test/error_test.rb" "test/key_test.rb" "test/low_level_test.rb" "test/rubycheck_test.rb" "test/util_test.rb" ]
/Users/me/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/Users/me/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

from ruby-argon2.

technion avatar technion commented on August 15, 2024

"make test" failures only demonstrate that your compiler doesn't support the tests. I don't think that's an issue.

What is an issue is that you've confirmed the relevant file is being created, but on your system, it's just not getting found.

What OS are you running?

from ruby-argon2.

thomvil avatar thomvil commented on August 15, 2024

osx 10.11.1

from ruby-argon2.

technion avatar technion commented on August 15, 2024

@thomvil I have a suspicion b7bf0cf will be relevant here.

Can you pull the latest source and try the above process again? I understand OSX doesn't use the same file extensions Linux does - but I don't have an OSX machine around to test with. This recent commit changes the extension.

If that works I'll tag a new release.

from ruby-argon2.

thomvil avatar thomvil commented on August 15, 2024

no this doesn't work

from ruby-argon2.

technion avatar technion commented on August 15, 2024

@thomvil Unfortunately this seems to be documented as an issue for several gems at the moment:

http://cgarvey.ie/archive/2015/10/01/mysql-client-library-issues-on-os-x-el-capitan/
jordansissel/fpm#1010

Not having a Mac - this is proving difficult.

from ruby-argon2.

thomvil avatar thomvil commented on August 15, 2024

oh that's unfortunate. Thank you for identifying the problem.

from ruby-argon2.

technion avatar technion commented on August 15, 2024

There is a branch here that is working on the issue: ffi/ffi#461

from ruby-argon2.

technion avatar technion commented on August 15, 2024

The Jekyll team have documented their workaround for the same issue here:

http://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011

from ruby-argon2.

xlavoie avatar xlavoie commented on August 15, 2024

I had this same problem but being on Windows 10 using RubyInstaller 2.5.3-1 I could not apply the workaround above.

I managed to fix the issue by replacing line 7 in lib/argon2/ffi_engine.rb from:
ffi_lib FFI::Compiler::Loader.find('argon2_wrap')
to:
ffi_lib FFI::Compiler::Loader.find('libargon2_wrap')

Hope this can help someone out!

from ruby-argon2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.