Closed NicholasBHubbard closed 1 year ago
Thanks for the patch. I’m still taking care of sick family and will be unavailable for an unknown amount of time.
Take care @jordansissel . Family is always first,
for anywho is facing this with ruby upgrade, update your gemfile like this
gem 'fpm', git: 'https://github.com/NicholasBHubbard/fpm.git', branch: 'replace-deprecated-methods'
and thank you @NicholasBHubbard for the patch.
gem 'fpm', git: 'https://github.com/NicholasBHubbard/fpm.git', branch: 'replace-deprecated-methods'
ERROR: While executing gem ... (Gem::UnknownCommandError)
Unknown command fpm,
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:204:in find_command' /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:249:in
invoke_command'
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:191:in process_args' /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:149:in
run'
/usr/local/share/ruby/site_ruby/rubygems/gem_runner.rb:51:in run' /usr/bin/gem:10:in
It would be nice to push an update after this is in because it is broken on latest ruby.
Fixing newer versions is good, but we gotta check if this breaks older versions. Picking my favorite ancient version of ruby to see how long ago these methods have existed, it appears that File::exist?
and Dir::exist?
have been in Ruby since at least Ruby 1.9.3. Citations:
I'm OK to replace the methods as proposed.
Checking dependencies:
File.exists?
~> 1.0.0
and v1.0.1 invokes Dir.exists?
I haven't tried running the test suite yet, so I don't know if anything fails on Ruby 3.2.0 (fpm's GitHub Actions also doesn't use 3.2 at this time).
One option which might help without causing too much of a stir in fpm's dependencies: we could monkey patch File and Dir to add back these removed methods. It's possible to attend to these dependencies with upgrades, but we might find upgrading them causes older versions of ruby to fail, even very recent versions of ruby.
reviewing dependencies further -- https://github.com/jordansissel/fpm/pull/1981#issuecomment-1411330564
I haven't tried running the test suite yet, so I don't know if anything fails on Ruby 3.2.0 (fpm's GitHub Actions also doesn't use 3.2 at this time).
Should be able to fix that here: https://github.com/jordansissel/fpm/blob/main/.github/workflows/ruby.yml
I’ll work on a release as time permits.
On Tue, Jan 31, 2023, at 6:08 PM, Jordan Sissel wrote:
Merged #1981 https://github.com/jordansissel/fpm/pull/1981 into main.
— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/pull/1981#event-8405509848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2TQXMBMESUXFHDEOVTWVHATFANCNFSM6AAAAAATMJ2MAE. You are receiving this because you are subscribed to this thread.Message ID: @.***>
v1.15.1 released with this patch
Thanks Jordan!
Thank you Jordan. Much appreciated
On Wed, Feb 1, 2023 at 8:58 AM Nicholas Hubbard @.***> wrote:
Thanks Jordan!
— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/pull/1981#issuecomment-1412394504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACNHEV4L43J2MQIUWQICITWVKI5FANCNFSM6AAAAAATMJ2MAE . You are receiving this because you commented.Message ID: @.***>
Ruby 3.2.0 was just released, and the deprecated methods
File.exists?
andDir.exists?
were completely removed. These methods are used in FPM, so FPM is currently broken under Ruby 3.2.0. Instead we are supposed to use theFile.exist?
andDir.exist?
methods. This PR replaces all occurrence of these deprecated methods with their preferred counterpart.