From a693fa3bf4bfba8e149af589b63f2e9dbe12e40e Mon Sep 17 00:00:00 2001 From: Karol Bucek Date: Tue, 20 Oct 2020 09:00:01 +0200 Subject: [PATCH] Build: properly isolate integration (test) env setup (#12364) to avoid gems being resolved from the usual LS GEM_HOME this is problematic for gems such as jruby-openssl which are loaded during boot (by RGs/Bundler) and thus activated in Bundler from a different GEM_HOME. if such gem is updated it won't end up being install-ed in the --path location as it's found on the GEM_HOME! + Fix: gem conflict 1.3.6 required by core this is due now isolating GEM_HOME on `bundle install --path` + Refactor: we do not need LS_GEM_HOME/PATH + avoid pinning jruby-openssl to 0.10.4 resolves GH-12299 (reverting GH-12301) --- build.gradle | 9 +++++---- logstash-core/logstash-core.gemspec | 2 +- qa/integration/integration_tests.gemspec | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index d895ebd80..9fcd11ff0 100644 --- a/build.gradle +++ b/build.gradle @@ -316,8 +316,9 @@ tasks.register("unpackTarDistribution", Copy) { into {buildDir} } -def qaVendorPath = "${buildDir}/qa/integration/vendor" -def qaBundledGemPath = "${qaVendorPath}/jruby/2.5.0" +def qaBuildPath = "${buildDir}/qa/integration" +def qaVendorPath = "${qaBuildPath}/vendor" +def qaBundledGemPath = "${qaVendorPath}/jruby/2.5.0".toString() def qaBundleBin = "${qaBundledGemPath}/bin/bundle" tasks.register("installIntegrationTestBundler"){ @@ -340,8 +341,8 @@ tasks.register("installIntegrationTestGems") { doLast { bundleWithEnv( projectDir, buildDir, - "${projectDir}/qa/integration", qaBundleBin, ['install', '--path', qaVendorPath], - [LS_GEM_PATH: qaBundledGemPath, LS_GEM_HOME: qaBundledGemPath] + qaBuildPath, qaBundleBin, ['install', '--path', qaVendorPath], + [ GEM_PATH: qaBundledGemPath, GEM_HOME: qaBundledGemPath ] ) } } diff --git a/logstash-core/logstash-core.gemspec b/logstash-core/logstash-core.gemspec index c43b1282e..03748524e 100644 --- a/logstash-core/logstash-core.gemspec +++ b/logstash-core/logstash-core.gemspec @@ -57,7 +57,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency "mustermann", '~> 1.0.3' gem.add_runtime_dependency "sinatra", '~> 2' gem.add_runtime_dependency 'puma', '~> 4' - gem.add_runtime_dependency "jruby-openssl", "= 0.10.4" # >= 0.9.13 Required to support TLSv1.2; 0.10.5 is causing dependency issue in integration test #12299 + gem.add_runtime_dependency "jruby-openssl", "~> 0.10" # >= 0.9.13 Required to support TLSv1.2 gem.add_runtime_dependency "chronic_duration", "~> 0.10" gem.add_runtime_dependency "treetop", "~> 1" #(MIT license) diff --git a/qa/integration/integration_tests.gemspec b/qa/integration/integration_tests.gemspec index 039a53111..8740689ac 100644 --- a/qa/integration/integration_tests.gemspec +++ b/qa/integration/integration_tests.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'stud', '~> 0.0.22' s.add_development_dependency 'pry' s.add_development_dependency 'rspec', '~> 3.5' - s.add_development_dependency 'logstash-devutils', '= 1.3.5' + s.add_development_dependency 'logstash-devutils' s.add_development_dependency 'flores' s.add_development_dependency 'rubyzip' end