Permalink
Browse files

Merge pull request #628 from heroku/ruby2.5.0

Ruby 2.5.0 and vendored Bundler
  • Loading branch information...
2 parents a4ce84b + 7125372 commit b1f7baec7781dee38e90fc017e32299f748deacb @schneems schneems committed Oct 18, 2017
Showing with 29 additions and 3 deletions.
  1. +1 −0 hatchet.json
  2. +20 −3 lib/language_pack/ruby.rb
  3. +8 −0 spec/hatchet/ruby_spec.rb
View
@@ -26,6 +26,7 @@
"sharpstone/ruby_193_jruby_17161_jdk7",
"sharpstone/ruby_193_jruby_17161_jdk8",
"sharpstone/ruby_193_bad_patch_cedar_14",
+ "sharpstone/ruby_25",
"sharpstone/jruby-minimal",
"sharpstone/empty-procfile",
"sharpstone/bad_ruby_version",
View
@@ -540,6 +540,10 @@ def bundler_binstubs_path
"vendor/bundle/bin"
end
+ def bundler_path
+ @bundler_path ||= "#{slug_vendor_base}/gems/#{BUNDLER_GEM_PATH}"
+ end
+
# runs bundler to install the dependencies
def build_bundler(default_bundle_without)
instrument 'ruby.build_bundler' do
@@ -576,7 +580,15 @@ def build_bundler(default_bundle_without)
bundle_command += " --deployment"
end
- topic("Installing dependencies using bundler #{bundler.version}")
+ # If Ruby's bundler is >= buildpack version, it will win. Get the
+ # version of bundler actually being used
+ bundler_version =
+ if ruby_version.ruby_version >= "2.5.0"
+ run!("#{bundler_path}/exe/#{bundle_bin} -v").downcase.chomp
+ else
+ "bundler #{bundler.version}"
+ end
+ topic("Installing dependencies using #{bundler_version}")
load_bundler_cache
bundler_output = ""
@@ -589,7 +601,6 @@ def build_bundler(default_bundle_without)
yaml_include = File.expand_path("#{libyaml_dir}/include").shellescape
yaml_lib = File.expand_path("#{libyaml_dir}/lib").shellescape
pwd = Dir.pwd
- bundler_path = "#{pwd}/#{slug_vendor_base}/gems/#{BUNDLER_GEM_PATH}/lib"
# we need to set BUNDLE_CONFIG and BUNDLE_GEMFILE for
# codon since it uses bundler.
env_vars = {
@@ -601,8 +612,14 @@ def build_bundler(default_bundle_without)
"RUBYOPT" => syck_hack,
"NOKOGIRI_USE_SYSTEM_LIBRARIES" => "true"
}
- env_vars["BUNDLER_LIB_PATH"] = "#{bundler_path}" if ruby_version.ruby_version == "1.8.7"
+ env_vars["BUNDLER_LIB_PATH"] = "#{pwd}/#{bundler_path}/lib" if ruby_version.ruby_version == "1.8.7"
puts "Running: #{bundle_command}"
+ # bundler binstub bug in Ruby 2.5.0-preview1
+ # https://bugs.ruby-lang.org/issues/13997
+ if ruby_version.ruby_version == "2.5.0"
+ bundle_command.prepend("#{bundler_path}/exe/")
+ end
+
instrument "ruby.bundle_install" do
bundle_time = Benchmark.realtime do
bundler_output << pipe("#{bundle_command} --no-clean", out: "2>&1", env: env_vars, user_env: true)
@@ -16,6 +16,14 @@
end
end
+ describe "2.5.0" do
+ it "works" do
+ Hatchet::Runner.new("ruby_25").deploy do
+ # works
+ end
+ end
+ end
+
# describe "default WEB_CONCURRENCY" do
# it "auto scales WEB_CONCURRENCY" do
# pending("https://github.com/heroku/api/issues/4426")

0 comments on commit b1f7bae

Please sign in to comment.