Skip to content

Commit d6beacc

Browse files
jsvdjordansissel
authored andcommitted
reinstate standalone flag and remove .bundle in vendor task
Fixes #2184
1 parent c0e91ce commit d6beacc

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

rakelib/plugin.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace "plugin" do
2121
::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/bundle/jruby/1.9'),
2222
::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/jruby/lib/ruby/gems/shared')
2323
].join(":"),
24-
"GEM_HOME" => "vendor/plugins/jruby/1.9",
24+
"GEM_HOME" => ::File.join(LogStash::Environment::LOGSTASH_HOME, "vendor/plugins/jruby/1.9"),
2525
"BUNDLE_GEMFILE" => "tools/Gemfile.plugins"
2626
}
2727
if ENV['USE_RUBY'] != '1'

rakelib/vendor.rake

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,25 @@ namespace "vendor" do
242242
end
243243
backup_gem_home = ENV['GEM_HOME']
244244
backup_gem_path = ENV['GEM_PATH']
245-
ENV['GEM_HOME'] = LogStash::Environment.gem_home
246-
ENV['GEM_PATH'] = [
247-
::File.join(LogStash::Environment::LOGSTASH_HOME, 'build/bootstrap'),
248-
::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/jruby/lib/ruby/gems/shared')
249-
].join(":")
250-
cmd = [jruby, "-S", bundler, "install", "--gemfile=tools/Gemfile"]
251-
system(*cmd)
245+
env = {
246+
'GEM_HOME' => ::File.join(LogStash::Environment::LOGSTASH_HOME, LogStash::Environment.gem_home),
247+
'GEM_PATH' => [
248+
::File.join(LogStash::Environment::LOGSTASH_HOME, 'build/bootstrap'),
249+
::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/jruby/lib/ruby/gems/shared')
250+
].join(":")
251+
}
252+
cmd = [jruby, "-S", bundler, "install", "--gemfile=tools/Gemfile",
253+
"--standalone",
254+
"--clean",
255+
"--without", "development",
256+
"--jobs", "4",
257+
"--path", LogStash::Environment::BUNDLE_DIR
258+
]
259+
system(env, *cmd)
260+
261+
# because --path creates a .bundle/config file and changes bundler path
262+
# we need to remove this file so it doesn't influence following bundler calls
263+
FileUtils.rm_rf(::File.join(LogStash::Environment::LOGSTASH_HOME, "tools/.bundle"))
252264
ENV['GEM_HOME'] = backup_gem_home
253265
ENV['GEM_PATH'] = backup_gem_path
254266
raise RuntimeError, $!.to_s unless $?.success?

0 commit comments

Comments
 (0)