On Thu, 24 Apr 2008 11:24:40 -0500
Charles Oliver Nutter <[EMAIL PROTECTED]> wrote:

> Manfred Usselmann wrote:
> [...]
> 
> > Every build is stared with a command like
> > 
> > jruby.bat -e "require 'rubygems' rescue nil; require 'rake'; load
> > 'D:/build/cruisecontrol/tasks/cc_build.rake'; ARGV << '--nosearch'
> > << '--trace' << 'cc:build'; Rake.application.run; ARGV.clear"  
> > 
> > which results in
> > 
> > << was unexpected at this time.
> > 
> > This could be solved if concat would be used instead of the push
> > operator:
> > 
> > jruby.bat -e "require 'rubygems' rescue nil; require 'rake'; load
> > 'D:/build/cruisecontrol/tasks/cc_build.rake'; ARGV.concat
> > ( ['--nosearch', '--trace', 'cc:build' ] ); Rake.application.run;
> > ARGV.clear"  
> > 
> > Maybe this could be changed within cc.rb? 
> 
> This is a problem with our JRuby startup script...in order to pull
> off -J arguments we preparse the command line. I would wager that
> we're not pulling off the << correctly, or otherwise there's some
> parsing issue. Can you show us the full error?

'<< was unexpected at this time.' is all I get. 
Here is a small example:

- - - - - - - - - - - - - - - - - - - - - - - - - - 
C:\>jruby -e "test=['1','2','3'];test << '4' << '5'; puts test"
<< was unexpected at this time.

C:\>jruby -e "test=['1','2','3'];test.concat( ['4','5'] ); puts test"
1
2
3
4
5
C:\>
- - - - - - - - - - - - - - - - - - - - - - - - - - 

> 
> >> Another issue: I could not find out how to stop a running builder
> >> process if I run it with 'cruise start'. If I kill the app with
> >> Ctrl-C the builder keeps running in the background and I need to
> >> find the belonging java.exe in the task manager... My current
> >> workaround is to use 'cruise start -w' and start 'cruise build'
> >> separately. I have not yet investigated how to set up
> >> cruisecontrol as daemon or service under Windows.
> >>
> >> And when I request a build via the web browser dashboard the build
> >> process starts to loop. The file  'build_requested' does not get
> >> removed.
> > 
> > Any suggestion what the reason for this could be or how this could
> > be fixed?
> 
> Hmm...not sure I follow. This is for builds spun up in a given JVM,
> yes? To be able to kill/shutdown the child process?

Yes, the first part is related to builder processes continuing to run as
independend processes in the background when I stop the running 'cruise
start' with Ctrl-C.

Here the code which starts the builder process.

- - - - - - - - - - - - - - - - - - - - - - - - - - 
builder_starter.rb:

  def self.begin_builder(project_name)
    cruise_executable =
        if Platform.interpreter =~ /jruby/
          Platform.interpreter + ' ' + path_to_cruise
        elsif Platform.family == 'mswin32'
          "ruby #{path_to_cruise}"
        else
          path_to_cruise
        end

    verbose_option = $VERBOSE_MODE ? " --trace" : ""
    command = "#{cruise_executable} build #{project_name}#{verbose_option}"

    Platform.create_child_process(project_name, command)
  end


platform.rb:

  def create_child_process(project_name, command)
    if Kernel.respond_to?(:fork)
      begin
        pid = fork || exec(command)
        pid_file = File.join(RAILS_ROOT, 'tmp', 'pids', 'builders', 
"#{project_name}.pid")
        FileUtils.mkdir_p(File.dirname(pid_file))
        File.open(pid_file, "w") {|f| f.write pid }
      rescue NotImplementedError   # Kernel.fork exists but not implemented in 
Windows
        Thread.new { system(command) }
      end
    else
      Thread.new { system(command) }
    end
  end
  module_function :create_child_process
- - - - - - - - - - - - - - - - - - - - - - - - - - 


The problem with the requested build is a separate problem, where the
file 'build_requested' does not get removed after the requested build
has finished, although it should be by the statement "FileUtils.rm_f(Dir
[build_requested_flag_file])" in project.rb.

Thanks,
Manfred


 
_______________________________________________
Cruisecontrolrb-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Reply via email to