Skip to content

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

Merged
yahonda merged 1 commit into
rails:7-0-stablefrom
yahonda:7-0-stable_ruby33
Mar 28, 2023
Merged

Make bundle exec blade build success with Ruby 3.3.0dev at 7-0-stable#47789
yahonda merged 1 commit into
rails:7-0-stablefrom
yahonda:7-0-stable_ruby33

Conversation

@yahonda

@yahonda yahonda commented Mar 28, 2023

Copy link
Copy Markdown
Member

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

yahonda commented Mar 28, 2023

Copy link
Copy Markdown
Member Author

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

@yahonda

yahonda commented Mar 28, 2023

Copy link
Copy Markdown
Member Author

@yahonda
yahonda merged commit d296f57 into rails:7-0-stable Mar 28, 2023
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

yahonda commented Jun 23, 2023

Copy link
Copy Markdown
Member Author

Backported to the 6-1-stable branch via be19736

@yahonda
yahonda deleted the 7-0-stable_ruby33 branch April 19, 2024 01:40
@zzak

zzak commented Jun 21, 2024

Copy link
Copy Markdown
Member

@yahonda Did you delete this repo? https://github.com/yahonda/cookiejar

zzak added a commit to zzak/rails that referenced this pull request Jun 21, 2024
zzak added a commit to zzak/rails that referenced this pull request Jun 21, 2024
eileencodes added a commit that referenced this pull request Jun 21, 2024
[6-1-stable] Revert "Merge pull request #47789 from yahonda/7-0-stable_ruby33"
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.

2 participants