Comments (13)
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.
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.
@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.
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.
"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.
osx 10.11.1
from ruby-argon2.
@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.
no this doesn't work
from ruby-argon2.
@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.
oh that's unfortunate. Thank you for identifying the problem.
from ruby-argon2.
There is a branch here that is working on the issue: ffi/ffi#461
from ruby-argon2.
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.
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)
- Argon2id binding HOT 17
- Gem fails to build under FreeBSD 12.0 HOT 8
- Unsigned RubyGem HOT 3
- Required Ruby Version unclear based on gemspec HOT 4
- Rubocop issues HOT 2
- Incompatible with other versions of Argon2 HOT 1
- RubyGems and Github naming mismatch HOT 2
- Allow providing parallelism cost parameter HOT 4
- Error when attempting to use fork HOT 12
- legacy.rb test unused and in broken state HOT 2
- Github Org for improved SEO HOT 2
- Unable to install latest on master via Bundler HOT 2
- :salt_do_not_supply option renamed HOT 4
- Fails to load with Rubygems 3.4 HOT 36
- RBS issue - Cannot find type `FFI::Library` HOT 1
- Memory cost definition HOT 2
- Incorrect initialization checks: `ARGON2_MEMORY_TOO_LITTLE` raised when m_cost < 3 HOT 1
- Cannot specify memory costs that aren't `2^N` HOT 2
- Default argon2.online builds a hash which ruby_argon2 cant verify HOT 1
- Add OWASP recommendations as additional profiles? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-argon2.