Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to package Railties 3.1.4 with rpm #222

Closed
mathie opened this issue May 16, 2012 · 12 comments

Comments

@mathie
Copy link

@mathie mathie commented May 16, 2012

Trying to bundle up all our gem dependencies into an RPM for deployment, I came across a curious error:

Processing files: gem-bundle-2012.05.16.11.23.25-1
error: File not found: [...]/ruby/1.9.1/gems/railties-3.1.4/lib/rails/generators/rails/plugin_new/templates/gem-bundle%.gemspec

It turns out that railties has a file called %name%.gemspec, and a directory called %name%. I guess that RPM is helpfully substituting %name with the package name. I'm not terribly familiar with RPM any longer, but http://www.rpm.org/wiki/PackagerDocs/Macros (search the page for '%%') seems to suggest that literal % signs should be escaped by doubling them up?

Meanwhile, I'm going to work around it by nuking those files for now – we won't be templating up any new Rails apps in production anyway. :)

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented May 16, 2012

haha, fpm finds all kinds of strange behaviors in rpm ;)

I'll have a go at reproducing this and fixing it with the %% escape. Thanks for reporting!

@rajatvig

This comment has been minimized.

Copy link
Contributor

@rajatvig rajatvig commented May 24, 2012

Bothered by the same one right now for Railties 3.2.3 with an error like

RPM build errors:
Macro %_binary_filedigest_algorithm has empty body
Macro %_binary_payload has empty body
Macro %_binary_filedigest_algorithm has empty body
Macro %_binary_payload has empty body
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/callcenter%.gemspec
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/controllers/callcenter%/application_controller.rb.tt
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/helpers/callcenter%/application_helper.rb.tt
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/callcenter%/application.html.erb.tt
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%/engine.rb
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%/version.rb
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/callcenter%.rb
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/lib/tasks/callcenter%_tasks.rake
File not found: /tmp/package-rpm-build20120524-4701-39cn6v/BUILD/var/lib/nginx/callcenter/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/generators/rails/plugin_new/templates/test/callcenter%_test.rb

@steakknife

This comment has been minimized.

Copy link

@steakknife steakknife commented May 27, 2012

+1

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented May 29, 2012

I've tried many different attempts to escape '%' in filenames. All have failed. I've escalated to the rpm mailling list seeking aid :)

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented May 29, 2012

This might actually be the nail in rpmbuild's coffin. Could use this bug as incentive to finish my work on the pure-ruby rpm read/write library (reading is already implemented).

@hatless

This comment has been minimized.

Copy link

@hatless hatless commented Aug 7, 2012

Meh. Nuking the files too. Not so good, as this could result at some point in apps blowing up due to missing files referenced by some require somewhere.

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Aug 7, 2012

indeed, I'll see if I can come up with a solution here.

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Aug 7, 2012

I got it working with --exclude

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Aug 7, 2012

This is the command known to fail:

  • fpm -s gem -t rpm -v 3.2.3 railties

This succeeds:

  • fpm -s gem -t rpm -v 3.2.3 --exclude '*%*' railties

It excludes any files with '%' in the name.

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Aug 7, 2012

% ruby bin/fpm -s gem -t rpm --exclude '*%*' -v 3.2.3 railties 
Successfully installed railties-3.2.3
1 gem installed
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.AcNxKs
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ObIpLk
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.KqoVLc
Processing files: rubygem-railties-3.2.3-1.noarch
Wrote: /tmp/package-rpm-build20120807-6642-1wnw47m/RPMS/noarch/rubygem-railties-3.2.3-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.XP9hH8
Created rpm {"path":"rubygem-railties-3.2.3-1.noarch.rpm"}
@hatless

This comment has been minimized.

Copy link

@hatless hatless commented Aug 10, 2012

Much obliged.

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Sep 26, 2012

Thanks to #266:

% ruby bin/fpm -s gem -t rpm -v 3.1.4 railties 
Fetching: railties-3.1.4.gem (100%)
Successfully installed railties-3.1.4
1 gem installed
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.p0kJc1
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.nvzVgT
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.lnJJlL
Processing files: rubygem-railties-3.1.4-1.noarch
Wrote: /tmp/package-rpm-build20120926-22163-vyi0bj/RPMS/noarch/rubygem-railties-3.1.4-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.v53PtG
Created rpm {"path":"rubygem-railties-3.1.4-1.noarch.rpm"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.