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

Backport #3250 to 5-x-stable branch #3306

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

amatsuda
Copy link
Member

@amatsuda amatsuda commented Jan 20, 2023

Currently released stable version of webpacker (5.4.3) does not work on the newest stable Ruby (3.2.0) because webpacker 5.4.3 includes Dir.exists? and File.exists? that were removed in Ruby 3.2.

Hence, the current situation is that Rails 6.1 users cannot upgrade to Ruby 3.2 because there's no webpacker that supports that versions stack. We could solve this situation by backporting a single commit from #3250.

Please consider merging this and cutting the version 5.4.4 release from 5-x-stable branch. Then probably people would stop complaining to the Ruby-core on the Ruby BTS about this error from webpacker... https://bugs.ruby-lang.org/issues/19352

Closes #3299

`Dir.exists?` and `File.exists? were removed by ruby/ruby#5352.
It will be the following error in Ruby 3.2.

```console
% ruby -ve 'File.exists?("foo.rb")'
ruby 3.2.0dev (2021-12-28T15:22:18Z master 39b3aa4fb3) [x86_64-darwin19]
-e:1:in `<main>': undefined method `exists?' for File:Class (NoMethodError)

File.exists?("foo.rb")
    ^^^^^^^^
Did you mean?  exist?
```

And this PR enables `Lint/DeprecatedClassMethods` cop to detect these deprecated methods.
@dlupu
Copy link

dlupu commented Jan 27, 2023

💯 would appreciate this to be done soon.

@byroot byroot merged commit be0efe9 into rails:5-x-stable Jan 31, 2023
@amatsuda amatsuda deleted the 5-x-exists branch January 31, 2023 22:28
@amatsuda
Copy link
Member Author

amatsuda commented Feb 1, 2023

@byroot Thank you for working on this!

@dlupu
Copy link

dlupu commented Feb 11, 2023

@byroot, thanks for backporting this and releasing version 5.4.4. Any chance you can do something about #3308 ?

@byroot
Copy link
Member

byroot commented Feb 11, 2023

Thanks for letting me know. Unfortunately I don't have an NPM account, hence not the ownership of the package. I relayed the issue to rails-core.

@byroot
Copy link
Member

byroot commented Feb 13, 2023

@dhh released the 5.4.4 a few minutes ago: https://www.npmjs.com/package/@rails/webpacker so you should be good now.

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.

None yet

4 participants