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

Configuring a Windows Environment - make #145

Open
PerrigoGames opened this issue Dec 15, 2017 · 7 comments
Open

Configuring a Windows Environment - make #145

PerrigoGames opened this issue Dec 15, 2017 · 7 comments

Comments

@PerrigoGames
Copy link

So I'm understanding how the gem works, and I can get to the point where I'm generating a Makefile, and everything looks okay, but make for whatever reason isn't playing nicely with rake.

Background, I'm using Ruby 2.4.2 for Windows and GnuWin32 for make. I have msys32 as well. I'm not using a MAKE path variable, but I have put GnuWin32's bin directory into my path.

From nothing, running rake compile in Windows command prompt:

>rake compile
mkdir -p lib
mkdir -p tmp/x64-mingw32/test/2.4.2
cd tmp/x64-mingw32/test/2.4.2
C:/Ruby24-x64/bin/ruby.exe -I. ../../../../ext/test/extconf.rb
creating Makefile
cd -
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
process_begin: CreateProcess(NULL, echo generating test-x64-mingw32.def, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [test-x64-mingw32.def] Error 2
rake aborted!
Command failed with status (2): [C:\GnuWin32\bin/make.exe...]

Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so
(See full trace by running task with --trace)

Nothing is generated beyond the Makefile.

Switching over to msys32, I get a very different result (after clearing the temp files to start clean)

$ rake compile
mkdir -p lib
mkdir -p tmp/x64-mingw32/test/2.4.2
cd tmp/x64-mingw32/test/2.4.2
C:/Ruby24-x64/bin/ruby.exe -I. ../../../../ext/test/extconf.rb
creating Makefile
cd -
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
generating test-x64-mingw32.def
make: *** No rule to make target `/C/Ruby24-x64/include/ruby-2.4.0/ruby.h', needed by `test.o'.  Stop.
rake aborted!
Command failed with status (2): [C:\GnuWin32\bin/make.exe...]

Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so
(See full trace by running task with --trace)

This creates the Makefile and the .def file.

Using cmder (alternative Windows command prompt) gives yet another different result

λ rake compile
mkdir -p lib
mkdir -p tmp/x64-mingw32/test/2.4.2
cd tmp/x64-mingw32/test/2.4.2
C:/Ruby24-x64/bin/ruby.exe -I. ../../../../ext/test/extconf.rb
creating Makefile
cd -
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
generating test-x64-mingw32.def
C:\GnuWin32\bin\make.exe: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
rake aborted!
Command failed with status (255): [C:\GnuWin32\bin/make.exe...]

Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so
(See full trace by running task with --trace)

Either something's configured incorrectly or I'm missing something outright. I'm not particularly sure what's going on though. I'm far more used to development environments in macOS and Linux, and getting something on Windows that behaves similarly for development has always eluded me.

@kou
Copy link
Member

kou commented Dec 22, 2017

Please show output of rake --trace compile.

@PerrigoGames
Copy link
Author

Command prompt:

>rake --trace compile
** Invoke compile (first_time)
** Invoke compile:x64-mingw32 (first_time)
** Invoke compile:test:x64-mingw32 (first_time)
** Invoke copy:test:x64-mingw32:2.4.2 (first_time)
** Invoke lib (first_time)
** Execute lib
mkdir -p lib
** Invoke tmp/x64-mingw32/test/2.4.2/test.so (first_time)
** Invoke tmp/x64-mingw32/test/2.4.2 (first_time)
** Execute tmp/x64-mingw32/test/2.4.2
mkdir -p tmp/x64-mingw32/test/2.4.2
** Invoke tmp/x64-mingw32/test/2.4.2/Makefile (first_time)
** Invoke tmp/x64-mingw32/test/2.4.2 (not_needed)
** Invoke ext/test/extconf.rb (first_time, not_needed)
** Execute tmp/x64-mingw32/test/2.4.2/Makefile
cd tmp/x64-mingw32/test/2.4.2
C:/Ruby24-x64/bin/ruby.exe -I. ../../../../ext/test/extconf.rb --trace
creating Makefile
cd -
** Invoke ext/test/test.c (first_time, not_needed)
** Execute tmp/x64-mingw32/test/2.4.2/test.so
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
process_begin: CreateProcess(NULL, echo generating test-x64-mingw32.def, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [test-x64-mingw32.def] Error 2
rake aborted!
Command failed with status (2): [C:\GnuWin32\bin/make.exe...]
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:66:in `block in create_shell_runner'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:56:in `sh'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:166:in `block (2 levels) in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `chdir'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `cd'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb:37:in `chdir'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:165:in `block in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Ruby24-x64/bin/rake:23:in `load'
C:/Ruby24-x64/bin/rake:23:in `<main>'
Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so

msys32:

$ rake --trace compile
** Invoke compile (first_time)
** Invoke compile:x64-mingw32 (first_time)
** Invoke compile:test:x64-mingw32 (first_time)
** Invoke copy:test:x64-mingw32:2.4.2 (first_time)
** Invoke lib (first_time)
** Execute lib
mkdir -p lib
** Invoke tmp/x64-mingw32/test/2.4.2/test.so (first_time)
** Invoke tmp/x64-mingw32/test/2.4.2 (first_time)
** Execute tmp/x64-mingw32/test/2.4.2
mkdir -p tmp/x64-mingw32/test/2.4.2
** Invoke tmp/x64-mingw32/test/2.4.2/Makefile (first_time)
** Invoke tmp/x64-mingw32/test/2.4.2 (not_needed)
** Invoke ext/test/extconf.rb (first_time, not_needed)
** Execute tmp/x64-mingw32/test/2.4.2/Makefile
cd tmp/x64-mingw32/test/2.4.2
C:/Ruby24-x64/bin/ruby.exe -I. ../../../../ext/test/extconf.rb --trace
creating Makefile
cd -
** Invoke ext/test/test.c (first_time, not_needed)
** Execute tmp/x64-mingw32/test/2.4.2/test.so
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
generating test-x64-mingw32.def
make: *** No rule to make target `/C/Ruby24-x64/include/ruby-2.4.0/ruby.h', needed by `test.o'.  Stop.
rake aborted!
Command failed with status (2): [C:\GnuWin32\bin/make.exe...]
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:66:in `block in create_shell_runner'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:56:in `sh'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:166:in `block (2 levels) in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `chdir'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `cd'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb:37:in `chdir'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:165:in `block in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Ruby24-x64/bin/rake:23:in `load'
C:/Ruby24-x64/bin/rake:23:in `<main>'
Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so

@kou
Copy link
Member

kou commented Dec 24, 2017

Thanks.

In command prompt case, it seems that running echo generating test-x64-mingw32.def from make was failed.

Can you try the following instructions?

Create Makefile:

xxx:
	 echo generating test-x64-mingw32.def

Run make to run the Makefile:

> make
> echo %ERRORLEVEL%

In msys32 case, it seems that /C/ in /c/Ruby24-x64/include/ruby-2.4.0/ruby.h was not good.

Can you look into why /C/ is used instead of C:/?

@PerrigoGames
Copy link
Author

Command Prompt:

>make
echo generating test-x64-mingw-32.def
process_begin: CreateProcess(NULL, echo generating test-x64-mingw-32.def, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [xxx] Error 2

>echo %ERRORLEVEL%
2

As for why msys is using /c/, I figured that was the purpose, to provide a Unix-like environment with / as the root. That's how I navigate to the C: drive, even though msys also doesn't list that directory with an ls call.

Looking at the generated Makefile, I spotted this section near the top

#### Start of system configuration section. ####

srcdir = ../../../../ext/test
topdir = /C/Ruby24-x64/include/ruby-2.4.0
hdrdir = $(topdir)

and further down

ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h

I noticed the initial path was set that way after building on the msys configuration. I attempted to change the path manually to C:\ and it failed running make similar to the standard cmd:

$ rake --trace compile
** Invoke compile (first_time)
** Invoke compile:x64-mingw32 (first_time)
** Invoke compile:test:x64-mingw32 (first_time)
** Invoke copy:test:x64-mingw32:2.4.2 (first_time)
** Invoke lib (first_time, not_needed)
** Invoke tmp/x64-mingw32/test/2.4.2/test.so (first_time)
** Invoke tmp/x64-mingw32/test/2.4.2 (first_time, not_needed)
** Invoke tmp/x64-mingw32/test/2.4.2/Makefile (first_time, not_needed)
** Invoke tmp/x64-mingw32/test/2.4.2 (not_needed)
** Invoke ext/test/extconf.rb (first_time, not_needed)
** Invoke ext/test/test.c (first_time, not_needed)
** Execute tmp/x64-mingw32/test/2.4.2/test.so
cd tmp/x64-mingw32/test/2.4.2
C:\GnuWin32\bin/make.exe
compiling ../../../../ext/test/test.c
process_begin: CreateProcess(NULL, x86_64-w64-mingw32-gcc -I. -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I../../../../ext/test -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe -o test.o -c ../../../../ext/test/test.c, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [test.o] Error 2
rake aborted!
Command failed with status (2): [C:\GnuWin32\bin/make.exe...]
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:66:in `block in create_shell_runner'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb:56:in `sh'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:166:in `block (2 levels) in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `chdir'
C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:120:in `cd'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb:37:in `chdir'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-compiler-1.0.4/lib/rake/extensiontask.rb:165:in `block in define_compile_tasks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Ruby24-x64/bin/rake:23:in `load'
C:/Ruby24-x64/bin/rake:23:in `<main>'
Tasks: TOP => compile => compile:x64-mingw32 => compile:test:x64-mingw32 => copy:test:x64-mingw32:2.4.2 => tmp/x64-mingw32/test/2.4.2/test.so

@PerrigoGames
Copy link
Author

PerrigoGames commented Jan 1, 2018

I'm also going to be trying with a full MinGW setup soon as well, since it seems to have its own version of make.

EDIT: Hm, seems the binary is named differently, don't know if rake can catch that

@kou
Copy link
Member

kou commented Jan 3, 2018

For command prompt case, echo generating test-x64-mingw-32.def is generated by mkmf in Ruby itself. Please report it to Ruby itself: https://bugs.ruby-lang.org/

@kou
Copy link
Member

kou commented Jan 3, 2018

For msys32 case, it seems that C:\GnuWin32\bin/make.exe requires C:\ style path but x86_64-w64-mingw32-gcc requires /C/ style path. Can you use make.exe that requires /C/ style path instead of C:\GnuWin32\bin/make.exe?

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

No branches or pull requests

2 participants