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

Add FreeBSD support #1073

Merged
merged 8 commits into from
Mar 2, 2016
Merged

Conversation

amdprophet
Copy link
Contributor

Based on PR #870.

This PR backports symlink capabilities from TarWriter which eliminates the need to rely on the minitar gem. I'm not sure if there's a better place for the backported code to exist but this code appears to be functional.

This PR also implements checksums using SHA256 instead of SHA1 (as per the pkg spec) and now supports pre/post install/rm scripts.

@jordansissel
Copy link
Owner

I don't have any freebsd boxes, but this seems OK to me. I'm content to let the community play with it sooner than later. <3

@jordansissel
Copy link
Owner

@amdprophet you want this merged now? or do you need more feedback?

@amdprophet
Copy link
Contributor Author

@jordansissel merge away :)

On Wed, Mar 2, 2016, 7:13 AM Jordan Sissel notifications@github.com wrote:

@amdprophet https://github.com/amdprophet you want this merged now? or
do you need more feedback?


Reply to this email directly or view it on GitHub
#1073 (comment).

jordansissel added a commit that referenced this pull request Mar 2, 2016
@jordansissel jordansissel merged commit b405bae into jordansissel:master Mar 2, 2016
@amdprophet amdprophet deleted the add_freebsd branch March 2, 2016 19:32
@dch
Copy link

dch commented Mar 2, 2016

Thanks so much for this! @jordansissel is it possible to tag a release of fpm soon? This would be a good reason to add fpm itself to FreeBSD ports tree, and get cracking on using this.

@jordansissel
Copy link
Owner

@dch That's on my todo list, however, I am reluctant to release a new version of fpm with tests failing, and some tests are currently failing :\

Maybe I can do a release with a caveat that some tests are failing and hope for the best?

@dch
Copy link

dch commented Mar 4, 2016

OK that makes sense. How about I look at porting this using a git sha reference, that will be enough to start with.

@jordansissel
Copy link
Owner

This PR uses refinements which are not available on Ruby 1.9.x or older. Before fpm gets a new release, this probably needs to get fixed, maybe.

@jordansissel
Copy link
Owner

I will try doing a release that requires Ruby 2.0.0 (available for 3 years now) and see how people react.

@shaddi
Copy link

shaddi commented Mar 8, 2016

Convenient timing! I just cloned the fpm repo and ran into an issue (on Ubuntu 14.04, the last LTS release) with this.

shasan@mcgrupp:~/playpen/fpm$ make
rm -rf .yardoc
sh notify-failure.sh rspec
/home/shasan/playpen/fpm_tests/fpm/lib/fpm/package/freebsd.rb:139:in `<module:TarWriterAddSymlink>': undefined method `refine' for TarWriterAddSymlink:Module (NoMethodError)
    from /home/shasan/playpen/fpm_tests/fpm/lib/fpm/package/freebsd.rb:138:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.9.1/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/shasan/playpen/fpm_tests/fpm/lib/fpm.rb:19:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/shasan/playpen/fpm_tests/fpm/spec/fpm/command_spec.rb:3:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in load_spec_files'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load_spec_files'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:97:in `setup'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
    from /usr/local/bin/rspec:23:in `load'
    from /usr/local/bin/rspec:23:in `<main>'
make: *** [test] Error 1

This is after a git clone of the repo then a bundle install from the top level as described in the README. I realized after digging into this a bit (totally new to Ruby) that 'refine' was introduced in ruby 2.0, and the ruby version shipped in 14.04 LTS is ruby 1.9.3. While there is a ruby2.0 package available in the Ubuntu repos, it doesn't set itself up as the default interpreter for ruby on the system. Unfortunately, it looks like the Ubuntu team isn't planning to fix this issue (https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1310292), so LTS users are stuck with ruby 1.9.3 unless they manually fix the symlinks.

Anyway, this isn't really an fpm issue, it's an Ubuntu one, and I'm fully supportive in general of using language features that have been around for 3+ years. Just consider this one reaction to a release that will require ruby 2.0.0. :-)

@jordansissel
Copy link
Owner

@shaddi hah, nice timing ;)

I'll open a separate ticket for tracking Ruby 1.9 issues.

@jordansissel
Copy link
Owner

@shaddi opened #1075 for this.

@shaddi
Copy link

shaddi commented Mar 8, 2016

Awesome, thanks!

@samriang
Copy link

@shaddi I'm stuck with this issue too. Did you solve it on Ubuntu 14 lts?

@shaddi
Copy link

shaddi commented Mar 16, 2016

Nope, I just rolled back to before this was merged. Our org is probably going to move to 16.04LTS going forward, so hopefully this is not an issue there.

@ptomulik
Copy link
Contributor

I've proposed "corefines" to fix this issue, see #1088 and/or #1087.

jordansissel added a commit that referenced this pull request Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants