#198 new
kevin (at kev)

Build script inherits Merb environment, causes rake failures [Passenger]

Reported by kevin (at kev) | January 7th, 2010 @ 07:58 PM

We were having inexplicable build failures (rake test) with Integrity running under Phusion Passenger. We could successfully run the build script from the builds/CHECKOUT/MD5 directory, but any time the script was invoked by Integrity, the builds would fail with an error related to loading fixtures.

I traced the problem to the fact that when Integrity launches the build script, it uses IO.popen(...), which launches a new process that inherits the current process' environment. This means the build script runs with the RUBYOPT, GEM_HOME, GEM_PATH and PATH of the Merb app. Calling rake in the build script would invoke integrity/bin/rake, and RUBYOPT included Integrity's bundled gems environment.rb. Both of these appeared to be causing the problem.

By resetting these ENV variables within our build script, we were able to make our build work properly again:

export PATH=/usr/local/bin:/usr/bin:/bin
unset RUBYOPT
unset GEM_HOME
unset GEM_PATH
...
rake test

I'm not sure what specifically can be done to fix this in Integrity, as I believe all methods of launching child processes inherits the ENV. It might be helpful to include a sample build script that documents this behavior.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Automated continuous integration server that doesn't suck.

Shared Ticket Bins

People watching this ticket

Pages