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

fix compilation for Ruby 2.0.0 in Windows x64 #411

Merged
merged 1 commit into from May 11, 2014

Conversation

Projects
None yet
6 participants
@sroller

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

This comment has been minimized.

Show comment
Hide comment
@tmm1

tmm1 Mar 8, 2013

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@tmm1

tmm1 Mar 8, 2013

Contributor

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

Contributor

tmm1 commented Mar 8, 2013

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

@luislavena

This comment has been minimized.

Show comment
Hide comment
@luislavena

luislavena Mar 8, 2013

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@tmm1

tmm1 Mar 8, 2013

Contributor

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?

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@luislavena

luislavena Mar 8, 2013

Contributor

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

Contributor

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 👅

@contentfree

This comment has been minimized.

Show comment
Hide comment
@contentfree

contentfree Apr 24, 2013

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

contentfree commented Apr 24, 2013

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

@luislavena

This comment has been minimized.

Show comment
Hide comment
@luislavena

luislavena Apr 24, 2013

Contributor

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

Contributor

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.

@pateljatin

This comment has been minimized.

Show comment
Hide comment
@pateljatin

pateljatin Jun 9, 2013

SO, how/what is the fix here?

pateljatin commented Jun 9, 2013

SO, how/what is the fix here?

@ccoenen

This comment has been minimized.

Show comment
Hide comment
@ccoenen

ccoenen Jul 15, 2013

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ccoenen

ccoenen Jul 15, 2013

Contributor

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?

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@luislavena

luislavena Jul 19, 2013

Contributor

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

Contributor

luislavena commented Jul 19, 2013

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

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