Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mman.h for Windows compatibility #58

Closed
wants to merge 1 commit into from

Conversation

N-V-R
Copy link

@N-V-R N-V-R commented Jul 1, 2016

When I do 'gem install scrypt' on Windows 7, there is an error:

ERROR: Error installing scrypt:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby/lib/ruby/gems/2.3.0/gems/scrypt-3.0.0/ext/scrypt
C:/Ruby/bin/ruby.exe -rubygems C:/Ruby/lib/ruby/gems/2.3.0/gems/rake-11.2.2/exe/rake RUBYARCHDIR=C:/Ruby/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/scrypt-3.0.0 RUBYLIBDIR=C:/Ruby/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/scrypt-3.0.0
mkdir -p i386-windows
gcc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -Wall -std=c99 -msse -msse2 -D_GNU_SOURCE=1 -fPIC  -o i386-windows/crypto_scrypt.o -c ./crypto_scrypt.c
./crypto_scrypt.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
./crypto_scrypt.c:32:22: fatal error: sys/mman.h: No such file or directory compilation terminated.
rake aborted!
Command failed with status (1): [gcc -fexceptions -O -fno-omit-frame-pointe...]

Tasks: TOP => default => i386-windows/scrypt_ext.dll => i386-windows/crypto_scrypt.o
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in C:/Ruby/lib/ruby/gems/2.3.0/gems/scrypt-3.0.0 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/scrypt-3.0.0/gem_make.out

So, I added a mman.h to fix (source: https://github.com/witwall/mman-win32).

Note: actually there is another error on Windows, with ffi gem (LoadError: cannot load such file -- ffi_c). You can fix it by gem uninstall ffi -I && gem install ffi --platform=ruby.

@stakach
Copy link
Collaborator

stakach commented Jul 6, 2016

I haven't cut the GEM yet as whilst I am now a core member of the FFI team I'm waiting on the original owner of ffi-compiler to add me to the rubygems project.
The release should be out in a couple of days at most.

@stakach
Copy link
Collaborator

stakach commented Jul 7, 2016

@N-V-R OK the new release 3.0.1 is cut. Could you please test?

@N-V-R
Copy link
Author

N-V-R commented Jul 7, 2016

Now everything is fine (with preinstalled ffi: gem install ffi --platform=ruby). Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants