Closed ankane closed 5 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
lib/argon2/ffi_engine.rb | 2 | 3 | 66.67% | ||
<!-- | Total: | 2 | 3 | 66.67% | --> |
Totals | |
---|---|
Change from base Build 150: | -0.5% |
Covered Lines: | 192 |
Relevant Lines: | 193 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
lib/argon2/ffi_engine.rb | 2 | 3 | 66.67% | ||
<!-- | Total: | 2 | 3 | 66.67% | --> |
Totals | |
---|---|
Change from base Build 150: | -0.5% |
Covered Lines: | 192 |
Relevant Lines: | 193 |
Totals | |
---|---|
Change from base Build 150: | 0.0% |
Covered Lines: | 191 |
Relevant Lines: | 191 |
There may be a cleaner way to do this, but the basic problem is:
FFI::Compiler::Platform.system.map_library_name("argon2_wrap")
returns libargon2_wrap.bundle
on Mac and argon2_wrap.dll
on Windows, and libargon2_wrap.dll
is the actual file created on Windows. It sounds like this approach worked for @xlavoie as well - see https://github.com/technion/ruby-argon2/issues/1#issuecomment-483792500
Could also change the name of the compiled file, like: https://github.com/technion/ruby-argon2/commit/59477048f52de01ffd7e5f48c397931a85df0236
I'll take this as it appears to be a simple and small patch, but I want to be clear I'm not officially supporting Windows.
Thanks @technion
fwiw, I was also able to get AppVeyor passing: https://ci.appveyor.com/project/ankane/ruby-argon2
Great. I noticed jRuby apparently broke.. but it's not this commit. I'll look at some travis fixes that address both of those.
Hi @technion, the library compiles on Windows with RubyInstaller's Devkit (found this when looking at how the bcrypt gem works on Windows), but it can't find the path to the DLL. This fixes it.
Tested on Windows 10.