Commit graph

46 commits

Author SHA1 Message Date
github-actions[bot]
00898bd560
For custom java plugins, set the platform = 'java'. (#16628) (#16649)
(cherry picked from commit 046ea1f5a8)

Co-authored-by: Nicole Albee <2642763+a03nikki@users.noreply.github.com>
2024-11-06 08:54:06 +00:00
github-actions[bot]
0657729cb7
bump jruby to 9.4.9.0 (#16634) (#16639)
(cherry picked from commit 6703aec476)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2024-11-06 08:23:32 +00:00
João Duarte
121b1c9632
update jruby to 9.4.8.0 (#16278)
https://www.jruby.org/2024/07/02/jruby-9-4-8-0.html

> Fixed a bug in the bytecode JIT causing patterns to execute incorrect branches. #8283, #8284
> jruby-openssl is updated to 0.15.0, with updated Bouncy Castle libraries to avoid CVEs in older versions.
> uri is updated to 0.12.2, mitigating CVE
> net-ftp is updated to 0.3.7 with restored functionality on JRuby.

Exhaustive test suite: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/580
2024-07-02 19:57:55 +01:00
João Duarte
4350855e7b
upgrade jruby to 9.4.7.0 (#16125) 2024-05-02 09:59:04 +01:00
João Duarte
96e4838e43
Fix exclusion of old ruby-maven-libs 3.3.9 jars (#16032) 2024-03-27 14:40:03 +00:00
João Duarte
59bd376360
upgrade ruby-maven-libs to 3.8.9 (#15894)
Given that JRuby comes with ruby-maven-libs 3.3.9 this commit upgrades the gem to 3.8.9 and ensures files from 3.3.9 are not included in the distribution.
2024-03-18 14:30:13 +01:00
João Duarte
14dc3d24a4
bump jruby to 9.4.6.0 and remove ffi workaround (#15961) 2024-02-22 09:47:42 +00:00
Mashhur
6a44d9df68
Update JRuby core to 9.4.5.0 of rubyUtils.gralde (#15671) 2023-12-07 11:29:16 -08:00
Ry Biesemeyer
70081bbcac
deps: downgrade jruby, keep updated default-gem dependencies (forward-port #15283) (#15369)
* deps: downgrade jruby, keep updated default-gem dependencies (#15283)

forward-ports non-release-branch components of #15283 to `main`

* deps: downgrade jruby, keep updated default-gem dependencies

By downgrading JRuby to 9.4.2.0 we avoid the silent global crash of the
scheduler backing `Concurrent::TimerTask` that occurs when Jruby 9.4.3.0's
invokedynamic promotes a method to run natively, incorrectly.

Upstream bug: https://github.com/jruby/jruby/issues/7904

Along with the downgrade of JRuby itself to 9.4.2.0, we cherry-pick the
updates to gems that were included in the latest JRuby 9.4.3.0 to ensure
we don't back out relevant fixes to stdlib.

We also remove a pinned-dependency on `racc` that is no longer relevant.

Resolves: https://github.com/elastic/logstash/issues/15282

* Imported the licenses for some gems

- cgi
- date
- ffi-binary-libfixposix
- io-console
- net-http
- net-protocol
- reline
- time
- timeout
- uri

* specs: avoid mocking global ::Gem::Dependency::new

* build: remove redundanct dependsOn declaration

* deps: notice use of ffi-binary-libfixposix via Ruby license

this gem is tri-licensed `Ruby` / `EPL-2.0` / `LGPL-2.1-or-later` and
the Ruby license is preferred to EPL when available

---------

Co-authored-by: andsel <selva.andre@gmail.com>

* deps: add license notices for gems moved from default to bundled

---------

Co-authored-by: andsel <selva.andre@gmail.com>
2023-10-03 14:32:28 -07:00
João Duarte
98c3d30ca8
Remove custom bundler (#15066)
* reintroduce bundler patches for bundler < 2.4
2023-06-29 08:59:54 +02:00
Andrea Selva
26d1c7ccdb
Update to JRuby 9.4 (#14861)
Set of changes to make Logstash compatible to JRuby 9.4.
Bundle JRuby 9.4.3.0

- Redefine space token in `LSCL`  and `grammar` treetop from `_` which would generated methods in the form `def _0` (deprecated since `2.7`) to `sc`.
- `I18n.t` method doesn't accept hash as second argument
- `URI.encode` has been replaced with same functionality with `URI::Parser.new.escape`
- `YAML.load` needs explicit `fallback: false` to return false when the yaml string is empty (or contains only comments)
- JRuby's  `JavaClass` has been removed, now it can use `java.lang.Class` directly
- explicitly require gem `thwait` to satisfy `require "thwait"` (In `Gemfile.template` and `logstash-core/logstash-core.gemspec`)
- fix not args `clone` to be `def clone(*args)`
- fix `Enumeration.each_slice` which from `Ruby 3.1` is [chainable](https://rubyreferences.github.io/rubychanges/3.1.html#enumerableeach_cons-and-each_slice-return-a-receiver) and doesn't return `nil`. JRuby fixed in https://github.com/jruby/jruby/issues/7015
- Expanded `Down.download` arguments map ca16bbed3c302006967413eb9d3862f2da81f7ae
- Avoid to pass `nil` in the list of couples used in `Hash[ <list of couples> ]` which from Ruby `3.0` generates an `ArgumentError`
- Removed space not allowed between method name and parentheses `initialize (` is forbidden. 29b607dcdef98f81a73ad171639fd13aaa65e243
- With [Ruby 2.7 the `Kernel#open`](https://rubyreferences.github.io/rubychanges/2.7.html#network-and-web) doesn't fallback to `URI#open`, fixed test code that used that to verify open port. e5b70de54c5301f51a767da67294092af0cfafdc
- Avoid to drop `rdoc/` folder from vendored JRuby else `bin/logstash -i irb` would crash, commit b71f73e9c6edb81a7b7ae1305047e506f61c6e8c

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2023-06-28 13:05:43 +02:00
Mashhur
2ccf1a0596
Upgrade bundler version used in ruby utils. (#15109) 2023-06-22 10:11:15 +01:00
João Duarte
feb3ee0506
use setLoadPaths instead of RUBYLIB (#15059) 2023-05-24 11:06:00 +01:00
João Duarte
fd2b1ff340
added psych to dependency list and updated NOTICE.txt (#15050)
* replace jruby-complete with jruby-core in build tasks
* place bundler in the rubylib path for testing
2023-05-23 14:16:40 +01:00
Andrea Selva
a126364102
Centralized version definition for snakeyaml and shadow plugin used in buildscripts (#14952)
Create a variable in the Gradle's 'ext' map to store the versions of libraries and plugins used across the various .gradle files.
2023-03-10 16:50:16 +01:00
João Duarte
281ce70d86
Workaround for #14873 (#14890)
import platform-specific ffi binaries from JRuby 9.3.9.0 to overcome jruby/jruby#7579

Since JRuby ignores the files in "lib/jni" and uses the ones inside "lib/jruby.jar" instead, we have to inject the older versions into the new JRuby's "jruby.jar"

fixes #14873
2023-02-11 12:20:58 +00:00
João Duarte
15b2d88647
bump snakeyaml to 1.33 (#14881)
ensure logstash-core picks up 1.33 as well from jackson-data format-yaml's
transititive dependency.
2023-02-09 18:20:03 +00:00
João Duarte
394abbd4b1
bump jruby to 9.3.9.0 (#14694)
fixes Encoding bug on Windows https://github.com/jruby/jruby/issues/7367
2022-11-28 15:35:10 +00:00
Rob Bavey
0578ddbbd3
Upgrade jruby to 9.3.8.0 (#14524)
Also remove the explicit CSV import added in #14507, jruby-9.3.8.0 includes
the correct version by default
2022-09-13 17:36:40 -04:00
João Duarte
6bc2483cfc
bump jruby version to 9.3.7.0 (#14455) 2022-08-17 14:30:45 +01:00
Rob Bavey
d268f58a55
Update jruby to 9.3.6.0 (#14304) 2022-06-29 11:42:42 -04:00
Rob Bavey
4a2268a43f
Update jruby version to 9.3.4.0 (#14114)
This commit updates the version of jruby used in Logstash to `9.3.4.0`.

* Updates the references of `jruby` from `9.2.20.1` to `9.3.4.0`
* Updates references/locations of ruby from `2.5.0` to `2.6.0`
* Updates java imports including `org.logstash.util` to be quoted
  * Without quoting the name of the import, the following error is observed in tests:
  * `java.lang.NoClassDefFoundError: org/logstash/Util (wrong name: org/logstash/util)`
  * Maybe an instance of https://github.com/jruby/jruby/issues/4861
* Adds a monkey patch to `require` to resolve compatibility issue between latest `jruby` and `polyglot` gem 
  * The addition of https://github.com/jruby/jruby/pull/7145 to disallow circular
causes, will throw when `polyglot` is thrown into the mix, and stop logstash from
starting and building - any gems that use an exception to determine whether or not
to load the native gem, will trigger the code added in that commit.
  * This commit adds a monkey patch of `require` to rollback the circular cause exception
back to the original cause.
* Removes the use of the deprecated `JavaClass`
* Adds additional `require time` in `generate_build_metadata`
* Rewrites a test helper to avoid potentially calling `~>` on `FalseClass`


Co-authored-by: Joao Duarte <jsvduarte@gmail.com>
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-05-19 10:29:59 -04:00
João Duarte
8d3127e8f5
bump jruby to 9.2.20.1 (#13468) 2021-12-02 11:20:33 +00:00
Karol Bucek
55e7a26416
Deps: update JRuby to 9.2.20.0 (#13387) 2021-11-03 17:27:10 +01:00
Rob Bavey
4707cbd94c
Bundler: freeze lockfile on run, and "normalize" platform on plugin changes (#13015)
This PR enables the upgrade of bundler to the latest version.

Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`.

This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM.

This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg

```
gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka'
```

to facilitate quick and simple plugin testing.

This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. 

This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests.

## Release notes

* Updated Bundler to latest version
* Ensured that `Gemfile.lock` are appropriately frozen
* Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment
2021-08-17 09:35:30 -04:00
Andrea Selva
a7f6c01a3a
Update Snakeyaml version to 1.29 (#13129)
Snakeyaml is used only in the build chain, and it's not packaged with Logstash
2021-08-16 10:33:47 +02:00
Karol Bucek
fe387f4ef5
Deps: update JRuby to 9.2.19.0 (#12989) 2021-06-16 09:34:49 +02:00
Karol Bucek
ee6038afec
Deps: update JRuby to 9.2.18.0 (#12791)
+ Fix: a missing require in bootstrap
2021-06-09 11:21:41 +02:00
João Duarte
9643a33b99
update jruby to 9.2.16.0 (#12699)
fix define_method+super calls due to jruby/jruby#6571
2021-03-04 09:32:50 +00:00
João Duarte
f0c18e89d0
cleanup bundler exclusions during jruby unpacking (#12692)
JRuby had a few releases where it shipped with bundler,
creating some difficulty in working with newer versions.
This no longer happens so we can remove these exclusions
from the jruby unzipping task.
2021-02-25 17:49:23 +00:00
Colin Surprenant
f4bfbd3cc7 remove evaluation dir from JRuby bundled did_you_mean gem 2020-11-23 11:22:28 -08:00
Joao Duarte
b56a3d397b bump jruby to 9.2.13.0 2020-08-05 07:49:22 -07:00
Joao Duarte
67eb27428c update jruby to 9.2.12.0
Also tweak the documentation since most of the add-opens are no longer needed, except:

java.io due to colinsurprenant/jruby-stdin-channel#1
java.security due to jruby-openssl
java.nio.channels, sun.nio.ch, sun.management and java.io from jruby: https://github.com/jruby/jruby/blob/9.2.12.0/bin/.jruby.module_opts

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2020-07-08 04:57:39 -07:00
Rob Bavey
ac95667c11
Use task avoidance API in gradle scripts (#11914)
* Use task avoidance API in gradle scripts

This commit uses the task avoidance api (tasks.register vs task.create/
task DSL), as recommended since Gradle 5.1

This should reduce the execution of unnecessary tasks in build jobs, and
hopefully improve build resiliency and execution time.
2020-05-29 10:25:52 -04:00
Rob Bavey
58314a7f0e
Update gradle version to 6.3 (#11742)
* Update gradle version to 6.3

Gradle versions prior to 6.3 cannot run under JDK14.
This commit upgrades the version of Gradle to 6.3, and removes all deprecation warnings that can currently be removed.

Changes include:
* Increase gradle memory to 2g
* Increase gradle memory in the license check job to 2g
* Replace use of `testCompile`
* Replace `runtime` with `runtimeOnly`
* Remove`compile` depedencies from gradle files
* Replace deprecated archive methods
* Fix dependencies report build
* Make jruby dependencies 'api', fix archiveVersion
* Set `duplicatesStrategy` for all tasks of type Copy
* Use `configureEach` for global 'withType' calls
** Use the recommended Tasks API calls
(https://blog.gradle.org/preview-avoiding-task-configuration-time)
* Run `./gradlew wrapper` earlier to improve caching
* Use copy with chown for resources that need to be run during `./gradlew wrapper`
2020-04-07 12:49:36 -04:00
Karol Bucek
aa931661c6 Updated: JRuby to 9.2.11.1
Fixes #11723
2020-03-26 11:35:02 +00:00
João Duarte
e9c9865f40
Add apache and elastic license headers to source code files (#11673)
* add license header to ruby and java files
* add license header to erb and rake files
* add license headers to gradle files
2020-03-11 11:53:38 +00:00
Karol Bucek
22d07520e4 Updated: JRuby to 9.2.11.0
- fix: deprecation warnings due JRuby 9.2.11
- fix: compat for upgraded RubyGems 3.0

Fixes #11647
2020-03-05 11:40:47 +00:00
Joao Duarte
d65f78728b stop installing rake and json on every bootstrap
Fixes #11102
2019-12-02 14:59:43 +00:00
Joao Duarte
0924e97da4 update jruby to 9.2.9.0
Fixes #11281
2019-11-21 09:36:29 +00:00
Dan Hermann
36f07402ce correct directory for versions.yml file
Fixes #11318
2019-11-19 14:36:01 +00:00
João Duarte
e44ec7ad41
update jruby to 9.2.8.0 (#11041) 2019-08-13 07:45:42 +01:00
Dan Hermann
0de53939e9 * Adds a java_generator input with jdots codec to facilitate testing, adds float config type
* Breaking change to codec.encode method

* Sink output for discarding events

* URI and password config types

* Utility methods for packaging Java plugins

* Plugin API validation, fix gemspec generation

* Plugin Jar validation

* Update developer documentation

* Update codec metrics for new encode method

* Beta: Isolated classloaders for Java plugins

* Address code review comments

Fixes #10620
2019-05-03 11:54:37 +00:00
Joao Duarte
8ee1ff4d29 properly exclude bundler 1.16.6
Fixes #10684
2019-04-12 21:30:27 +00:00
Joao Duarte
79a4fd1601 bump jruby to 9.2.7.0
Revert "work around jruby-5642 during package installation on jdk11 (#10658)"

This reverts commit 033c896330.

skip the bundler-1.16.6 files when unpacking jruby

Fixes #10674
2019-04-11 21:32:32 +00:00
Dan Hermann
b8ce9d7aeb Move Gradle wrappers around Ruby operations to a separate file to facilitate sharing of common operations with Java plugins
Fixes #10642
2019-04-04 19:56:59 +00:00