[ANN] Bootstrapping Ruby with MinGW: selfhosted and test sandbox!

Hello List,

I'm happy to announce that huge progress (hack-a-ton) was made this
weekend to bring a new implementation of One-Click Installer for
Windows!

This test version is based on the rake recipes I commented on previous
posts [1], and it download MinGW, MSYS and some Ruby dependencies to
get a working Ruby implementation using MinGW (i386-mingw32 platform).

I've packaged Ruby 1.8.6 (revision 15830) as 7zip package (2.7MB). You
can download it form the following URL:

http://dump.mmediasys.com/installer3/

The project and the recipes code can be downloaded from here:

http://code.mmediasys.com/installer3/latest.zip

I'll like to point a few things before everyone start using this ruby
version:

THIS BUILD OF RUBY IS *NOT* READY FOR PRODUCTION. USE IT ONLY FOR
TESTING PURPOSES.

All the enhancements got here will be injected back in the new version
of One-Click Installer for Windows.

Caveats:

1) Pre-built gems for i386-mswin32 are not compatible with this build
of ruby. You'll require to download sources of your favorite gems.

If you haven't created the sandbox environment using the recipes, you
can grab the baked mingw+msys sandbox from installer3 URL. You need to
put MinGW binaries and MSYS binaries in the PATH (in that order)
before firing the gem install or any build procedure.

2) Don't expect Rails, Mongrel, Merb, Sqlite3 or "name your favorite
gem" will work with this release out of the box (hey, this is not even
a release!).

3) The package contains the bare minimum stuff to serve as self
hosting environment:

Ruby 1.8.6
Zlib 1.2.3
OpenSSL 0.9.7c
Readline 5.2
Iconv alternative
RubyGems 1.0.1

Nothing more, nothing less.

4) Readline is still broken. I removed the readline tests from the
check procedure to continue working on this (was stuck for two months
without feedback). If you wanna help, search for my previous posts
about this issue.

For CI information:
1760 tests, 1343436 assertions, 2 failures, 0 errors

5) GNU Utils are a nightmare to get it working or find proper builds
for Windows. following _why advice [2], opted for win_iconv which
seems working (but there aren't tests for it).

6) Microsoft Installer (MSI) recipes are still missing. Future
releases will be use WiX tools and will provide patches between
releases.

7) Contributions are highly welcome! I'm using Bazaar as VCS since
Windows support for Git (the new cool tool) is still behind...

Remember: everything shown here will became part of the next One-Click
Installer. As you can see, I'm trying to keep it to the minimum. Later
we can discuss "addons" or different versions that are target
different usage scenarios.

Check my blog [2] for upcoming hack-a-ton dates and keep an eye on
#ruby-lang if you wanna help :wink:

Regards and everybody have a nice week!

[1] http://groups.google.com/group/ruby-talk-google/browse_thread/thread/1e2f1b9a3d611e3b/
[2] http://blog.mmediasys.com

···

--
Luis Lavena
Multimedia systems
-
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.
Douglas Adams

Hi Luis.

