Proposing: A new Ruby Windows installer

Curt H. wrote:

Also as Austin pointed out, it would be much better to join the one-click
installer team. I have been asking for help repeatedly over the years
without much response. So far, only Ryan L. and Shashank D. have
helped. There’s a lot that could be done, but without more help, the I have
to keep the scope limited.

Hi,

I read your message on the ruby-talk mailinglist. What kind of help do
you need? I don’t have a Visual C++ environment running, but as I
understand it the environment can be downloaded for free nowadays (the
express edition at least).

Regards,

Peter

Mauricio F. wrote:

On Wed, May 24, 2006 at 09:39:43PM +0900, Tim H. wrote:

What compiler do you need to build binary extensions that are compatible
with the one-click installer?

IIRC MSVC 6 or MinGW.

Thanks, Mauricio.

We tried building RMagick with MinGW and ran into problems (with Rails
apps) that smell very much like they were caused by an incompatibility
between MinGW and the compiler used for the 1.8.4 ruby-mswin binary.
Through 1.8.2, RMagick built with MinGW has always worked just fine.

So I’m wondering what to do. If I’m right and MinGW-compiled binaries
are incompatible with ruby-mswin 1.8.4, and MSVC6 is no longer available
for free, what compiler should we use to create ruby-mswin-compatible
compiled extensions?

On Wed, 24 May 2006, Curt H. wrote:

There is a slight problem here though. I don’t have time to go into the
detais (I’ve got to get out of the house in 15 minutes), but right now to
build the one-click ruby installer/distro you need VC++ 6.0. The free
version is VC++ 8 and is not compatible.

Curt

hi curt-

i’ve never understood why one would use the mingw? my biggest issue
with
windows ruby is that i can’t do this

ruby extconf.rb && make && make install

which renders ruby useless for my purposes - doing just about any
science will
require one to compile ruby extensions and third-party libs…

so, when i compiled the gsl for win i had to do this

  • install msys
  • compile a ruby using msys
  • compile gsl
  • compile ruby-gsl using msys-ruby
  • manually copy *.so, *rb, etc into c:\ruby\lib…

not to mention quite a few small tweaks i made to ruby-gsl… anyhow.
here is
my question:

why not compile ruby with msys so that windows users can install
extensions
like the rest of the ruby world? it always seems strange to me that
ruby’s
built-in extension creation does not work on windows…

anyhow, not wanting to look a gift horse in the mouth, but why not msys?

cheers.

-a

On 5/24/06, [email protected] [email protected] wrote:

why not compile ruby with msys so that windows users can install extensions
like the rest of the ruby world? it always seems strange to me that ruby’s
built-in extension creation does not work on windows…

anyhow, not wanting to look a gift horse in the mouth, but why not msys?

We do not compile Ruby ourselves, but use the compiled version provided
here:

http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html

It seems they use VC6 to compile this, so we must use it as well for
extensions.

I’ll let Curt explain why this particular version is used, because I
do not know.

Ryan

Not really relevant to the one-click-installer, but precompiled windows
binaries are available here:

http://www.antoniocangiano.com/articles/tag/ruby

both stable 1.8.4 pr 2006-05-03 and unstable 1.9 pr 2006-05-01

On Wed, May 24, 2006 at 10:13:14PM +0900, Tim H. wrote:

apps) that smell very much like they were caused by an incompatibility
between MinGW and the compiler used for the 1.8.4 ruby-mswin binary.
Through 1.8.2, RMagick built with MinGW has always worked just fine.

So I’m wondering what to do. If I’m right and MinGW-compiled binaries
are incompatible with ruby-mswin 1.8.4, and MSVC6 is no longer available
for free, what compiler should we use to create ruby-mswin-compatible
compiled extensions?

If you’re right that’s pretty bad news :expressionless: I thought MinGW was
compatible with
the MSVC6-based ruby-mswin32 builds (I only knew of compatibility
problems
with the runtime used by newer VC compilers). I’m using MinGW to
cross-compile the extension used by rcov, and was considering offering a
hand
to the One Click team…

If they’re actually incompatible, this would almost make ruby-mingw32
preferable as a base to build the One-Click Installer upon, since:

  • mingw is readily available and will not disappear the way MSVC6 did
  • it allows for cross-compilation, meaning one doesn’t need a win32 box
    nearby
    to create win32 binaries

Is there anything that would make builds made with the VC-of-the-day
better an
option than ruby-mingw32?

I’d guess a possible transition wouldn’t be too costly given the new
One-Click infrastructure. Maybe as little as pointing to
http://ftp.ruby-lang.org/pub/ruby/binaries/mingw/1.8/ruby-1.8.4-i386-mingw32.tar.gz
instead of
http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.4-i386-mswin32.zip
?

On Wed, May 24, 2006 at 11:31:11PM +0900, Ryan L. wrote:

http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html

But would it be more difficult to use
pub/ruby/binaries/mingw/1.8/ instead?

Quoting from that page

