ankane / argon2-kdf Goto Github PK
View Code? Open in Web Editor NEWArgon2 key derivation for Ruby
License: MIT License
Argon2 key derivation for Ruby
License: MIT License
Hi @ankane ! Thank you for your awesome work on this project (blind_index is amazing!)
Currently, this repo only bundles the Mac x86 version of the dylib for argon instead of including an arm64 build. This means when run on a new Mac computer, the following happens:
Fiddle::DLError:
dlopen(/Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib, 9): no suitable image found. Did find:
/Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib: mach-o, but wrong architecture
/Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib: mach-o, but wrong architecture
Having this issue with macOS High Sierra version 10.13.4 (17E199).
Installed blind_index
gem (version 2.0.1) which has a dependency with this gem. The following error message is given while trying to run rails db:seed
:
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from:
/Users/santiagollapur/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/argon2-kdf-0.1.2/vendor/libargon2.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ____chkstk_darwin
Referenced from:
/Users/santiagollapur/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/argon2-kdf-0.1.2/vendor/libargon2.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
[1] 4807 abort rails db:seed
has_argon2_password
I'm getting the error argon2-kdf-0.1.4/vendor/libargon2.dylib, 9): no suitable image found
on new MacBook Pro with M1 chip:
Fiddle::DLError: dlopen(/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib, 9): no suitable image found. Did find:
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib: mach-o, but wrong architecture
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib: mach-o, but wrong architecture
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:8:in `<module:FFI>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:3:in `<module:KDF>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:2:in `<module:Argon2>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:1:in `<main>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf.rb:49:in `kdf'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf.rb:40:in `argon2id'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/blind_index-2.2.0/lib/blind_index.rb:68:in `generate_bidx'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/blind_index-2.2.0/lib/blind_index/extensions.rb:42:in `build'
Is there a known problem with blind_index
on M1 chips? Or do you think something else is causing this error?
I am using blind_index
gem to enforce uniqueness of the email field on the users
table but it seems like blind_index
cannot find the shared object file even if the file is there, any idea on how to fix this?
Here is the error:
irb(main):008:0> user = User.create(email: '[email protected]')
Traceback (most recent call last):
1: from (irb):8
Fiddle::DLError (/usr/local/bundle/gems/argon2-kdf-0.1.5/vendor/libargon2.so: cannot open shared object file: No such file or directory)
But the file is there:
irb(main):009:0> Dir.entries('/usr/local/bundle/gems/argon2-kdf-0.1.5/vendor')
=> ["LICENSE", "..", "libargon2.dylib", "argon2.dll", "libargon2.so", ".", "libargon2.arm64.dylib"]
Also, I have access to it (also tried to touch
it and it works):
marco@3846cfe592f3:/app$ ls -l /usr/local/bundle/gems/argon2-kdf-0.1.5/vendor/
total 396
-rw-r--r-- 1 marco marco 17879 Mar 9 15:03 LICENSE
-rw-r--r-- 1 marco marco 32768 Mar 9 15:03 argon2.dll
-rw-r--r-- 1 marco marco 87486 Mar 9 15:03 libargon2.arm64.dylib
-rw-r--r-- 1 marco marco 46340 Mar 9 15:03 libargon2.dylib
-rw-r--r-- 1 marco marco 212664 Mar 9 15:08 libargon2.so
I am developing in Docker, my container is the standard ruby:2.7.1
. Some more details:
irb(main):010:0> RbConfig::CONFIG["arch"]
=> "aarch64-linux"
irb(main):011:0> RbConfig::CONFIG["host_cpu"]
=> "aarch64"
irb(main):012:0> Gem::Platform.local
=> #<Gem::Platform:0x0000aaab1ad90f38 @cpu="aarch64", @os="linux", @version=nil @cpu="aarch64", @os="linux", @version=nil>
irb(main):013:0> Gem::Platform.local.to_s
=> "aarch64-linux"
Thank you for all the help and your wonderful gems @ankane!
EDIT: This could be because I am on a Mac M1?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.