May I congratulate you on your perseverance! I tried something similar
a couple of years ago and gave up in frustration (and ditched Windows
in the process :slight_smile: This is a great service to the Ruby on Windows
community. Well done.

Regards,
Sean

···

On Mon, Mar 24, 2008 at 5:30 AM, Luis Lavena <luislavena@gmail.com> wrote:

Hello List,

I'm happy to announce that huge progress (hack-a-ton) was made this
weekend to bring a new implementation of One-Click Installer for
Windows!

Note that binary gems don't work only because they install their
binary aspect into the wrong directory (and, if you have the newer
versions of rubygems, auto-install a version which doesn't exist so
you'd need to specify you want the win32 gem). Once you install it
you can easily copy the .so's to the right directory and they will
'probably' work just fine.

Note that mongrel works if you do this then just go into mongrel.rb
and change their 'win32' regexes to be win32|mingw

Good luck!
-R

I think very useful would be a mingw build of ruby that included some
popular gems pre-built (that is...<cough> mongrel, sqlite, mysql,
maybe ruby-debug). Assuming that those gems only need to be compiled
in mingw and it works like a charm.

Then people could use it as their dev environment and 'test it
out' (if they work in rails, that is), and also give feedback, and
avoid the pain of compiling their own extensions (as easy as that is
now, thanks to Luis' build helpers).
(I assume you also tried http://gnuwin32.sourceforge.net/packages/readline.htm
this readline?)

GL!
-R

This is all working very smoothly for me, following the recipe.

I ended up with a ruby/mingw32 installation which my program can use to dynamically compile its parts that are generated C code, and run 20%-50% faster than using msvc6 and oci. This is also far preferable than requiring users to have msvc6 installed if they make changes that require recompilation of the generated C code.

The only slight hiccup was figuring out that I needed to put sandbox/ruby_mingw/bin on my PATH, but that's really pretty obvious.

I hope someone is able to fix readline, though...

Thanks, Luis!

···

--
        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Hey Luis,

I've been working on trying to do a MinGW environment, so that I can
work on a MinGW Compile of wxRuby for Windows. The only thing I have
to say, is congrats, and you have made my day! The sandbox
development environment that you setup with the rakefiles, is exactly
what I needed, so desperately. Thank you so much for this, I'm
running the rake for installer3, to get everything I need setup. I
seriously recommend that you setup a OCI just for the Development
Environment itself! MinGW and MSys has unfortunatly come up short for
me on many occasions on trying to get a full compiler environment
setup on Windows, that I'm use to on Linux, through their installers,
and setups. If things work the way that I believe they are going to,
this is going to make my day!

Keep up the good work, (Especially for us developers who are less then
familiar with trying to get Ruby going, let alone work on our own
Extensions! LOL)

L8ers,

···

---
Mario Steele
wxRuby Senior Developer
Website: http://wxruby.rubyforge.org/wiki/wiki.pl
Rubyforge: http://rubyforge.org/projects/wxruby

wxRIDE Creator / Senior Developer
Website: http://wxride.trilake.net
Rubyforge: http://rubyforge.org/projects/wxride

On Mar 24, 12:27 am, Luis Lavena <luislav...@gmail.com> wrote:

Hello List,

I'm happy to announce that huge progress (hack-a-ton) was made this
weekend to bring a new implementation of One-Click Installer for
Windows!

This test version is based on the rake recipes I commented on previous
posts [1], and it download MinGW, MSYS and some Ruby dependencies to
get a working Ruby implementation using MinGW (i386-mingw32 platform).

I've packaged Ruby 1.8.6 (revision 15830) as 7zip package (2.7MB). You
can download it form the following URL:

http://dump.mmediasys.com/installer3/

The project and the recipes code can be downloaded from here:

http://code.mmediasys.com/installer3/latest.zip

I'll like to point a few things before everyone start using this ruby
version:

THIS BUILD OF RUBY IS *NOT* READY FOR PRODUCTION. USE IT ONLY FOR
TESTING PURPOSES.

All the enhancements got here will be injected back in the new version
of One-Click Installer for Windows.

Caveats:

1) Pre-built gems for i386-mswin32 are not compatible with this build
of ruby. You'll require to download sources of your favorite gems.

If you haven't created the sandbox environment using the recipes, you
can grab the baked mingw+msys sandbox from installer3 URL. You need to
put MinGW binaries and MSYS binaries in the PATH (in that order)
before firing the gem install or any build procedure.

2) Don't expect Rails, Mongrel, Merb, Sqlite3 or "name your favorite
gem" will work with this release out of the box (hey, this is not even
a release!).

3) The package contains the bare minimum stuff to serve as self
hosting environment:

Ruby 1.8.6
Zlib 1.2.3
OpenSSL 0.9.7c
Readline 5.2
Iconv alternative
RubyGems 1.0.1

Nothing more, nothing less.

4) Readline is still broken. I removed the readline tests from the
check procedure to continue working on this (was stuck for two months
without feedback). If you wanna help, search for my previous posts
about this issue.

For CI information:
1760 tests, 1343436 assertions, 2 failures, 0 errors

5) GNU Utils are a nightmare to get it working or find proper builds
for Windows. following _why advice [2], opted for win_iconv which
seems working (but there aren't tests for it).

6) Microsoft Installer (MSI) recipes are still missing. Future
releases will be use WiX tools and will provide patches between
releases.

7) Contributions are highly welcome! I'm using Bazaar as VCS since
Windows support for Git (the new cool tool) is still behind...

Remember: everything shown here will became part of the next One-Click
Installer. As you can see, I'm trying to keep it to the minimum. Later
we can discuss "addons" or different versions that are target
different usage scenarios.

