I came across something by doing the following :
- i had to have a pre build job, which would generate some header files which would be included by the source of the current cbp project
- these were generated by calling a ruby script
- however the ruby to be used could not be the 'modern' system installed version, but an 'old' one which was installed via rbenv, which basically boils down to, the entire system used the modern one, except the top directory of the development workspace (and beneath) uses the old one
So when running in a shell at the location where the cbp file resides :
rbenv versions
system
1.8.7-p370
* 1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
rbenv version
1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
ruby --version
ruby 1.8.7 (2013-12-23 patchlevel 375) [x86_64-linux]
However when those commands would be fed as the "pre build tasks" : rbenv versions && rbenv version && ruby --version
[100.0%] Running project pre-build steps
rbenv versions && rbenv version && ruby --version
system
1.8.7-p370
* 1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux-gnu]
==> it is again using the system ruby !!!
I was able to solve this, as follows , specify as pre build command : /bin/bash -lc "rbenv versions && rbenv version && ruby --version"
and then we get :
[100.0%] Running project pre-build steps
/bin/bash -lc "rbenv versions && rbenv version && ruby --version"
system
1.8.7-p370
* 1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
1.8.7-p375 (set by /home/killerbot/Projects/XXX/.ruby-version)
ruby 1.8.7 (2013-12-23 patchlevel 375) [x86_64-linux]
So why is the shell started by CB not inheriting all the things it could ? should ?
Should we have a check mark in order to get that inheritance (eg that CB then knows to run everything through "/bin/bash -lc "......" ?
What do you think ?