mswin32
Compiled by Microsoft Visual C++. This is the most ‘standard’ binary
from the
common point-of-view in the Windows world. But we cannot use some parts
of
characteristic functions which ruby on UNIX has. After 1.7.3, mswin32
has
binary level compatibility of extension libraries with mingw32.
RUBY_PLATFORM
is *-mswin32.
[…]
mingw32
Compiled by gcc. Since most of the source code of ruby-mingw32 is the
same as
ruby-mswin32, the behaviors of it are almost the same as that of
ruby-mswin32
(probably). After 1.7.3, mingw32 has binary level compatibility of
extension
libraries with mswin32. RUBY_PLATFORM is *-mingw32.

On 5/24/06, Curt H. [email protected] wrote:

There is a slight problem here though. I don’t have time to go into the
detais (I’ve got to get out of the house in 15 minutes), but right now to
build the one-click ruby installer/distro you need VC++ 6.0. The free
version is VC++ 8 and is not compatible.

and has significant problems of its own.

This is the stuff that I’m working on when I have time.

-austin

On Wed, 24 May 2006, Ryan L. wrote:

http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html

It seems they use VC6 to compile this, so we must use it as well for
extensions.

I’ll let Curt explain why this particular version is used, because I
do not know.

Ryan

fwiw i downloaded msys and compiled ruby-1.8.4 on an xp in about 10
minutes -
no errors even.

regards.

-a

On 5/24/06, Tim H. [email protected] wrote:

Through 1.8.2, RMagick built with MinGW has always worked just fine.
That’s odd, because MinGW is supposed to be compatible with VC++6. It
would be useful to see further information.

So I’m wondering what to do. If I’m right and MinGW-compiled binaries
are incompatible with ruby-mswin 1.8.4, and MSVC6 is no longer available
for free, what compiler should we use to create ruby-mswin-compatible
compiled extensions?

It’s worse: MSVC6 is no longer available at all. Even I, with an MSDN
subscription, can no longer get MSVC6, as I understand it.

-austin

On 5/24/06, [email protected] [email protected] wrote:

On Wed, 24 May 2006, Curt H. wrote:

There is a slight problem here though. I don’t have time to go into the
detais (I’ve got to get out of the house in 15 minutes), but right now to
build the one-click ruby installer/distro you need VC++ 6.0. The free
version is VC++ 8 and is not compatible.
i’ve never understood why one would use the mingw? my biggest issue with
windows ruby is that i can’t do this

MinGW uses MSYS. You’re using MinGW when you use MSYS, Ara.

-a

[email protected] wrote:

  • install msys
  • compile a ruby using msys
  • compile gsl
  • compile ruby-gsl using msys-ruby
  • manually copy *.so, *rb, etc into c:\ruby\lib…

What goes wrong with gsl when you use ruby-mswin32 and nmake/vc6?

ruby extconf.rb
nmake
nmake install

This has worked for some extensions, but maybe gsl is peculiar about
being compiled with gcc?

On 5/24/06, Mauricio F. [email protected] wrote:

If they’re actually incompatible, this would almost make ruby-mingw32
I’d guess a possible transition wouldn’t be too costly given the new
One-Click infrastructure. Maybe as little as pointing to

http://ftp.ruby-lang.org/pub/ruby/binaries/mingw/1.8/ruby-1.8.4-i386-mingw32.tar.gz
instead of

http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.4-i386-mswin32.zip
?

Overall, this is a distressing state of affairs. If anyone here knows a
reason why MinGW would be a bad idea, please speak up. In the long term
it
seems like MinGW would be the way to go. But the current 1.8.4 version
is
within a week or so of a final release and needs to go out as is.

The reason that I went back to VC++6 was that all of the extensions that
I
pick up in binary format are VC++6.

As Ara pointed out, buildng Ruby itself is easy. I’ve never had problems
building Ruby. Its problems building the extensions that take the most
effort, which is why I went for binaries whenever possible.

But this came from the days when everyone thought that all these
compilers
(MinGW, VC++6, VC++7, etc.) were compatible. It really looks like the
only
safe approach for the long term is to build everything from source.

I think this is the right thing to do, but I need to find additional,
help.
Ryan L. has been tremendously helpful over the last two months.
But
knowing my other commitments, we’d need at least one other knowlegable C
and
Ruby developer who could be realiably counted on to help.

Curt

On Thu, 25 May 2006, Austin Z. wrote:

On 5/24/06, [email protected] [email protected] wrote:

On Wed, 24 May 2006, Curt H. wrote:

There is a slight problem here though. I don’t have time to go into the
detais (I’ve got to get out of the house in 15 minutes), but right now to
build the one-click ruby installer/distro you need VC++ 6.0. The free
version is VC++ 8 and is not compatible.
i’ve never understood why one would use the mingw? my biggest issue with
windows ruby is that i can’t do this

MinGW uses MSYS. You’re using MinGW when you use MSYS, Ara.

ooops. typo. what i meant to say was

… i’ve never understood why one wouldn’t use the mingw/msys
combo? …

obviously i’m campaigning for extconf.rb cross-platform compat - and
that
means using mingw/msys.