Check my blog [2] for upcoming hack-a-ton dates and keep an eye on
#ruby-lang if you wanna help :wink:

Regards and everybody have a nice week!

[1]http://groups.google.com/group/ruby-talk-google/browse_thread/thread/\.\.\.
[2]http://blog.mmediasys.com
--
Luis Lavena
Multimedia systems
-
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.
Douglas Adams

Luis Lavena wrote:

Hello List,

I'm happy to announce that huge progress (hack-a-ton) was made this
weekend to bring a new implementation of One-Click Installer for
Windows!

Just in one evening I've been able to get everything installed and built and use the resulting version of Ruby to build RMagick. Very nice!

I had to scratch my head a bit before I figured out what changes I needed to make to my PATH but other than that everything went very smoothly.

This says good things about...well...everything, actually. Good work, Luis, and thanks! I'm looking forward to being able to rely on this environment for Ruby on Windows.

···

--
RMagick: http://rmagick.rubyforge.org/
RMagick 2: http://rmagick.rubyforge.org/rmagick2.html

Luis Lavena wrote:

Hello List,

I'm happy to announce that huge progress (hack-a-ton) was made this
weekend to bring a new implementation of One-Click Installer for
Windows!

I saw a post saying an rmagick mingw gem was available. Any word on how
we can get it, or how to compile it?
Thanks.
-R

···

--
Posted via http://www.ruby-forum.com/\.

