[Rake-devel] Building native extensions with Rake
luislavena at gmail.com
Tue Nov 18 15:44:44 EST 2008
On Tue, Nov 18, 2008 at 6:33 PM, Charlie Savage <cfis at savagexi.com> wrote:
>>>> The thing is that both libraries will depend on different CRT which at
>>>> the same time will alloc and release objects from their HEAP, mixing
>>>> CRTs in the same space will segfault. Been there, done that.
>>> Well, this is a different issue. But I disagree with your conclusion -
>>> you are careful it is doable.
>> The problem is that careful people like you will do, but nobody else.
>> I've been bitten several times by cross CRT dealing with C, Python and
>> Ruby in the past to know the damage it can do and how hard is track it
>> down and fix it.
>> Even for Python guys building python with different version of VC++ is
>> complicated (you should check their compile instructions).
>> 7.1, 8.0 and now 9.0 each one links to different CRTs, messing with
>> that is like messing with nitroglycerin.
> I definitely agree it isn't the easiest thing....
>> Again: ExtensionTask is not building your extension from scratch, is
>> using your defined build script which generates a makefile. Then is
>> calling make and taking care the binary (so o bundle) is properly put
>> into lib folder.
> Ok. But Ruby gems already does this, so what's the difference?
GemPackageTask packages your pure ruby (Gem::Platform::RUBY) gem, but
> Or are you just focused on putting together binary gems - in which case Ruby
> gems offers no help at all? In that case, then I agree with you.
Yep, binary gems, not only for Windows but also some users with locked
down environments that has no compiler in their servers.
ExtensionTask put together the tasks for you to compile the extension
in a standard way. The idea is you supply your pure-ruby gemspec to it
and inject into all the binaries and adjust the proper platform for
So when "rake native gem" is executed, both pure-ruby and native of
your platform gems get generated.
Sorry I didn't express clearly my goal in the first email.
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
More information about the Rake-devel