|The Ruby greener test challenge (a Windows challenge)||Luis Lavena||6/25/12 7:54 AM|
Since I started RubyInstaller 4 years ago, ensuring that Ruby worked on every
single release took time.
Back then, my hardware was limited, so running Ruby tests took a considerable
amount of time (more than one cup of tea using tea cups scale).
Not only that, even after 4 years and different versions of Ruby and Windows,
Ruby still have some failures:
Finished tests in 526.522392s, 21.2128 tests/s, 3665.2629 assertions/s.
11169 tests, 1929843 assertions, 9 failures, 2 errors, 80 skips
Wouldn't be awesome that Ruby own tests were all green on Windows?
The truth is that having Ruby achieve `0F0E` (0 failures, 0 errors) will help
detect real errors, not to mention automate the testing process, perhaps
allowing teams have *nightly builds* of Ruby to play with.
Following a similar idea from Ruby 1.9.3 Documentation Challenge , I would
like to propose some test-fixing hunt!
Reach 0 failures and 0 errors for Windows (MinGW) in the upcoming weeks, is
not that hard: 9 failures and 2 errors.
The target is Ruby **trunk** (upcoming 2.0), but I expect these fixes be
backported to Ruby 1.9.3 too.
## I have no idea how to compile things...
I heard *I would like to help but have no idea how to compile Ruby*, and I
know is not easy, so that is why I present to you the **Ruby Challenge Kit**
Those of you who are well versed in the art of compiling can skip to the next
### Ruby Challenge Pack
The Ruby Challenge Pack is a single-file package that provides all the tools
require to compile, test and fix Ruby. Once extracted, it provides:
- Ruby 1.9.3-p194 (required as base to compile Ruby).
- 32bits DevKit GCC 4.6.1 (based on TDM builds).
- 32bits support libraries (OpenSSL, zlib, libffi, libyaml, etc).
- Easy 1-click batch to start a tailored Command Prompt
- Easy 1-step batch to compile Ruby and run basic tests
- A document (README) describing how compile and send your fixes.
What is not included and you need is:
- A working Git installation on your computer (recommended is msysGit).
- A clone of Ruby source from GitHub 
MD5 for verification:
After download of the package, extract into a directory *without spaces*
(e.g. C:\RubyChallenge) and check the included README for instructions (or
For those using the Ruby Challenge Pack, simply run `quick-compile.bat`
as indicated in the documentation.
For others, do what you do and always verify Ruby core tests pass:
Compiling will take long, depending on your system. You can go and grab
a cup of tea while it completes.
## Running and fixing tests
Once you've compiled Ruby, you can run the tests:
make test-all TESTS="-q"
Above command will run **all** Ruby tests, which could take around 10
Once it completes, you should get a list that only contains the errors. For
example, let's look at the following one:
[ 3348/11169] TestEnv#test_win32_blocksize = 0.00 s
Errno::EINVAL expected but nothing was raised.
Notice the file where the test failed: `test/ruby/test_env.rb` and the line
Now open your editor/IDE, find that file, open it, and locate the failing
Figure out if the test is valid and Ruby is failing or is test that is not
meant to be run on Windows.
At any time, you can email RubyInstaller group  and ask questions,
everybody will be pleased to help you out.
Once you find a solution, modify the file and run the tests again, but this
time just for a single file:
make test-all TESTS="-q ruby/test_env.rb"
## Sending your patches
You fixed a test, great! Now is time to send this to Ruby developers so they
can apply it.
Open a ticket on Ruby-trunk  tracker and assign it to me (luislavena).
I'll review and merge accordingly.
To reduce changes people stepping into each other, please email RubyInstaller
group  before to announce or see if others are working on that particular
## A big thank you
There is no such thing as small contributions, all contributions are valuable.
Help us make a better Ruby.
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éry
|Re: [TheCodeShop] The Ruby greener test challenge (a Windows challenge)||dmajkic||6/25/12 3:53 PM|
> For those using the Ruby Challenge Pack, simply run `quick-compile.bat`This failed on my machine. It killed CMD.exe garbling the screen, so I
suspect that it collides with ansicon.
It worked when I manually did those:
./configure --enable-shared --disable-install-doc debugflags=-g
make all test
make test-all TESTS="-q"
... but then it freezes at:
[ 6290/10867] TestOpen3#test_commandline
|Re: [TheCodeShop] The Ruby greener test challenge (a Windows challenge)||Luis Lavena||6/25/12 3:57 PM|
On Mon, Jun 25, 2012 at 7:53 PM, Dušan D. Majkić <dma...@gmail.com> wrote:Oh yeah, a lot of things don't play nice with ANSICON. We had the same
problem RubyInstaller, make + ANSICON last year.
Please disable ANSICON before attempting to compile from the batch
file, ANSICON will try to hook cmd.exe and the child processes
(make.exe) which will fail and crash.
You can "set ANSICON_EXC=make.exe" to exclude it from being hooked.
The good thing is that Ruby 2.0 doesn't require external tools for
ANSI coloring anymore ;-9
Thanks for pointing it out.
|Re: [RubyInstaller] Re: [TheCodeShop] The Ruby greener test challenge (a Windows challenge)||Luis Lavena||6/25/12 11:21 PM|
Please tell us which revision you have cloned and if you have any existing instalation of ruby, gcc or something like that.
Sorry for top posting. Sent from mobile.
On Jun 26, 2012 3:18 AM, "lizzy leiz" <liz...@gmail.com> wrote:
|Re: [RubyInstaller] Re: [TheCodeShop] The Ruby greener test challenge (a Windows challenge)||Luis Lavena||6/26/12 7:10 AM|
On Tue, Jun 26, 2012 at 10:51 AM, lizzy leiz <liz...@gmail.com> wrote:
> El martes, 26 de junio de 2012 03:21:26 UTC-3, Luis Lavena escribió:> I cloned trunk from github.com/ruby/ruby, commit
> 9ac51c29930fa92a32186e7c217fa219915487c6. I go back in history about 10
> commits but it's the same.
I just tried the same commit and worked.
However, I took the output from your first message (the configure output)
And compared against my local build. Here is the diff:
You will notice that is failing to obtain the size of int, functions
like memmove and others.
This might indicate that there is something else interfering with the
configure process, which is resulting in broken information.
Do you have cygwin or another MinGW installation that is always in the PATH?
Do you have something like ANSICON installed in the AutoRun section?
(if you used ansicon -i)
Can you check the config.log for the first lines, when it check for
size of int, what is the command output?
If you can attach config.log (and not paste since is too big) will be great.
|Re: [RubyInstaller] Re: [TheCodeShop] The Ruby greener test challenge (a Windows challenge)||lizzy leiz||6/26/12 4:59 PM|
I see MinGW in the PATH only when I'm in the console provided in the challenge package.
When I search for it, I find files with "MinGW" in the name, under directories like Ruby192, RubyChallenge, Octave, HacketyHack and Arduino, but not in other place. Git bash doesn't use it?
I didn't see it in my AutoRun, and "ansicon" command in command line fails.
|Re: [RubyInstaller] Re: The Ruby greener test challenge (a Windows challenge)||Luis Lavena||7/13/12 11:50 AM|
On Fri, Jul 13, 2012 at 2:37 PM, Oleg Sukhodolsky <os9...@gmail.com> wrote:
> I have tried to build ruby with the package and build fails rather early
> with the following error:
I believe I mentioned this error before:
> 131 line of the problematic file is:
> | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
> This doesn't looks like a good macro ;)
> Is this a known problem? How I can workaround it?
See link provided above, I got no answer from poster, so will be great
get your feedback :)
> I use Windows7 64bits, ruby's revision is
I tested that version last night, and it worked.
Can you tell me if other looks like FRAPPS, ANSICON, existing
MinGW/Cygwin/MSYS installations around that could be affecting?
What "gcc --version" says after you open the command prompt shortcut?
Can gcc compile a simple program, like hello world?
And compile with "gcc hello.c -o hello.exe"
That should work, and if not, then try with "-v" option so we get debug output.
Please use pastie.org or gist.github.com if the output you provide is
long so we keep readability :)
|Re: [RubyInstaller] Re: The Ruby greener test challenge (a Windows challenge)||Oleg Sukhodolsky||7/13/12 12:38 PM|
not exactly, the problem described in the message was caused by the
fact that configure was unable to
get size of int. In my case it calculate the size correctly, but
fails to check memmove.
not sure what FRAPPS and ANSICON is and how to check if I have them.
At least command prompt doesn't know such commands.
I do no MinGW/Cygwin/MSYS in paths.
gcc (tdm-1) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc compiles the problem and the problem works fine.
Here is a complete config.log -
Thanks in advance, Oleg.
|Re: [RubyInstaller] Re: The Ruby greener test challenge (a Windows challenge)||Luis Lavena||7/13/12 12:56 PM|
On Fri, Jul 13, 2012 at 4:38 PM, Oleg Sukhodolsky <os9...@gmail.com> wrote:
>> Hello,int is just one example, if you take a look to the diff I mentioned in
that message, lot of things were missing:
All marked with red (-) were missing in the user build.
Sorry, an extra P was in the name...
Ok, I believe I found the culprit, and is caused by the way git
default clone on Windows.
It is required that you clone Ruby repository using LF line endings,
for which I recommend you do:
git config --global core.autocrlf false
Then you will need to reset your clone (git reset --hard), change
branches so it resets or will need to clone it again.
Please try and let us know.
|Re: [RubyInstaller] Re: The Ruby greener test challenge (a Windows challenge)||Oleg Sukhodolsky||7/13/12 1:53 PM|
Yes, it was the case. I've updated repository and was able to build it.
I think it is worth to add this hint to README.
Thanks you for your help.
|Re: [RubyInstaller] Re: The Ruby greener test challenge (a Windows challenge)||Luis Lavena||7/13/12 1:57 PM|
On Fri, Jul 13, 2012 at 5:53 PM, Oleg Sukhodolsky <os9...@gmail.com> wrote:
>> Ok, I believe I found the culprit, and is caused by the way gitI can't re-upload the package without altering the MD5 of it, so I
think will send a note stating this change.
Thanks to you for helping my spot the issue!