sorry for confusion.

-a

On Thu, 25 May 2006, Joel VanderWerf wrote:

ruby extconf.rb
nmake
nmake install

This has worked for some extensions, but maybe gsl is peculiar about
being compiled with gcc?

yup, you never would even make it this far. you need to do this first

cd gsl-1.8/

./configure --prefix=/usr/local && make && make install

and for that you need msys. same goes for sqlite, etc, etc. people
have
compiled gsl using vc6 but they charge 400 bucks for it… that must
mean
something.

regards.

-a

On Thu, 25 May 2006, Curt H. wrote:

Overall, this is a distressing state of affairs. If anyone here knows a
reason why MinGW would be a bad idea, please speak up.

i can’t really comment on this - but my baby steps have shown it to be
ok.

But this came from the days when everyone thought that all these compilers
(MinGW, VC++6, VC++7, etc.) were compatible. It really looks like the only
safe approach for the long term is to build everything from source.

btw. the incompatibility i found was isascii() one compiler defines it
as a
macro, and the other a function. at runtime it fails to find the
symbol.
sorry i forget which is which, but it’s and example of incompat.

I think this is the right thing to do, but I need to find additional, help.
Ryan L. has been tremendously helpful over the last two months. But
knowing my other commitments, we’d need at least one other knowlegable C and
Ruby developer who could be realiably counted on to help.

i can lend a little assistance wrspt to compiling things - be it third
party
or otherwise.

cheers.

-a

Curt H. wrote:

cross-compile the extension used by rcov, and was considering offering a
Is there anything that would make builds made with the VC-of-the-day
http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.4-i386-mswin32.zip

(MinGW, VC++6, VC++7, etc.) were compatible. It really looks like the

Curt

Rats. Kaspar Scheiss actually does the RMagick Win32 work, and he’s on
holiday now, so my info is 2nd-hand. I’ll do the best I can…

Kaspar has been using mingw to build the RMagick Win32 gem all along.
However we started getting complaints that the one he built last
September, for Ruby 1.8.2, was causing problems when run with the 1.8.4
one-click installer previews. Apparently the latest version of Rails
requires 1.8.4. Of course it’s easy to believe that a compiled extension
built for 1.8.2 will be incompatible with 1.8.4, so he used mingw to
build a new gem for 1.8.4. Almost immediately we started getting reports
of problems when using it in Rails apps. Consequently I withdrew the
gem, which leaves the old 1.8.2-compatible version as the only option
for RMagick users on Windows. We have not had any reports of problems
outside of Rails.

I admit that doesn’t 100% prove that mingw is incompatible with VC++6,
but if it’s not fire it’s at least smoke. I’d be interested to hear from
other people who have built extensions using mingw. Have you had any
problems using your extension with ruby-mswin 1.8.4?

My concern is that if VC++6 is not available, and mingw is not
compatible with VC++6, then there’s no way for us to build a version of
RMagick for Win32 that is compatible with the one-click installer.

Is it possible to get VC++6 from someplace other than MS? Does MS allow
it?

I think mingw is the way to go in the future. I wish I could give a good
answer about where you could get additional help.

Will the new one-click infrastructure extend to building compatible
extensions? That is, is this something we could use to build a
guaranteed-compatible-with-the-one-click version of RMagick for Win32?
This is something we’d adopt in a heartbeat. If not, what it would take
to make such an infrastructure, not just for RMagick of course but for
all C extensions? (Everybody jumped on Zed & Luis’ comments about Ruby
peformance, but I was particularly struck by Luis’ comments about the
problems he ran into with Ruby libraries on Win32).

On 5/24/06, John L. [email protected] wrote:

Jumping in real late on this thread - but I know there are folks on the VC++
team at MSFT who really want to help get Ruby compiling using C++ 14.0 (the
release that ships with VS 2005). I don’t have cycles to really help out
here (have some nasty bugs to squash in RubyCLR), but I can hook people up
with the appropriate folks on the team to get the ball rolling if someone
wants to drive this effort on the Ruby side of the house.

Get them in touch with me if you don’t mind; I’ve got a lot of work
that I’ve done so far and I’ll point out that the problem, at the
moment, isn’t so much Ruby itself, but extensions and the things upon
which those extensions are based. There are also some concerns about
the permissions required to install Ruby build with C++ 14 (VS 2005,
MSVCRT8).

-austin

Jumping in real late on this thread - but I know there are folks on the
VC++
team at MSFT who really want to help get Ruby compiling using C++ 14.0
(the
release that ships with VS 2005). I don’t have cycles to really help out
here (have some nasty bugs to squash in RubyCLR), but I can hook people
up
with the appropriate folks on the team to get the ball rolling if
someone
wants to drive this effort on the Ruby side of the house.

Cheers,
-John

fwiw i downloaded msys and compiled ruby-1.8.4 on an xp in about 10
minutes - no errors even.

I’ve got mingw and msys installed on a windows 2003 box… I’ve got the
path variables set, etc… how did you run ./configure on the ruby
source???