FPM broken for Ruby 1.8 #607

Closed
blalor opened this Issue Dec 29, 2013 · 11 comments

Comments

Projects
None yet
5 participants

blalor commented Dec 29, 2013

FPM broke on Ruby 1.8.7 with the release of FPM 1.0.0.

For fpm -s python -t rpm supervisor I get:

/usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/util.rb:44:in `safesystem': undefined method `include?' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/package/python.rb:164:in `load_package_info'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/package/python.rb:150:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/package/python.rb:150:in `load_package_info'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/package/python.rb:90:in `input'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/command.rb:292:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/command.rb:291:in `each'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/command.rb:291:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/lib/fpm/command.rb:436:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.0.0/bin/fpm:8
    from /usr/bin/fpm:19:in `load'
    from /usr/bin/fpm:19

I have this problem with FPM 1.0.0 and 1.0.1. Downgrading FPM to 0.4.42 allows me to build the RPM successfully.

Why would you want to support a version that doesn't get stable builds anymore? Just sayin'

blalor commented Jan 22, 2014

On Jan 22, 2014, at 2:31 PM, Jordon Bedwell notifications@github.com wrote:

Why would you want to support a version that doesn't get stable builds anymore? Just sayin’

Because there’s a large installed distro base that uses 1.8. ie every supported CentOS instance.

Owner

jordansissel commented Jan 22, 2014

Oops, sorry for breaking things! Lemme see what I can do to fix this.

Owner

jordansissel commented Jan 22, 2014

@envygeeks Why support an old ruby? Why support an EOL'd ruby? Because lots of users still use CentOS 5 or other distros and are, through a variety of reasons, unable to upgrade ruby. Given the tiny amount of energy it requires to keep fpm working on ruby 1.8, I see no reason to punish users for using a ruby version they cannot control :)

Fair enough, I didn't know the state of RPM Distros was worse than those of us who use Debian. I thought it was bad that we still don't have access to 2.0.0 in a proper Deb but you guys have it far worse than we do.

fwiw, I also see this error with Ruby 1.9.1 on Ubuntu with fpm-1.0.2

/var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/util.rb:44:in `safesystem': undefined method `include?' for nil:NilClass (NoMethodError)
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/package/python.rb:164:in `block in load_package_info'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/package/python.rb:150:in `chdir'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/package/python.rb:150:in `load_package_info'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/package/python.rb:90:in `input'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/command.rb:292:in `block in execute'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/command.rb:291:in `each'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/command.rb:291:in `execute'
    from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/lib/fpm/command.rb:440:in `run'
    from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /var/lib/gems/1.9.1/gems/fpm-1.0.2/bin/fpm:8:in `<top (required)>'
    from /usr/local/bin/fpm:19:in `load'
    from /usr/local/bin/fpm:19:in `<main>'

imbstack commented Feb 4, 2014

I was seeing this error when running on machine where the $SHELL environment variable was not set. Setting it (to /bin/bash in my case) made everything work again. Just thought that might be helpful information for anyone who stumbles across this.

You can see why on line 38 of util.rb

@jordansissel jordansissel self-assigned this Feb 5, 2014

Owner

jordansissel commented Feb 5, 2014

@bis12 Indeed, that's the problem.

I'm working on a patch that includes tests to cover these cases.

Owner

jordansissel commented Feb 5, 2014

% rspec -e "safesystem" -f doc
....
FPM::Util
  #safesystem
    with a missing $SHELL
      should assume /bin/sh
      should still run commands correctly
    with $SHELL set to an empty string
      should assume /bin/sh
      should still run commands correctly
...
Owner

jordansissel commented Feb 5, 2014

# rvm system,1.9.3,2.1.0 do sh -c 'if rspec > /dev/null 2> /dev/null; then echo -n "SUCCESS "; else echo -n "FAIL "; fi; ruby --version'
SUCCESS ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
SUCCESS ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
SUCCESS ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
Owner

jordansissel commented Feb 5, 2014

Took longer than necessary because I found an unrelated regression that would randomly fail the tests.

jordansissel added a commit that referenced this issue Feb 5, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

gerbercj added a commit to gerbercj/fpm that referenced this issue Feb 27, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

gerbercj added a commit to gerbercj/fpm that referenced this issue Feb 27, 2014

gerbercj added a commit to gerbercj/fpm that referenced this issue Mar 11, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

gerbercj added a commit to gerbercj/fpm that referenced this issue Mar 11, 2014

gerbercj added a commit to gerbercj/fpm that referenced this issue Apr 25, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

gerbercj added a commit to gerbercj/fpm that referenced this issue Apr 25, 2014

@solarkennedy solarkennedy referenced this issue in deric/mesos-deb-packaging Sep 3, 2014

Merged

Adjusted build_mesos to build 0.20 style python debs #8

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

jordansissel added a commit that referenced this issue Apr 24, 2015

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)

jordansissel added a commit that referenced this issue Jun 20, 2016

Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment