-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update to JRuby 9.4
#14861
Update to JRuby 9.4
#14861
Conversation
58dfef7
to
42982c1
Compare
b71f73e
to
9966e09
Compare
4ebb9a8
to
85eceb5
Compare
Jenkins test this please |
85eceb5
to
cea997f
Compare
rubyUtils.gradle
Outdated
def gemDir = "${projectDir}/vendor/bundle/jruby/2.6.0".toString() | ||
jruby.setLoadPaths(["${projectDir}/vendor/bundle/jruby/2.6.0/gems/bundler-2.4.13/lib".toString(), "${projectDir}/vendor/jruby/lib/ruby/stdlib".toString()]) | ||
def gemDir = "${projectDir}/vendor/bundle/jruby/3.1.0".toString() | ||
jruby.setLoadPaths(["${projectDir}/vendor/bundle/jruby/3.1.0/gems/bundler-2.4.13/lib".toString(), "${projectDir}/vendor/jruby/lib/ruby/stdlib".toString()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either we apply the same change as in #15066, or need to update the path to be bundler-2.4.14, released 3 days ago https://rubygems.org/gems/bundler/versions/2.4.14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think should use the Bundler shipped with JRuby and avoid bootstrapping one on our own. So, in this perspective, it should include also the changes proposed with #15066. I can rebase this after the other has been merged into main
@@ -67,8 +67,8 @@ | |||
it "install the gems" do | |||
expect(::Bundler::LogstashInjector).to receive(:inject!).with(be_kind_of(LogStash::PluginManager::PackInstaller::Pack)).and_return([]) | |||
|
|||
expect(::LogStash::PluginManager::GemInstaller).to receive(:install).with(/logstash-input-packtest/, anything) | |||
expect(::LogStash::PluginManager::GemInstaller).to receive(:install).with(/logstash-input-packtestdep/, anything) | |||
expect(::LogStash::PluginManager::GemInstaller).to receive(:install).with(/logstash-input-packtest-/, anything) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit that introduces the changes is 0c92eb3.
Without this change, the test fail:
SPEC_OPTS="-fd -P spec/unit/plugin_manager/pack_installer/local_spec.rb" ./gradlew clean :logstash-core:rubyTests --tests org.logstash.RSpecTests
with
Failures:
1) LogStash::PluginManager::PackInstaller::Local when the local file exist when the pack is valid install the gems
Failure/Error: expect(::LogStash::PluginManager::GemInstaller).to receive(:install).with(/logstash-input-packtest/, anything)
(LogStash::PluginManager::GemInstaller (class)).install(/logstash-input-packtest/, anything)
expected: 1 time with arguments: (/logstash-input-packtest/, anything)
received: 2 times with arguments: (/logstash-input-packtest/, anything)
# ./spec/unit/plugin_manager/pack_installer/local_spec.rb:70:in `block in <main>'
# ./lib/bootstrap/rspec.rb:36:in `<main>'
Finished in 0.04501 seconds (files took 0.02848 seconds to load)
5 examples, 1 failure
Failed examples:
rspec ./spec/unit/plugin_manager/pack_installer/local_spec.rb:67 # LogStash::PluginManager::PackInstaller::Local when the local file exist when the pack is valid install the gems
org.logstash.RSpecTests > rspecTests[core tests] FAILED
java.lang.AssertionError: RSpec test suite `core tests` saw at least one failure.
at org.junit.Assert.fail(Assert.java:88)
at org.logstash.RSpecTests.rspecTests(RSpecTests.java:72)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the reg exp /logstash-input-packtest/
is matched 2 times:
- one with
logstash-input-packtest...
- another with
logstash-input-packtestdep...
I wasn't able to understand why previously it worked and now it receives 2 matches. Also previously it had been to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really strange that it worked before and now doesn't. main and this PR are using the same version of rspec, but bundler and jruby are different.
13b04b1
to
dcc798b
Compare
We can remove the workaround:
|
Then again, maybe not, still broken on aarch64:
Which lines up correctly to the comment here: jruby/jruby#7579 (comment) |
The 🔴 CI errors, once launched locally with
fails to start Logstash:
Also launching locally fails with same error, and happens that because the gradle build
Fails with
that should be fixed by #15066 |
Jruby: 9.3.40 -> 9.4.0.0 Ruby: 2.6 -> 3.1
With Ruby 2.7 was deprecated the usage of `_1` (`_<n>`) identifier for future reseved usage. With Ruby 3.0 the new synthax for "numbered parameters" was used, avoiding the usage of `_n` as method names. Treetop's generated grammar contained `def _n` methods, mainly implied to the usage of `_` symbol in LSCL grammar. This commit rename the `_` rule in the grammar to `cs` and replaces everywhere it's needed. Explanation at cjheath/treetop#49
…bundled with JRuby
…eds fallback: false
…has to be expaded
…ode. Prefer URI::Parser's escape
…de from Errno::ECONNREFUSED to Errno::EBADF
…rsion.rb file that else make Logstash's irb explode
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
e3906bd
to
19b1da5
Compare
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Fixes the warning: warning: nested repeat operator '?' and '*' was replaced with '*' in regular expression /\s?*,\s*/ happening at: logstash-core/lib/logstash/instrument/metric_store.rb
The two warnings are: - lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_f - lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…rohibited format (#15500) (#15501) Updates invocations of i18n.t method which are leftovers and missed in the original Ruby 3.1 update PR #14861 Without this, some error reporting logs are hidden by the mismatch of arguments error in translate the error message. (cherry picked from commit 90964fb) Co-authored-by: Andrea Selva <selva.andre@gmail.com>
Release notes
What does this PR do?
LSCL
andgrammar
treetop from_
which would generated methods in the formdef _0
(deprecated since2.7
) tosc
.I18n.t
method doesn't accept hash as second argumentURI.encode
->URI.encode_www_form_component
URI.encode
has been replaced with same functionality withURI::Parser.new.escape
YAML.load
needs explicitfallback: false
to return false when the yaml string is empty (or contains only comments)JavaClass
has been removed, now it can usejava.lang.Class
directlythwait
to satisfyrequire "thwait"
(InGemfile.template
andlogstash-core/logstash-core.gemspec
)clone
to bedef clone(*args)
Enumeration.each_slice
which fromRuby 3.1
is chainable and doesn't returnnil
. JRuby fixed in Ruby 3.1 support jruby/jruby#7015Down.download
arguments map ca16bbenil
in the list of couples used inHash[ <list of couples> ]
which from Ruby3.0
generates anArgumentError
initialize (
is forbidden. 29b607dKernel#open
doesn't fallback toURI#open
, fixed test code that used that to verify open port. e5b70derdoc/
folder from vendored JRuby elsebin/logstash -i irb
would crash, commit b71f73eWhy is it important/What is the impact to the user?
Checklist
Author's Checklist
9.3.4.0
#14114lib/jni
and glibc, PR to fix in LS is Workaround for #14873 #14890. Verify if port to this or remove the original effort if it's resolved in9.4.x
in the meantime.irb
works:bin/logstah -i irb
How to test this PR locally
Related issues
Use cases
Screenshots
Logs