hone / mruby-cli

mruby-cli is a platform to build native command line applications for Linux, Windows, and OS X. It provides the tools necessary for building a standalone binary of your application from any machine. Take advantage of the power of Ruby without the cross-platform dependency headaches that go with it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

commented

@kjunichi Thanks for your report! I will look into it and see if I can fix it upstream.

/cc @tsahara

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.

commented

Glad to see this resolved, thank you for your efforts!

お疲れ様でした!!