Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix compilation for Ruby 2.0.0 in Windows x64 #411

Merged
merged 1 commit into from

6 participants

@sroller

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

@tmm1
Owner

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
Owner

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

@luislavena

@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
Owner

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

@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 :tongue:

@contentfree

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

@luislavena

@contentfree I'm MIA due work (about to take an :airplane:) 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 luislavena referenced this pull request in oneclick/rubyinstaller
Closed

unable to install caldecott under windows 8 x64 #174

@pateljatin

SO, how/what is the fix here?

@ccoenen

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

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: https://github.com/msysgit/msysgit/blob/master/mingw/include/process.h#L17 )

#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: https://github.com/msysgit/msysgit/blob/master/mingw/include/sys/types.h#L75

#ifndef _PID_T_
#define _PID_T_
typedef int _pid_t;

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

So, wrapping it in

#ifndef _PID_T_
#define _PID_T_
//our line
#endif

should do the trick, right?

@luislavena

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

https://github.com/tjschuck/rake-compiler-dev-box

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

tjschuck/rake-compiler-dev-box#2

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

Cheers.

@tmm1 tmm1 merged commit 86763a7 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2013
  1. removed typedef pid_t for windows

    Steffen Roller authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ext/project.h
View
2  ext/project.h
@@ -94,7 +94,7 @@ typedef int SOCKET;
#include <assert.h>
typedef int socklen_t;
-typedef int pid_t;
+// typedef int pid_t;
#endif
#if !defined(_MSC_VER) || _MSC_VER > 1500
Something went wrong with that request. Please try again.