fix compilation for Ruby 2.0.0 in Windows x64 #411

merged 1 commit into from May 11, 2014


None yet
6 participants

sroller commented Mar 1, 2013

I commented out the typedef for pid_t in project.h:97
that is unecessary for windows as the type is already installed.


tmm1 commented Mar 8, 2013

I cannot merge this. We need a way to detect if pid_t is already defined, because it is required in other environments. Can you find a #define we can use from the header that contains the definition in your environment.


tmm1 commented Mar 8, 2013

@luislavena Any advice? Can I use rake-compiler to build binary gems for 64bit win32 ruby builds?


luislavena commented Mar 8, 2013

@tmm1 at this time .rake-compiler/config.yml is not storing the platform information, so I need to work that before.

As for pid_t not being defined, perhaps a check in extconf can be added so we can use ifndef around it.


tmm1 commented Mar 8, 2013

Ah yes, an extconf check for pid_t would be simplest. I'll add it.

Is pid_t really only defined in x64 windows builds? Or maybe I just don't hit the compile error because I am cross-compiling?


luislavena commented Mar 8, 2013

@tmm1 the cross-compiler I'm using right now is too old (4.5.4) and the one for RubyInstaller 2.0 is GCC 4.7.2

So the check for pid_t will work when people is compiling natively, but dunno about the cross-compiler yet.

I need to figure out a recommendation for both OSX/Linux developers on which cross-compiler to use and then use that to build.

As you can imagine, my world just got a bit more complicated 👅

@tmm1, @luislavena: Any progress on building on Windows?


luislavena commented Apr 24, 2013

@contentfree I'm MIA due work (about to take an ✈️) and will start again with OSS next week.

You can still attempt to compile your own, as for OpenSSL dependency, you can build using Knapsack packages, as described in several posts on RubyInstaller group.

luislavena referenced this pull request in oneclick/rubyinstaller May 21, 2013


unable to install caldecott under windows 8 x64 #174

SO, how/what is the fix here?


ccoenen commented Jul 15, 2013

this is currently preventing me from using ruby 2.0 on windows.

The proposed change works beautifully on Win 7 / 64bit with Ruby 2.0.0 p247 64bit and DevKit 4.7.2.


ccoenen commented Jul 15, 2013

It's not exactly the same file as in the devkit, but here's the source around the places where pid_t gets defined the first time:

(from: )

#ifndef _PROCESS_H_
#define _PROCESS_H_

/* All the headers include this file. */
#include <_mingw.h>

#include <sys/types.h> /* For _pid_t and pid_t. */ // <--- this is line 17
#include <stdint.h> /* For intptr_t. */

the sys/types.h then looks like this:

#ifndef _PID_T_
#define _PID_T_
typedef int _pid_t;

#ifndef _NO_OLDNAMES
typedef _pid_t  pid_t;
#endif /* Not _PID_T_ */

So, wrapping it in

#ifndef _PID_T_
#define _PID_T_
//our line

should do the trick, right?


luislavena commented Jul 19, 2013

@tmm1 another developer is working on a vagrant box to cross-compile gems with rake-compiler:

I've sent a pull request with some modifications to work with latest version of Ruby.


I'm going to test against EventMachine code this weekend and let you guys know.


@tmm1 tmm1 merged commit 86763a7 into eventmachine:master May 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment