diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b251477f8..3e819163b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: - name: Run ShellCheck bin top level run: | shellcheck bin/support/bash_functions.sh bin/support/download_ruby -x && - shellcheck bin/build bin/compile bin/detect bin/release bin/test bin/test-compile -x + shellcheck bin/compile bin/detect bin/release bin/test bin/test-compile -x diff --git a/CHANGELOG.md b/CHANGELOG.md index 0734c647c..b0d63e656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,17 @@ ## [Unreleased] +## [v272] - 2024-06-13 + +- Remove experimental CNB support. For official CNB support use [heroku/buildpacks-ruby](https://github.com/heroku/buildpacks-ruby) instead. (https://github.com/heroku/heroku-buildpack-ruby/pull/1464) +- Default Ruby version is now 3.1.6 (https://github.com/heroku/heroku-buildpack-ruby/pull/1466) +- Ruby 3.3.3 is now available + ## [v271] - 2024-06-03 - Ruby 3.4.0-preview1 is now available - Ruby 3.1.6 and 3.3.2 are now available - JRuby 9.4.7.0, 9.4.6.0, and 9.3.14.0 are now available - -## [v271] - 2024-05-24 - - Fix issue with sprockets reference being nil when propshaft gem is used instead (https://github.com/heroku/heroku-buildpack-ruby/pull/1452) @@ -1535,7 +1538,8 @@ Bugfixes: * Change gem detection to use lockfile parser * use `$RACK_ENV` when thin is detected for rack apps -[unreleased]: https://github.com/heroku/heroku-buildpack-ruby/compare/v271...main +[unreleased]: https://github.com/heroku/heroku-buildpack-ruby/compare/v272...main +[v272]: https://github.com/heroku/heroku-buildpack-ruby/compare/v271...v272 [v271]: https://github.com/heroku/heroku-buildpack-ruby/compare/v270...v271 [v271]: https://github.com/heroku/heroku-buildpack-ruby/compare/v270...v271 [v270]: https://github.com/heroku/heroku-buildpack-ruby/compare/v269...v270 diff --git a/Gemfile.lock b/Gemfile.lock index 0f753a918..265e653ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,7 +69,7 @@ DEPENDENCIES toml-rb RUBY VERSION - ruby 3.1.4p223 + ruby 3.1.6p260 BUNDLED WITH - 2.5.8 + 2.5.11 diff --git a/bin/build b/bin/build deleted file mode 100755 index 5a6d0f4ec..000000000 --- a/bin/build +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -LAYERS_DIR=$1 -PLATFORM_DIR=$2 -_ENV_DIR="$PLATFORM_DIR/env" -PLAN=$3 -APP_DIR=$(pwd) -BIN_DIR=$(cd "$(dirname "$0")" || exit; pwd) # absolute path -BUILDPACK_DIR=$(dirname "$BIN_DIR") - -# legacy buildpack uses $STACK -export STACK=$CNB_STACK_ID - -# shellcheck source=bin/support/bash_functions.sh -source "$BIN_DIR/support/bash_functions.sh" - -cat<&2 - The CNB implementation in this buildpack is no longer maintained - - The heroku/heroku-ruby-buildpack previously implemented the Cloud Native Buildpack \(CNB\) spec beta support, however this functionality is no longer supported or maintained. - - The Heroku Ruby CNB is now at https://github.com/heroku/buildpacks-ruby. See https://github.com/heroku/buildpacks for more information on using the Heroku CNB builder. To avoid interruptions switch to the new CNB as soon as possible. -EOF - -bootstrap_ruby_dir=$(install_bootstrap_ruby "$BIN_DIR" "$BUILDPACK_DIR") -export PATH="$bootstrap_ruby_dir/bin/:$PATH" -unset GEM_PATH - -"$bootstrap_ruby_dir"/bin/ruby "$BIN_DIR/support/ruby_build" "$APP_DIR" "$LAYERS_DIR" "$PLATFORM_DIR" "$PLAN" diff --git a/bin/detect b/bin/detect index 83ad9437c..e25db8c44 100755 --- a/bin/detect +++ b/bin/detect @@ -1,18 +1,10 @@ #!/bin/sh -if [ -z "$CNB_STACK_ID" ]; then - # v2 API - APP_DIR=$1 -else - _PLATFORM_DIR=$1 - _PLAN=$2 - # v3 API - APP_DIR=$(pwd) -fi +APP_DIR=$1 if [ -f "$APP_DIR/Gemfile" ]; then echo "Ruby" exit 0 else - exit 100 + exit 1 fi diff --git a/bin/support/ruby_build b/bin/support/ruby_build deleted file mode 100755 index ddcb77edf..000000000 --- a/bin/support/ruby_build +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby - -# This script compiles an application so it can run on Heroku. -# It will install the application's specified version of Ruby, it's dependencies -# and certain framework specific requirements (such as calling `rake assets:precompile` -# for rails apps). You can see all features described in the devcenter -# https://devcenter.heroku.com/articles/ruby-support -$stdout.sync = true - -$:.unshift File.expand_path("../../../lib", __FILE__) -require "language_pack" -require "language_pack/shell_helpers" - -APP_DIR=ARGV[0] -LAYER_DIR=ARGV[1] -PLATFORM_DIR=ARGV[2] -ENV_DIR="#{PLATFORM_DIR}/env" -PLAN=ARGV[3] - -begin - LanguagePack::ShellHelpers.initialize_env(ENV_DIR) - if pack = LanguagePack.detect(ARGV[0], nil, LAYER_DIR) - pack.topic("Compiling #{pack.name}") - pack.log("compile") do - pack.build - end - end -rescue Exception => e - LanguagePack::ShellHelpers.display_error_and_exit(e) -end - diff --git a/buildpack.toml b/buildpack.toml index 7c72034f4..3a4090ef2 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -1,11 +1,6 @@ -api = "0.2" - [buildpack] -id = "heroku/ruby" -version = "0.1.4" name = "Ruby" -homepage = "https://github.com/heroku/heroku-buildpack-ruby" -ruby_version = "3.1.4" +ruby_version = "3.1.6" [publish] @@ -19,30 +14,16 @@ files = [ "app.json", "hatchet.json", "hatchet.lock", - "package.toml", ] [[publish.Vendor]] -url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-20/ruby-3.1.4.tgz" +url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-20/ruby-3.1.6.tgz" dir = "vendor/ruby/heroku-20" [[publish.Vendor]] -url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-22/ruby-3.1.4.tgz" +url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-22/ruby-3.1.6.tgz" dir = "vendor/ruby/heroku-22" [[publish.Vendor]] -url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-24/amd64/ruby-3.1.4.tgz" +url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-24/amd64/ruby-3.1.6.tgz" dir = "vendor/ruby/amd64/heroku-24" - -[[stacks]] -id = "heroku-20" - -[[stacks]] -id = "heroku-22" - -[metadata] - -[metadata.release] - -[metadata.release.docker] -repository = "public.ecr.aws/heroku-buildpacks/heroku-ruby-buildpack" diff --git a/changelogs/v272/default_ruby.md b/changelogs/v272/default_ruby.md new file mode 100644 index 000000000..a06f083bb --- /dev/null +++ b/changelogs/v272/default_ruby.md @@ -0,0 +1,3 @@ +## Default Ruby version for new apps is now 3.1.6 + +The [default Ruby version for new Ruby applications is 3.1.6](https://devcenter.heroku.com/articles/ruby-support#default-ruby-version-for-new-apps). You’ll only get the default if the application does not specify a ruby version. diff --git a/lib/language_pack/base.rb b/lib/language_pack/base.rb index 9c5693b54..dd9119247 100644 --- a/lib/language_pack/base.rb +++ b/lib/language_pack/base.rb @@ -5,7 +5,6 @@ require "language_pack/shell_helpers" require "language_pack/cache" require "language_pack/helpers/bundler_cache" -require "language_pack/helpers/layer" require "language_pack/metadata" require "language_pack/fetcher" @@ -29,7 +28,7 @@ class LanguagePack::Base # changes directory to the build_path # @param [String] the path of the build dir # @param [String] the path of the cache dir this is nil during detect and release - def initialize(build_path, cache_path = nil, layer_dir=nil) + def initialize(build_path, cache_path = nil) @build_path = build_path @stack = ENV.fetch("STACK") @cache = LanguagePack::Cache.new(cache_path) @@ -37,7 +36,6 @@ def initialize(build_path, cache_path = nil, layer_dir=nil) @bundler_cache = LanguagePack::BundlerCache.new(@cache, @stack) @id = Digest::SHA1.hexdigest("#{Time.now.to_f}-#{rand(1000000)}")[0..10] @fetchers = {:buildpack => LanguagePack::Fetcher.new(VENDOR_URL) } - @layer_dir = layer_dir @arch = get_arch Dir.chdir build_path @@ -104,24 +102,6 @@ def compile mcount "success" end - def build - write_release_toml - Kernel.puts "" - warnings.each do |warning| - Kernel.puts "\e[1m\e[33m###### WARNING:\e[0m"# Bold yellow - Kernel.puts "" - puts warning - Kernel.puts "" - Kernel.puts "" - end - if deprecations.any? - topic "DEPRECATIONS:" - puts @deprecations.join("\n") - end - Kernel.puts "" - mcount "success" - end - def build_release release = {} release["addons"] = default_addons @@ -131,29 +111,6 @@ def build_release release end - def write_release_toml - release = build_release - - layer = LanguagePack::Helpers::Layer.new(@layer_dir, "env", launch: true) - FileUtils.mkdir_p("#{layer.path}/env.launch") - release["config_vars"].each do |key, value| - File.open("#{layer.path}/env.launch/#{key.upcase}.override", 'w') do |f| - f.write(value) - end - end - - release_toml = release["default_process_types"].map do |type, command| - <