Bug 717088 - Bundle install should not be in spec - breaks build
Summary: Bundle install should not be in spec - breaks build
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Infrastructure
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-06-27 23:16 UTC by Jeff Weiss
Modified: 2019-09-26 13:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 17:47:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeff Weiss 2011-06-27 23:16:55 UTC
Description of problem:
see http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/katello-build/134/console

bundle install --without 'test development' --local
[31mCould not find gem 'rails (= 3.0.5, runtime)' in any of the gem sources.[0m
error: Bad exit status from /var/tmp/rpm-tmp.b35UJe (%build)


Version-Release number of selected component (if applicable):
e97f3229a2f95ae4841bc549b7e4515b1df2c97f

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Mike McCune 2011-06-27 23:30:08 UTC
We don't have a BuildRequires for:

rubygem(bundler) 

and also, why the switch to a 'bundle install' during the RPM installation?  This will end up pulling in the requirement that the build boxes all have rails installed on them just so we can build katello.

Comment 2 Lukas Zapletal 2011-06-28 09:07:31 UTC
@Jeff you are missing rails gem in your system. The RPM package rubygem-rails is not installed and thats the reason why bundle install fails. As I already wrote on the list I highly recommend to build SRPM first and then install all the dependencies with yum-builddep:

# tito -srpm ...
# yum-builddep katello......src.rpm
# tito -rpm 

Until now one could "build" Katello on any box (even without Ruby language) because we had nothing in the build section. Actually it was only about compressing a tarball. Now the process really needs all the build requires. That is pretty standard approach =) And it is also the reason why it fails.

I also highly recommend to move the build process into the Brew/Koji as soon as possible. Hudson is not good place do to builds as the environment is not stable. In Koji every build is done on clean box with minimum dependencies.

@Mike we do have build require for bundler. (028854df48d5543d95f46905d7dab14dcff7e826) Did you pull recently?

The reason is well described in [katello-devel] Bundler deployment strategy thread. Let me sum up the motivation here: the Gemfile.lock is not valid across various distro versions (Fedoras, RHEL in the future) and until now one was not able to run bundler in the production setup (it would fail because of dependencies). Now the bundler is properly configured.

Running bundle install in the spec is good idea because it checks for all dependencies which we specify in the Gemfile. It also creates the Gemfile.lock that matches the distribution the RPM is built for. Please note the --local parameter that forbids pulling from the network - it only use system-wide rubygems (and actually does not install anything). The "bundle install" is misleading, but this is how Bundler works. It should be named "bundle lock" I know.

Tagging as NOTABUG, feel free to ping me if you need more information or support.

Comment 3 Lukas Zapletal 2011-06-28 10:22:40 UTC
Ah now I understand. We are missing BuildRequire: rubygem(rails) and others. Well this is a problem as I'd need to add them all. We dont have all of them in RPMs.

Okay. Moving this out of the spec. This "bundle install --local" is a good check thus I will add it to our init script as a hidden parameter probably.

It should be building again for you, Jeff.

http://koji.fedoraproject.org/koji/taskinfo?taskID=3165680
http://koji.fedoraproject.org/koji/taskinfo?taskID=3165675

Comment 4 Lukas Zapletal 2011-06-28 10:46:41 UTC
89a9405629154182fe3e5b041195b7e0041c17f1

Comment 5 Jeff Weiss 2011-06-28 14:05:41 UTC
Verified, katello-0.1.49-1.git.28.29c05a8.fc14.noarch


Note You need to log in before you can comment on or make changes to this bug.