On Thu, Nov 10, 2011 at 6:41 PM, Yusuke Endoh <mame / tsg.ne.jp> wrote:
>
> 2011/11/11 Luis Lavena <luislavena / gmail.com>:
>> Most of the time this is done using cross-compilation tools were the
>> extension is cross compiled against different versions of the cross
>> compiled Ruby and then packaged inside the gem.
>
> I didn't know a cross-compilation is used. =A0Why it is needed?
> Sorry for my ignorance.
>
>
> I had thought the development process of gems in windows is:
>
> 1. install windows.
> 2. install a compiler (such as vc++ or mingw).
> 3. install third party's libraries they need (such as openssl).
> 4. install the versions of Ruby which you're likely to support.
> 5. develop, build and test your gems by using the compiler,
> =A0 libraries and each version of Ruby.
> 6. create and release a gem package.
>

1) Most of gem authors do not have Windows.

2) Most of the gem authors do not have or want to setup an entire
development environment on Windows to be able to compile gems.

3) Provisioning of the 3rd party libraries (and it's compilation) is
not easy on Windows.

4) Cross-compilation of the 3rd party libraries and the extension of
their gems all from one environment is easier and simpler.

See rake-compiler project:

http://github.com/luislavena/rake-compiler

>
> To add support for a new version of Ruby, the extra process is:
>
> 7. install the new version of Ruby.
> 8. build and test your gems by using the already-installed
> =A0 compiler, libraries and the new Ruby.
> 9. create and release a new gem package.
>

You're omitting the issue: a binary gem will be for a single version
of Ruby because the binary extension was compiled just for the Ruby
used.

That is the reason of the fat-binary gem approach: it can contain the
same extension compiled against different versions of Ruby shared
library (for 1.8, 1.9.1 API versions).

Please ready the thread in RubyGems-devel where I explain this problem:

http://rubyforge.org/pipermail/rubygems-developers/2009-April/004522.html

>
> I think this extra process does not change even whether the gem
> depends on the third party's libraries or not, because they have
> already installed the libraries.

Windows !=3D your average POSIX OS, most of the time getting the correct
3rd party library *or* binaries for Windows is impossible.

You're assuming that all Ruby developers have a high knowledge on how
to use a compiler and compile dependencies by themselves, which is not
true (not even for users on OSX or Linux).

--=20
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry