Can't build windows binaries
kjunichi opened this issue · comments
Hi, mruby-cli is great!
But, I've got following errors.
CC build/mrbgems/mruby-io/src/io.c -> build/x86_64-w64-mingw32/mrbgems/mruby-io/src/io.o
/home/mruby/code/mruby/build/mrbgems/mruby-io/src/io.c: In function 'mrb_cloexec_pipe':
/home/mruby/code/mruby/build/mrbgems/mruby-io/src/io.c:156:3: error: implicit declaration of function 'pipe' [-Werror=implicit-function-declaration]
ret = pipe(fildes);
^
cc1: some warnings being treated as errors
it seems that mingw-w64 compiler is more strict for declaration check.
I found work around :
# spec.add_dependency 'mruby-mtest', :mgem => 'mruby-mtest'
but, this is wrong.
we have no test.
thanks.
pipe(2) requires <unistd.h>
on POSIX platforms. What is needed on mingw32?
I'm not familiar with Mingw32,but following is my research.
io.h had _pipe function.
This page says that
#define pipe(fds) _pipe(fds, 5000, _O_BINARY)
/* replace 5000 with whatever buffer size you want to use */
Does this help up?
thanks.
Thank you! I tried _pipe
macro but it is not a drop-in replacement of POSIX pipe(2) as written in the page, so I have merged iij/mruby-io#53 to remove pipe support on Windows platforms. Could you try updated mruby-io? docker-compose run compile
runs without error for me.
Thank you very much!
It works fine on both 32bit and 64bit windows platform.
Glad to see this resolved, thank you for your efforts!
お疲れ様でした!!