[katello-devel] When to do bundle install (was: Installing on F15)
Lukas Zapletal
lzap at redhat.com
Mon Aug 1 07:48:59 UTC 2011
On 07/29/2011 04:23 PM, Brad Buckingham wrote:
>>>
>> well.. I did this form the rpm.. so I assume I need to add a bug to
>> the rpm to not include this file? (Gemfile.lock fyi)
>>
>> -- bk
>>
> +1. Please do open a bug for this one. Thanks!
But only as a temporary workaround.
We should definitely *distribute* the Gemfile.lock file. It is the main
idea of Bundler - to lock all the gem versions to make sure everybody
(incl. end users) are running on the correct versions. But we are not
doing it correctly right now as we distribute the one from our git. That
is definitely not the right way.
Bundler (Rails) wont start without this file and it must be created
using "bundle install" command. At the end of the day we should have it
in the build section of our spec file. It will "lock" itself in the
correct (mock) environment and users are forced to use the correct versions.
We already had it there (**), but there were some issues with
dependencies, so I had to remove it. Basically we would need to have all
the rubygem requires also included in the buildrequires. I dont know if
there is a spec macro or something that would automate this thing. Or we
would need to keep Require and BuildRequire lines the same.
This step would also require us to really have all the RPMs on the
building machines physically. We are currently able to "build" RPMs on
boxes that has just gettext rubygem and few other deps, because its all
about making a tarball at the moment.
The side-effect of this is we wont be able to build in Fedora Koji until
we get all the rubygems into the Fedora, because the mocker needs it
there. I think we could live with that.
To finally get rid of "bundle install" issues we need to take the
following steps:
1) Add all the required gems as BuildRequires
2) Install all the deps to our building machines
3) Add bundler install --local command to the SPEC
4) Distribute the generated Gemfile.lock
Please note "bundle install" does not install anything if all the
required rubygems are already installed. It will just create the lock
file. Providing the "--local" option we disallow downloading during
this, so error is reported if no system-wide rubygem is found.
If we do this, users will be not facing these issues any more. If we hit
dependency issues the RPM wont be created. So it's prevention.
I could do more testing and find out if this is feasible. There could be
also an option to get rid of the Bundler in production mode, but I dont
know how to run Rails without it.
(**) - e97f3229a2f95ae4841bc549b7e4515b1df2c97f
--
Later,
Lukas Zapletal | E32E400A
RHN Satellite Engineering
Red Hat Czech s.r.o. Brno
More information about the katello-devel
mailing list