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

Eric Hodel drbrain at segment7.net
Sat Dec 23 02:28:35 EST 2006


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?
>
-- 
Eric Hodel - drbrain at segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!



More information about the Rubygems-developers mailing list