Note that binary gems don't work only because they install their
binary aspect into the wrong directory (and, if you have the newer
versions of rubygems, auto-install a version which doesn't exist so
you'd need to specify you want the win32 gem). Once you install it
you can easily copy the .so's to the right directory and they will
'probably' work just fine.

Not that, RubyGems consider each platform by it's own. I snot the same
darwin8 to cygwin, so mingw32 shouldn't be considered a compatible
match to mswin32.

In a overlooked way you could be correct, but that is too simplistic
way to look things. When you start seeing errors due exception thrown
inside shared object we can find several and big issues.

Consider that the code generated by VC6 is not the same MinGW
generates. It even differs in several places on how it do things.

Note that mongrel works if you do this then just go into mongrel.rb
and change their 'win32' regexes to be win32|mingw

The gems mongrel provides right now are tested for mswin32. Now that
this build of mingw32 seems a good candidate for replacement, I'll try
to fix as much as possible the code related to this on the project I
contribute back.

But again, without overlooking at the important issues behind this :smiley:

Good luck!

Thank you Roger, I'll really need it :wink:

Regards,

···

On Mar 24, 5:54 pm, rogerdpack <rogerpack2...@gmail.com> wrote:
--
Luis Lavena

but, if you have ruby and mingw installed all you need to do to install these is 'gem install sqlite', etc. i compiled the gsl this way and it was a peice of cake. ruby + compiler = joy.

-a

···

On Mar 26, 2008, at 11:39 AM, rogerdpack wrote:

I think very useful would be a mingw build of ruby that included some
popular gems pre-built (that is...<cough> mongrel, sqlite, mysql,
maybe ruby-debug). Assuming that those gems only need to be compiled
in mingw and it works like a charm.

I think very useful would be a mingw build of ruby that included some
popular gems pre-built (that is...<cough> mongrel, sqlite, mysql,
maybe ruby-debug). Assuming that those gems only need to be compiled
in mingw and it works like a charm.

Well, part of the idea of getting ruby build with Ruby is put it on CI
and forget about it.
Also, add it as platform to the CI and build some of the projects you
mention, with the idea of generate as output the pre-compiled
packages :slight_smile:

Then people could use it as their dev environment and 'test it
out' (if they work in rails, that is), and also give feedback, and
avoid the pain of compiling their own extensions (as easy as that is
now, thanks to Luis' build helpers).
(I assume you also tried Readline for Windows
this readline?)

Yeah, tried it, all the flavors or Readline. from 4.3 source to 5.2
using mingwPORTs.

GL!

:slight_smile:

···

On 26 mar, 14:38, rogerdpack <rogerpack2...@gmail.com> wrote:
--
Luis Lavena

This is all working very smoothly for me, following the recipe.

I ended up with a ruby/mingw32 installation which my program can use to
dynamically compile its parts that are generated C code, and run 20%-50%
faster than using msvc6 and oci. This is also far preferable than
requiring users to have msvc6 installed if they make changes that
require recompilation of the generated C code.

Great, good to know :slight_smile:

The only slight hiccup was figuring out that I needed to put
sandbox/ruby_mingw/bin on my PATH, but that's really pretty obvious.

Well, the idea of sandbox/ruby_mingw is be there until it get properly
packaged :wink:

I suggest you put it into C:/Ruby or something like that, or have a
inside your %HOME% a full stack of ruby versions like I do:

ruby-185-p114-VC6-rubygems-094
ruby-186-p111-VC6-rubygems-094
ruby-186-p111-VC6-rubygems-094-oci
ruby-186-p111-VC6-rubygems-095
ruby-186-p111-VC6-rubygems-101
ruby-186-svn-MINGW-rubygems-101

I hope someone is able to fix readline, though...

I want to try the non-blocking patch Park Heesob created for IO.gets,
I don't think it's related, but smell fishy...

Thanks, Luis!

No problem man, I hope collect a list of the most used gems that want
get proper support for MinGW build, now that RubyGems is fixed :wink:

Regards,

···

On Mar 27, 9:58 pm, Joel VanderWerf <vj...@path.berkeley.edu> wrote:
--
Luis Lavena

I have read something about pure ruby readline on this list. There's
something on RAA but the linked site is down.

Thanks

Michal

···

On 28/03/2008, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

This is all working very smoothly for me, following the recipe.

I ended up with a ruby/mingw32 installation which my program can use to
dynamically compile its parts that are generated C code, and run 20%-50%
faster than using msvc6 and oci. This is also far preferable than
requiring users to have msvc6 installed if they make changes that
require recompilation of the generated C code.

The only slight hiccup was figuring out that I needed to put
sandbox/ruby_mingw/bin on my PATH, but that's really pretty obvious.

I hope someone is able to fix readline, though...

Luis Lavena wrote:
> Hello List,

> I'm happy to announce that huge progress (hack-a-ton) was made this
> weekend to bring a new implementation of One-Click Installer for
> Windows!

Just in one evening I've been able to get everything installed and built
and use the resulting version of Ruby to build RMagick. Very nice!

Wow, thats excellent news! Is great to know that RMagick works on
this!

I had to scratch my head a bit before I figured out what changes I
needed to make to my PATH but other than that everything went very smoothly.

Hehehe, yeah, it still lacks a bit of *cough* documentation *cough* :-
P

These recipes will be used to create One-Click Ruby Installer and also
the Developer Kit I commented in my blog [1]

The idea is those gem developers or users that requires compilation in
any sort, can download and get a developement compiler more faster
than figure out MinGW setup and all that pain :stuck_out_tongue:

This says good things about...well...everything, actually. Good work,
Luis, and thanks! I'm looking forward to being able to rely on this
environment for Ruby on Windows.

Thank you!, I'm looking forward for this too!

Next step involves the creation of Windows Installers to be a real
"one-click" installation solution :wink:

[1] http://blog.mmediasys.com/2008/03/29/progress-of-one-click-installer-rubyinstaller

Thank you for your time, kind words and perseverance!

···

On Apr 4, 12:43 am, Tim Hunter <TimHun...@nc.rr.com> wrote:
--
Luis Lavena

Hey Luis,

I've been working on trying to do a MinGW environment, so that I can
work on a MinGW Compile of wxRuby for Windows. The only thing I have
to say, is congrats, and you have made my day! The sandbox
development environment that you setup with the rakefiles, is exactly
what I needed, so desperately. Thank you so much for this, I'm
running the rake for installer3, to get everything I need setup. I
seriously recommend that you setup a OCI just for the Development
Environment itself!

Another great news!, wow, now three major extensions/gems that works
with MinGW build!

wxRuby, RMagick and Ruby-GNOME (comment on my blog [1])

This is excellent!

MinGW and MSys has unfortunatly come up short for
me on many occasions on trying to get a full compiler environment
setup on Windows, that I'm use to on Linux, through their installers,
and setups. If things work the way that I believe they are going to,
this is going to make my day!

Yeah, getting a MinGW environment is a real pain. I tried create it
manually several times that got tired and wrote the first rake tasks
to do it for me :wink:

Keep up the good work, (Especially for us developers who are less then
familiar with trying to get Ruby going, let alone work on our own
Extensions! LOL)

Hehehe, I will :smiley:

L8ers,

---
Mario Steele

[1] http://blog.mmediasys.com/2008/03/29/progress-of-one-click-installer-rubyinstaller/

Regards,

···

On Mar 28, 4:02 pm, euma...@gmail.com wrote:
--
Luis Lavena

I saw a post saying an rmagick mingw gem was available. Any word on how
we can get it, or how to compile it?
Thanks.
-R

/me hopes for mini-tutorial :slight_smile:

···

--
Posted via http://www.ruby-forum.com/\.

Dunno if a gem is available, only they succeed building with it with
MinGW.

You can ask them for pointer at their forum:

http://rubyforge.org/forum/?group_id=12

Regards,

···

On May 9, 12:14 am, Roger Pack <rogerpack2...@gmail.com> wrote:

Luis Lavena wrote:
> Hello List,

> I'm happy to announce that huge progress (hack-a-ton) was made this
> weekend to bring a new implementation of One-Click Installer for
> Windows!

I saw a post saying an rmagick mingw gem was available. Any word on how
we can get it, or how to compile it?

--
Luis Lavena

Hi,

At Tue, 25 Mar 2008 06:04:52 +0900,
Luis Lavena wrote in [ruby-talk:295564]:

> Note that binary gems don't work only because they install their
> binary aspect into the wrong directory (and, if you have the newer
> versions of rubygems, auto-install a version which doesn't exist so
> you'd need to specify you want the win32 gem). Once you install it
> you can easily copy the .so's to the right directory and they will
> 'probably' work just fine.

Not that, RubyGems consider each platform by it's own. I snot the same
darwin8 to cygwin, so mingw32 shouldn't be considered a compatible
match to mswin32.

Darwin and cygwin are completely different systems, but mingw32
and mswin32 are for the same system.

Not only mingw, gcc is basically intended to be binary
interface compatible with the system native development
environments. So cygwin is the special case in this sense.

In a overlooked way you could be correct, but that is too simplistic
way to look things. When you start seeing errors due exception thrown
inside shared object we can find several and big issues.

Consider that the code generated by VC6 is not the same MinGW
generates. It even differs in several places on how it do things.

Binary interface compatible means that they use same calling
convension, same utility functions, same runtime DLL etc, but
not generated code are identical.

···

On Mar 24, 5:54 pm, rogerdpack <rogerpack2...@gmail.com> wrote:

--
Nobu Nakada

That's the idea! Since I'll not be able to build every gem for ruby
out there, make it easy or put a familiar environment that users than
run for themselves.

That also requires that the gems you're talking about consider Windows
(VC or MinGW or whatever) as something valid to get it up and running
with it.

Regards,

···

On 26 mar, 14:48, "ara.t.howard" <ara.t.how...@gmail.com> wrote:

On Mar 26, 2008, at 11:39 AM, rogerdpack wrote:

> I think very useful would be a mingw build of ruby that included some
> popular gems pre-built (that is...<cough> mongrel, sqlite, mysql,
> maybe ruby-debug). Assuming that those gems only need to be compiled
> in mingw and it works like a charm.

but, if you have ruby and mingw installed all you need to do to
install these is 'gem install sqlite', etc. i compiled the gsl this
way and it was a peice of cake. ruby + compiler = joy.

--
Luis Lavena

hmm, I found a rreadline-0.5.4.tar.gz on a FreeBSD mirror.
adding the rreadline folder to site_ruby and a writing readline.rb as follows:

require 'rreadline/RReadline'

fixes the 100% CPU usage for me, at least in irb.

Thanks

Michal

···

On 28/03/2008, Michal Suchanek <hramrach@centrum.cz> wrote:

On 28/03/2008, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
>
> This is all working very smoothly for me, following the recipe.
>
> I ended up with a ruby/mingw32 installation which my program can use to
> dynamically compile its parts that are generated C code, and run 20%-50%
> faster than using msvc6 and oci. This is also far preferable than
> requiring users to have msvc6 installed if they make changes that
> require recompilation of the generated C code.
>
> The only slight hiccup was figuring out that I needed to put
> sandbox/ruby_mingw/bin on my PATH, but that's really pretty obvious.
>
> I hope someone is able to fix readline, though...

I have read something about pure ruby readline on this list. There's
something on RAA but the linked site is down.