Skip to content

Commit 6f1de43

Browse files
mergify[bot]andselyaauie
authored
[8.18] Fixes to the bundles gems and jars versions (backport #17659) (#17662)
* Fixes to the bundles gems and jars versions (#17659) * Avoid hard pins on gem versions in the Gemfile.template and remove some duplicated gems which are already vendored to an upper version * exclude inactive net-imap-0.2.3 from artifacts * artifacts: exclude "default" stdlib gems that are shadowed by pinned gems --------- Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co> (cherry picked from commit 06c877e) # Conflicts: # Gemfile.template * fix conflict (line order) --------- Co-authored-by: Andrea Selva <selva.andre@gmail.com> Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
1 parent e42cf9f commit 6f1de43

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

Gemfile.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ gem "thwait"
4646
gem "bigdecimal", "~> 3.1"
4747

4848
gem "psych", "5.2.2"
49-
gem "uri", "0.12.3" # Pins until a new jruby version with updated uri is released
50-
gem "cgi", "0.3.7" # Pins until a new jruby version with updated cgi is released
49+
gem "cgi", "~> 0.3.7" # Pins until a new jruby version with updated cgi is released
50+
gem "uri", "~> 0.12.3" # Pins until a new jruby version with updated cgi is released

logstash-core/lib/logstash/agent.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
# BEGIN: eager-load interesting stdlib/default dependencies
19+
# We exclude from built artifacts the stdlib implementations of "default gems"
20+
# for which our bundle pins to a later version. Requiring them here ensures
21+
# that our build breaks if doing so excludes the ONLY implementation, which
22+
# would be possible if an updated JRuby includes a "default gem" that meets
23+
# the pin criteria.
24+
# SEE: https://github.com/elastic/logstash/pull/17659
25+
require 'cgi'
26+
require 'uri'
27+
# END: eager load
28+
1829
require "logstash/environment"
1930
require "logstash/config/cpu_core_strategy"
2031
require "logstash/instrument/collector"

rakelib/artifacts.rake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ namespace "artifact" do
105105
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/gems/rexml-3.2.5/**/*'
106106
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/specifications/rexml-3.2.5.gemspec'
107107

108+
# remove this after JRuby includes cgi-0.3.7+
109+
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/specifications/default/cgi-0.3.6-java.gemspec'
110+
@exclude_paths << 'vendor/jruby/lib/ruby/stdlib/cgi{,.rb}'
111+
@exclude_paths << 'vendor/jruby/lib/ruby/stdlib/cgi/**/*'
112+
113+
# remove this after JRuby includes net-imap-0.2.4+
114+
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/specifications/net-imap-0.2.3.gemspec'
115+
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/gems/net-imap-0.2.3/**/*'
116+
117+
# remove this after JRuby includes uri-0.12.3+
118+
@exclude_paths << 'vendor/jruby/lib/ruby/gems/shared/specifications/default/uri-0.12.2.gemspec'
119+
@exclude_paths << 'vendor/jruby/lib/ruby/stdlib/uri{,.rb}'
120+
@exclude_paths << 'vendor/jruby/lib/ruby/stdlib/uri/**/*'
121+
122+
# remove jruby-openssl shipped with JRuby to prefer the one from the lockfile
123+
@exclude_paths << 'vendor/jruby/lib/ruby/stdlib/jopenssl.jar'
124+
108125
@exclude_paths
109126
end
110127

0 commit comments

Comments
 (0)