Skip to content

Commit 1fd49d4

Browse files
schneemscolincasey
andauthored
Remove Heroku-20 support (heroku#1591)
* Remove heroku-20 version logic * Update error message * Remove unsupported Bundler versions Ruby 3+ ships with a bundler version and Ruby 3.1 ships with Bundler 2.5: ``` $ /Users/rschneeman/.rubies/ruby-3.1.6/bin/bundle -v Bundler version 2.5.11 ``` I think we could also remove the 2.3 and 2.4 bundler versions from the hash, but would need to check observability to be sure. It's not hurting things for now. * Update download presence logic to remove heroku-20 * Remove heroku-18 string from spec * Update test to non EOL stack * Remove (more) deprecated stack references * Refactor: Move spec file There's only one test in `installers/`, and it's easier to run all "helpers" at once this way. * Remove Ruby 1.9 code * Remove Ruby <2.1 code * Remove Ruby <2.1 "syck hack" code * Remove Ruby < 1.9 logic * Remove Ruby 1.8.7 code and duplicate env var * Remove older changelogs (keeping 2024-2025) * Remove unused Ruby 2.6 code * Remove unused constant * Remove unused logging code * Remove unused methods * DRY up logic * Remove hardcoded false in vendored_bundle? Code was added in Ruby ~2.5 and never moved heroku@5dbc840 * All bundler versions supported provide multi platform support * Remove newline * Remove unused method * Remove legacy cache clear code * Fix code alignment * Remove bundler < 2.1 configuration * Remove bundler conditional ``` $ irb irb(main):001> Gem::Version.new("2.3.1") > Gem::Version.new("2.3") => true ``` * Changelog * Remove no-op libyaml Added in heroku@eac7584 and removed some time later, we have libyaml on the system and this is a no-op. https://devcenter.heroku.com/articles/stack-packages * Remove unused files and Rake code * Remove purely `true` variable * Update lib/language_pack/helpers/bundler_wrapper.rb Co-authored-by: Colin Casey <casey.colin@gmail.com> Signed-off-by: Richard Schneeman <richard.schneeman+no-recruiters@gmail.com> * Assert no accidental cache purge message heroku#1591 (comment) --------- Signed-off-by: Richard Schneeman <richard.schneeman+no-recruiters@gmail.com> Co-authored-by: Colin Casey <casey.colin@gmail.com>
1 parent 3018f23 commit 1fd49d4

82 files changed

Lines changed: 174 additions & 1522 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Removed support for Ubuntu 20.04 (and thus Heroku-20 / `heroku/builder:20`). This includes removing support for Ruby < 3.1 and Bundler < 2.3. (https://github.com/heroku/buildpacks-ruby/pull/1591)
56

67
## [v307] - 2025-05-14
78

Rakefile

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,8 @@
66
require "fileutils"
77
require "tmpdir"
88
require 'hatchet/tasks'
9-
ENV["BUILDPACK_LOG_FILE"] ||= "tmp/buildpack.log"
10-
119
require_relative 'lib/rake/deploy_check'
1210

13-
S3_BUCKET_REGION = "us-east-1"
14-
S3_BUCKET_NAME = "heroku-buildpack-ruby"
15-
16-
def s3_tools_dir
17-
File.expand_path("../support/s3", __FILE__)
18-
end
19-
20-
def s3_upload(tmpdir, name)
21-
sh("#{s3_tools_dir}/s3 put #{S3_BUCKET_NAME} #{name}.tgz #{tmpdir}/#{name}.tgz")
22-
end
23-
24-
def vendor_plugin(git_url, branch = nil)
25-
name = File.basename(git_url, File.extname(git_url))
26-
Dir.mktmpdir("#{name}-") do |tmpdir|
27-
FileUtils.rm_rf("#{tmpdir}/*")
28-
29-
Dir.chdir(tmpdir) do
30-
sh "git clone #{git_url} ."
31-
sh "git checkout origin/#{branch}" if branch
32-
FileUtils.rm_rf("#{name}/.git")
33-
sh("tar czvf #{tmpdir}/#{name}.tgz *")
34-
s3_upload(tmpdir, name)
35-
end
36-
end
37-
end
38-
39-
def in_gem_env(gem_home, &block)
40-
old_gem_home = ENV['GEM_HOME']
41-
old_gem_path = ENV['GEM_PATH']
42-
ENV['GEM_HOME'] = ENV['GEM_PATH'] = gem_home.to_s
43-
44-
yield
45-
46-
ENV['GEM_HOME'] = old_gem_home
47-
ENV['GEM_PATH'] = old_gem_path
48-
end
49-
50-
def install_gem(gem_name, version)
51-
name = "#{gem_name}-#{version}"
52-
Dir.mktmpdir("#{gem_name}-#{version}") do |tmpdir|
53-
Dir.chdir(tmpdir) do |dir|
54-
FileUtils.rm_rf("#{tmpdir}/*")
55-
56-
in_gem_env(tmpdir) do
57-
sh("unset RUBYOPT; gem install #{gem_name} --version #{version} --no-ri --no-rdoc --env-shebang")
58-
sh("rm #{gem_name}-#{version}.gem")
59-
sh("rm -rf cache/#{gem_name}-#{version}.gem")
60-
sh("tar czvf #{tmpdir}/#{name}.tgz *")
61-
s3_upload(tmpdir, name)
62-
end
63-
end
64-
end
65-
end
66-
6711
namespace :buildpack do
6812
desc "prepares the next version of the buildpack for release"
6913
task :prepare do
@@ -91,21 +35,6 @@ namespace :buildpack do
9135
end
9236
end
9337

94-
desc "update plugins"
95-
task "plugins:update" do
96-
vendor_plugin "https://github.com/heroku/rails_log_stdout.git", "legacy"
97-
vendor_plugin "https://github.com/pedro/rails3_serve_static_assets.git"
98-
vendor_plugin "https://github.com/hone/rails31_enable_runtime_asset_compilation.git"
99-
end
100-
101-
desc "install vendored gem"
102-
task "gem:install", :gem, :version do |t, args|
103-
gem = args[:gem]
104-
version = args[:version]
105-
106-
install_gem(gem, version)
107-
end
108-
10938
begin
11039
require 'rspec/core/rake_task'
11140

bin/support/ruby_compile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ begin
2222
LanguagePack::ShellHelpers.initialize_env(ARGV[2])
2323
if pack = LanguagePack.detect(ARGV[0], ARGV[1])
2424
pack.topic("Compiling #{pack.name}")
25-
pack.log("compile") do
26-
pack.compile
27-
end
25+
pack.compile
2826
end
2927
rescue Exception => e
3028
LanguagePack::ShellHelpers.display_error_and_exit(e)

bin/support/ruby_test-compile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ begin
2222
if pack = LanguagePack.detect(ARGV[0], ARGV[1])
2323
LanguagePack::ShellHelpers.initialize_env(ARGV[2])
2424
pack.topic("Setting up Test for #{pack.name}")
25-
pack.log("test_compile") do
26-
pack.compile
27-
end
25+
pack.compile
2826
end
2927
rescue Exception => e
3028
LanguagePack::ShellHelpers.display_error_and_exit(e)

changelogs/v205/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelogs/v205/bundler.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelogs/v205/malloc.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

changelogs/v206/.gitkeep

Whitespace-only changes.

changelogs/v206/default_ruby.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelogs/v206/ruby_warning.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)