[Rubygems-developers] [rubygems] Build still broken (#1149)

Anatol Pomozov anatol.pomozov at gmail.com
Sat Dec 23 04:04:41 EST 2006


Hi, Eric.

And that is the root of the problem. On *nix rake returns 1 on Windows - 0
exit code. Is here any Rake guys who could explain this strange behaviour?

I've added patch that cures tests.

There you could find another issue. See test/test_gem_ext_rake_builder.rb
windows redirector adds all STDERR output to the end of STDOUT output. So
order of "fail" words changed.

On 12/23/06, Eric Hodel <drbrain at segment7.net> wrote:
>
> On Dec 22, 2006, at 02:39, Anatol Pomozov wrote:
> > On 12/22/06, Eric Hodel <drbrain at segment7.net> wrote:
> > On Dec 21, 2006, at 03:05, Anatol Pomozov wrote:
> > > On 12/20/06, Cerberus < anatol.pomozov at gmail.com> wrote:
> > >   1) Failure:
> > > test_class_build_fail(TestGemExtRakeBuilder) [./test/
> > > test_gem_ext_rake_builder.rb:46]:
> > > <Gem::InstallError> exception expected but none was thrown.
> > >
> > > As I see RubyGems could not correctly define that Rake finished
> > > with error
> > > This is what RubyGems do
> > >       unless $?.exitstatus.zero? then
> > >         raise Gem::InstallError, "#{class_name} failed:\n\n#
> > > { results.join "\n"}"
> > >       end
> > >
> > > But Rake finishes with return code == 0 on windows even if some
> > > error present. I dunno why, better to ask Rake developers.
> >
> > What does this script print?
> >
> > system 'ruby -e "raise"'
> > p $?
> >
> > I get:
> >
> > $ ruby -ve test.rb
> > ruby 1.8.5 (2006-12-04 patchlevel 2) [ i686-darwin8.8.2]
> > -e:1: unhandled exception
> > #<Process::Status: pid=28805,exited(1)>
> > $
> > I get following output
> > -e:1: unhandled exception
> > #<Process::Status: pid=5428,exited(1)>
> >
> > But if I create file Rakefile with following content (as in test)
> > task :extension do abort 'fail' end
> >
> > and try to invoke it (as in RubyGems code)
> >
> > `rake.bat extension`
> > p $?
> >
> > I would get following output
> >
> > C:\work\opensource\ruby\rubygems\~my>rake-error-outstatus.rb
> > fail
> > #<Process::Status: pid=7788,exited(0)>
> >
> > So as you see `rake` returns us zero exitcode even if we have
> > failure during Rake execution.
> >
> > It is Windows. What do you have under *nix?
>
> $ ruby -e '`rake extension`; p $?'
> fail
> #<Process::Status: pid=29518,exited(1)>
>
> > > Anyway this is how I define that rake finished with error in
> > Cerberus.
> > >
> > >   def successful?
> > >     $?.exitstatus == 0 and not @output.include?("rake aborted!")
> > >   end
> > >
> > > I dont think that it is very elegant (what if user would print this
> > > message from Rake code) but it works both on Windoze and *nix.
> > >
> > > Any comments on this subject?
>

-- 
anatol (http://feeds.feedburner.com/apomozov-eng)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rubygems-developers/attachments/20061223/f1ec7ace/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_test.diff
Type: text/x-diff
Size: 1020 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20061223/f1ec7ace/attachment.bin 


More information about the Rubygems-developers mailing list