-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JSON, REXML, and ruby 1.9.3 works again! #1950
Conversation
@edolnx I'm not sure if this patch helps your journey on #1949, but maybe it does? I was able to produce deb and rpm packages with fpm 1.14.2 (plus this PR's patch) using Ruby 1.9.3 from the docker ruby:1.9.3 container image.
|
9a6be36
to
3b8645e
Compare
I did a bit of digging tonight and found a few open issues related to |
The 14 pending tests are because I don't have virtualenv setup on my workstation. |
The original `json` gem dependency was added in the original fpm.gemspec because, at the time, Ruby 1.8.7 was common and required an external `json` dependency for parsing JSON. Later, Ruby releases since 1.9.1 have bundled `json`[1]. Therefore, it feels safe to remove this dependency. As a bonus, the rubygems `json` gem places requirements on the minimum version of Ruby. At this time, the latest `json` gem requires Ruby >= 2.3. If the `json` gem dependency is removed, fpm will still retain the ability to process JSON while lowering the minimum required Ruby version to Ruby 1.9.x -- It's not perfect, but it's a start! :) [1] https://docs.ruby-lang.org/en/2.3.0/NEWS-1_9_1.html The idea for this change change came originally from a discussion with @edolnx in #1949 Fixes #1741, #1264, #1949
On older versions of rubygems, `Gem::Version.new(...)` calls `String#strip!` on the argument in the constructor. This causes a problem on Ruby 1.9.3 where the RUBY_VERSION constant is a frozen string. The workaround is to make a copy of this string that is unfrozen, and `String#dup` seems to work :)
3b8645e
to
ac0ecdd
Compare
fpm 1.15.0 is released and contains this improvement. |
This change allows at least some of fpm to work under Ruby 1.9.3. I can produce rpms and debs using Ruby 1.9.3 and this patch!
The
osxpkg
format doesn't seem to work for me on Ruby 1.9.3 because REXML seems to crash with an error.This is accomplished by:
json
dependency which has been included in Ruby by default since Ruby 1.9.1rubygems
under Ruby 1.9.3You, reader, may be asking, "Why?"
In #1949, we discuss raising the minimum version of ruby required by fpm. At time of writing, the minimum version is set to '>= 1.9.3', and I'm somewhat slow to raise it without good cause.
Historically, there's been a race for some Ruby libraries to abandon older versions of ruby. However, as a sysadmin, I'm keenly aware that many folks may not have the authority to upgrade Ruby on their systems, so it feels natural to continue keep fpm compatible with older versions of Ruby.
I've tried to be consistent in this strategy:
Related issues: