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

Make bundle exec blade build success with Ruby 3.3.0dev at 7-0-stable #47789

Merged
merged 1 commit into from Mar 28, 2023

Conversation

yahonda
Copy link
Member

@yahonda yahonda commented Mar 28, 2023

Motivation / Background

This commit addresses the CI failure at 7-0-stable branch since ruby/ruby#7039 https://buildkite.com/rails/rails/builds/94361#0186a504-e06f-4f75-bcb6-df93822f78ed/3283-3286

Detail

This pull request addresses the bundle exec blade build error

  • Without this commit
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
bundler: failed to load command: blade (/home/yahonda/.rbenv/versions/3.3.0-dev/bin/blade)
/home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)

    PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n'
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `new'
  • With this commit
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
Building assets…
$

This Pull Request has been created because [REPLACE ME]

Additional information

This commit has been made on top of 7-0-stable not main branch because blade has been removed from main branch via #46206

blade gem depends on cookiejar indirectly as follows. blade depending on faye depending on em-http-request depending on cookiejar

To use cookiejar with Ruby 3.3 it needs dwaite/cookiejar#52 merged. Instead of using https://github.com/koic/cookiejar/tree/suppress_deprecation_warning_for_regexp_n_flag branch cherry-pick the commit a73e526 because the this pull request may be changed like addressing RuboCop offenses.

blade is only used for testing this change should be enough.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

This commit addresses the CI failure at 7-0-stable branch since ruby/ruby#7039
https://buildkite.com/rails/rails/builds/94361#0186a504-e06f-4f75-bcb6-df93822f78ed/3283-3286

- Without this commit

```ruby
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
bundler: failed to load command: blade (/home/yahonda/.rbenv/versions/3.3.0-dev/bin/blade)
/home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)

    PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n'
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `new'
```

- With this commit

```ruby
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
Building assets…
$
```

This commit has been made on top of `7-0-stable` not `main` branch
because `blade` has been removed from main branch via rails#46206

`blade` gem depends on `cookiejar` indirectly as follows.
`blade` depending on `faye` depending on `em-http-request` depending on `cookiejar`

To use `cookiejar` with Ruby 3.3 it needs dwaite/cookiejar#52 merged.
Instead of using `https://github.com/koic/cookiejar/tree/suppress_deprecation_warning_for_regexp_n_flag` branch cherry-pick the commit a73e526 because the this pull request may be changed like addressing RuboCop offenses.

blade is only used for testing this change should be enough.

Co-authored-by: Koichi ITO <koic.ito@gmail.com>
@yahonda
Copy link
Member Author

yahonda commented Mar 28, 2023

@koic This pull request is making use of dwaite/cookiejar#52 so I added you as co-author of this commit.

@yahonda
Copy link
Member Author

yahonda commented Mar 28, 2023

@yahonda yahonda merged commit d296f57 into rails:7-0-stable Mar 28, 2023
3 checks passed
yahonda added a commit to yahonda/rails that referenced this pull request Jun 23, 2023
Make `bundle exec blade build` success with Ruby 3.3.0dev at 7-0-stable
@yahonda
Copy link
Member Author

yahonda commented Jun 23, 2023

Backported to the 6-1-stable branch via be19736

@yahonda yahonda deleted the 7-0-stable_ruby33 branch April 19, 2024 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant