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

Bump Ruby 3.4.1 #1056

Closed
guillaumewrobel opened this issue Jan 4, 2025 · 21 comments · Fixed by #1057 · May be fixed by #1065
Closed

Bump Ruby 3.4.1 #1056

guillaumewrobel opened this issue Jan 4, 2025 · 21 comments · Fixed by #1057 · May be fixed by #1065

Comments

@guillaumewrobel
Copy link

guillaumewrobel commented Jan 4, 2025

warning: parser/current is loading parser/ruby34, which recognizes 3.4.0-compliant syntax, but you are running 3.4.1.

@iliabylich
Copy link
Collaborator

Yes, that's expected, see #1046.

@guillaumewrobel
Copy link
Author

Thanks for the PR @iliabylich and kudos for the great work 🙏

@iliabylich
Copy link
Collaborator

#1057 has been reverted, I've merged it by accident. Like the linked issue above says I'm not backporting changed anymore (and I can always recommend you to switch to prism), so it's unclear if 3.4.x release of parser is going to ever happen.

@guillaumewrobel
Copy link
Author

I see. Though, it's annoying that all Rubocop users will see the deprecation warning

warning: parser/current is loading parser/ruby34, which recognizes 3.4.0-compliant syntax, but you are running 3.4.1.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

for each boot.

@Earlopain
Copy link
Contributor

RuboCop only ever loads a specific parser version, that doesn't emit such a warning (parser/33 vs parser/current). Without knowing more specifics, I'd say one of your extensions is the cause.

For example, I fixed the same warning in rubocop-erb which used Parser::CurrentRuby directly to process erb code snippets instead of using ProcessedSource from RuboCop.

@iliabylich
Copy link
Collaborator

There should be a warning for 3.4.0 as well (because even 3.4.0 changes haven't been fully backported), but somehow when we branched out ruby34.y we didn't set version in parser/current.rb to 3.4.0-dev. I would say it's a bug that will cause some confusion but there's nothing critical. People would use 3.3 parser otherwise which is basically identical to current 3.4, they would only have a different warning message so again, not a big issue in terms of runtime behavior.

@Earlopain
Copy link
Contributor

Yes, I agree it's ok the way it is now, considering the state of the project. Only some fringe syntax changes and nothing where I think the average user would notice. It's more along the lines of those known incompatibilities in the readme.

Basically no one will run 3.4.0 since 3.4.1 was released almost immediately after so that small mistake is even smaller because of that.

@navidemad
Copy link

navidemad commented Jan 20, 2025

We are in ruby 3.4.1 and we are seeing the warnings too with parser (3.3.7.0)

warning: parser/current is loading parser/ruby34, which recognizes 3.4.0-compliant syntax, but you are running 3.4.1.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.`

.ruby-version

3.4.1

@artemave
Copy link

As above. In my case this is caused by i18n-tasks gem that is requiring parser/current. I reckon there will be a growing list of similar comments accumulating here.

@navidemad
Copy link

I had the warning due to i18n-tasks gem also, @artemave i made a PR to suppress the warning meanwhile:
glebm/i18n-tasks#613

@navidemad
Copy link

navidemad commented Jan 21, 2025

I am wondering if the easiest fix will be:

when /^3\.4\./
    current_version = '3.4.0'
    current_version = '3.4.1' <<<
    if RUBY_VERSION != current_version
      warn_syntax_deviation 'parser/ruby34', current_version
    end

Because between ruby 3.4.0 and 3.4.1 there was only few hours apart and it will avoid many warnings :)
#1065

@Earlopain
Copy link
Contributor

The parser gem is not able to correctly parse any 3.4 version, and likely never will. #1046

The fact that there is a warning is correct even though it's message is not entirely accurate. It recognizes 3.3 syntax.

@simi
Copy link

simi commented Feb 2, 2025

@Earlopain Yes, I agree it's ok the way it is now, considering the state of the project. Only some fringe syntax changes and nothing where I think the average user would notice. It's more along the lines of those known incompatibilities in the readme.

I don't agree it is ok the way it is now. Per my understanding it should say "parser doesn't support Ruby 3.4", not "it is using wrong 3.4.x version".

@iliabylich
Copy link
Collaborator

@koic @Earlopain Will rubocop break if we change 3.4.0 version in parser/current.rb to 3.4.0-dev? Rubocop's test suite passes for me locally (we have a ./ci/run_rubocop_specs script to quickly test it) but I'd like to double-check it with you.

@Earlopain
Copy link
Contributor

That should be totally fine. It doesn't use parser/current, and the warning would already be emitted anyways since 3.4.0 was basically skipped by Ruby.

@iliabylich
Copy link
Collaborator

iliabylich commented Feb 4, 2025

Thanks, I'll fix it in the next release

@koic
Copy link
Collaborator

koic commented Feb 5, 2025

@iliabylich

we have a ./ci/run_rubocop_specs script to quickly test it

It appears that this has already been confirmed. I have confirmed it has passed. Thank you for taking care of this.

@iliabylich
Copy link
Collaborator

I've released v3.3.7.1. Now it shows the warning even for 3.4.0 (as expected).

@simi
Copy link

simi commented Feb 5, 2025

@iliabylich I'm still not sure the warning explains properly current situation.

irb(main):001> require 'parser/current'
warning: parser/current is loading parser/ruby34, which recognizes 3.4.0-dev-compliant syntax, but you are running 3.4.0.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
=> true

Would it make sense to change warning and make it clear parser doesn't support 3.4 at all. Or at least update the readme compatibility section?

@iliabylich
Copy link
Collaborator

Labeling a grammar with -dev suffix is what we did before with incomplete versions of the grammar that are in development.

What would you like to be in this warning? Feel free to send a PR.

@simi
Copy link

simi commented Feb 6, 2025

Labeling a grammar with -dev suffix is what we did before with incomplete versions of the grammar that are in development.

What would you like to be in this warning? Feel free to send a PR.

Is the current situation different to previous ones, since there is no plan to support 3.4 and newer and prism is recommended? At least, that's my understanding reading issues around this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants