[katello-devel] When to do bundle install

Ivan Nečas inecas at redhat.com
Wed Aug 3 11:52:05 UTC 2011


On 08/03/2011 01:06 PM, Lukas Zapletal wrote:
> On 08/02/2011 06:33 PM, Justin Sherrill wrote:
>> I'm confused what this buys us?  Just because a gem is listed in
>> Gemfile.lock doesn't mean that rails will expect it to be there when it
>> starts?
>>
>>  From my experience it works like this:
>>
>> 1) bundler looks at Gemfile to determine what gems to load
>> 2) bundler looks at Gemfile.lock to determine what versions of what gems
>> to load.
>
> That is true, but this only moves the "bundle install" step from our 
> RPM to user. When Rails 3 app starts for the first time and there is 
> no lock file, it creates one (= will do its own "bundle install"). We 
> could take advantage of it and do this:
>
> 1) Delete the Gemfile.lock from our RPM
> 2) Erase the :development and :test sections in the Gemfile
> 3) Create symlink Gemfile.lock to /var/lib/katello
>
> There is a little problem here. Since Gemfile.lock is generated file, 
> we have no control over it. What happens when user makes an upgrade 
> and some dependency version changes. We would need to delete the lock 
> file before each start. I would rather have it in the RPM and ask user 
> to upgrade the package.
>
>> I'm not sure what this will improve over the current setup.
>
> The improvement is the explicit creation of the lock file during the 
> build phase. It must be created at some point, why not to create it 
> under our control. We can also track dependency errors (when version 
> numbers does not match in the Gemfile and RPMs, or when packages are 
> just missing).
>
> If you know either how to disable lockfile generation or use, or 
> disable whole bundler stuff in Rails 3, just tell us and we would do 
> it. But I still see the best path in getting this in our SPEC file.
>

I don't think it's possible/suitable to avoid bundler. AFAYK bundler was 
integrated to Rails 3 to replace the old, not always working mechanism 
of specifying required versions. I think it's quite useful to have it, 
so it checks the dependencies. The fact, that bundler fails after 
installing RPM is not the problem of bundler itself (in fact it works 
just fine - that's what we would expect, when we specify versions of 
some gems, and they are not available). The problem is with the missing 
Gemfile.lock, so we don't specify explicitly what gems to use, and so 
bundler tries his best to do it itself in the installation phase.
> http://bit.ly/oL5nNF
>
> Objections?
>
Regards
Ivan




More information about the katello-devel mailing list