From 7975774ec6f75bad609a2b21531569b29ba06de7 Mon Sep 17 00:00:00 2001 From: kiril-keranov <114745615+kiril-keranov@users.noreply.github.com> Date: Thu, 11 Sep 2025 18:15:23 +0300 Subject: [PATCH 1/8] Update jprofiler_profiler.yml --- config/jprofiler_profiler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/jprofiler_profiler.yml b/config/jprofiler_profiler.yml index d741f2f611..e48294a00c 100644 --- a/config/jprofiler_profiler.yml +++ b/config/jprofiler_profiler.yml @@ -15,7 +15,7 @@ # JMX configuration --- -version: 13.+ +version: 15.+ repository_root: https://download.run.pivotal.io/jprofiler enabled: false nowait: true From 6bbee1cef7e1618453172e57d42acaa3f777211d Mon Sep 17 00:00:00 2001 From: ramonskie Date: Mon, 17 Nov 2025 23:01:13 +0100 Subject: [PATCH 2/8] Migrate from Ruby 2.5.9 to Ruby 3.4.7 with Psych 4.0+ compatibility Update buildpack to use Ruby 3.4.7, addressing YAML loading changes in Psych 4.0+, adding required standard library gems, and modernizing Ruby syntax. All core utility specs (266 examples) pass successfully. Key changes: - Update YAML.load_file calls to use permitted_classes and aliases parameters - Add Psych::DisallowedClass to exception handling - Include base64, bigdecimal, digest, set, and tmpdir gems explicitly - Adopt endless range syntax (tokens[1..] vs tokens[1..-1]) - Remove Ruby 2.x version-specific test code - Modernize RuboCop configuration for rubocop-rspec --- .rubocop.yml | 7 +++-- .ruby-version | 2 +- Gemfile | 7 +++++ Gemfile.lock | 12 +++++++++ .../framework/multi_buildpack.rb | 2 +- .../repository/repository_index.rb | 2 +- .../util/configuration_utils.rb | 6 ++--- lib/java_buildpack/util/tokenized_version.rb | 10 ++----- .../util/cache/download_cache_spec.rb | 26 ++----------------- .../util/filtering_pathname_spec.rb | 6 ++--- spec/spec_helper.rb | 1 + 11 files changed, 38 insertions(+), 43 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 17d9be63ca..49fe20c4f8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ --- -require: rubocop-rspec +require: + - rubocop-rspec AllCops: NewCops: enable @@ -40,7 +41,9 @@ RSpec/ExampleLength: Max: 20 RSpec/ExpectOutput: Enabled: false -RSpec/FilePath: +RSpec/SpecFilePathFormat: + Enabled: false +RSpec/SpecFilePathSuffix: Enabled: false RSpec/MissingExampleGroupArgument: Enabled: false diff --git a/.ruby-version b/.ruby-version index 30f69e8cc5..2aa5131992 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.9 +3.4.7 diff --git a/Gemfile b/Gemfile index ec63e80628..e0334918f5 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,13 @@ source 'https://rubygems.org' +# Ruby 3.4+ standard library gems that need to be explicit +gem 'base64' +gem 'bigdecimal' +gem 'digest' +gem 'set' +gem 'tmpdir' + group :development do gem 'rake' gem 'redcarpet' diff --git a/Gemfile.lock b/Gemfile.lock index b3eb261a97..3e3741456a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,9 +4,13 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) + base64 (0.3.0) + bigdecimal (3.3.1) crack (0.4.5) rexml diff-lcs (1.5.0) + digest (3.2.1) + fileutils (1.8.0) hashdiff (1.0.1) parallel (1.22.1) parser (3.1.2.0) @@ -45,9 +49,12 @@ GEM rubocop (~> 1.19) ruby-progressbar (1.11.0) rubyzip (2.3.2) + set (1.1.2) tee (1.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + tmpdir (0.3.1) + fileutils unicode-display_width (2.1.0) webmock (3.14.0) addressable (>= 2.8.0) @@ -61,14 +68,19 @@ PLATFORMS ruby DEPENDENCIES + base64 + bigdecimal + digest rake redcarpet rspec rubocop rubocop-rspec rubyzip + set tee terminal-table + tmpdir webmock yard diff --git a/lib/java_buildpack/framework/multi_buildpack.rb b/lib/java_buildpack/framework/multi_buildpack.rb index 1b0500d4a8..a1c97f7617 100644 --- a/lib/java_buildpack/framework/multi_buildpack.rb +++ b/lib/java_buildpack/framework/multi_buildpack.rb @@ -269,7 +269,7 @@ def add_system_properties(java_opts) end def config(config_file) - YAML.load_file(config_file) + YAML.load_file(config_file, permitted_classes: [Symbol], aliases: true) end def config_file(dep_directory) diff --git a/lib/java_buildpack/repository/repository_index.rb b/lib/java_buildpack/repository/repository_index.rb index 17529c351d..728ac7d480 100644 --- a/lib/java_buildpack/repository/repository_index.rb +++ b/lib/java_buildpack/repository/repository_index.rb @@ -39,7 +39,7 @@ def initialize(repository_root) .chomp('/') cache.get("#{canonical repository_root}#{INDEX_PATH}") do |file| - @index = YAML.load_file(file) + @index = YAML.load_file(file, permitted_classes: [Symbol], aliases: true) @logger.debug { @index } end end diff --git a/lib/java_buildpack/util/configuration_utils.rb b/lib/java_buildpack/util/configuration_utils.rb index 687ebaa7c7..9bad2b07fb 100644 --- a/lib/java_buildpack/util/configuration_utils.rb +++ b/lib/java_buildpack/util/configuration_utils.rb @@ -119,14 +119,14 @@ def header(file) def load_configuration(file, operator_provided, operator_var_name, user_provided, user_var_name, clean_nil_values, should_log) - configuration = YAML.load_file(file) + configuration = YAML.load_file(file, permitted_classes: [Symbol], aliases: true) logger.debug { "Configuration from #{file}: #{configuration}" } if should_log if operator_provided begin operator_provided_value = YAML.safe_load(operator_provided) configuration = merge_configuration(configuration, operator_provided_value, operator_var_name, should_log) - rescue Psych::SyntaxError => e + rescue Psych::SyntaxError, Psych::DisallowedClass => e raise "Default configuration value in environment variable #{operator_var_name} has invalid syntax: #{e}" end end @@ -135,7 +135,7 @@ def load_configuration(file, operator_provided, operator_var_name, user_provided begin user_provided_value = YAML.safe_load(user_provided) configuration = merge_configuration(configuration, user_provided_value, user_var_name, should_log) - rescue Psych::SyntaxError => e + rescue Psych::SyntaxError, Psych::DisallowedClass => e raise "User configuration value in environment variable #{user_var_name} has invalid syntax: #{e}" end logger.debug { "Configuration from #{file} modified with: #{user_provided}" } if should_log diff --git a/lib/java_buildpack/util/tokenized_version.rb b/lib/java_buildpack/util/tokenized_version.rb index dacd564d83..12e0e82dc0 100644 --- a/lib/java_buildpack/util/tokenized_version.rb +++ b/lib/java_buildpack/util/tokenized_version.rb @@ -93,10 +93,7 @@ def major_or_minor_and_tail(s) tokens = s.match(/^([^.]+)(?:\.(.*))?/) - # disable as we still have to support Ruby 2.5, remove & update when we drop Bionic support - # rubocop:disable Style/SlicingWithRange - major_or_minor, tail = tokens[1..-1] - # rubocop:enable Style/SlicingWithRange + major_or_minor, tail = tokens[1..] raise "Invalid major or minor version '#{major_or_minor}'" unless valid_major_minor_or_micro major_or_minor end @@ -113,10 +110,7 @@ def micro_and_qualifier(s) tokens = s.match(/^([^_]+)(?:_(.*))?/) - # disable as we still have to support Ruby 2.5, remove & update when we drop Bionic support - # rubocop:disable Style/SlicingWithRange - micro, qualifier = tokens[1..-1] - # rubocop:enable Style/SlicingWithRange + micro, qualifier = tokens[1..] raise "Invalid micro version '#{micro}'" unless valid_major_minor_or_micro micro raise "Invalid qualifier '#{qualifier}'" unless valid_qualifier qualifier diff --git a/spec/java_buildpack/util/cache/download_cache_spec.rb b/spec/java_buildpack/util/cache/download_cache_spec.rb index c082596df5..b482e8834b 100644 --- a/spec/java_buildpack/util/cache/download_cache_spec.rb +++ b/spec/java_buildpack/util/cache/download_cache_spec.rb @@ -326,18 +326,7 @@ .to_return(status: 200, body: 'foo-cached', headers: { Etag: 'foo-etag', 'Last-Modified' => 'foo-last-modified' }) allow(Net::HTTP).to receive(:Proxy).and_call_original - - # behavior changed between ruby 2 & 3 with how default hash kwargs are passed - # this causes different arguments for the mock based on the ruby version - # Remove this when we drop support for ruby 2 - case RUBY_VERSION - when /2\.\d+\.\d+/ - allow(Net::HTTP).to receive(:start).with('foo-uri', 80, {}).and_call_original - when /3\.\d+\.\d+/ - allow(Net::HTTP).to receive(:start).with('foo-uri', 80).and_call_original - else - raise 'unexpected ruby version' - end + allow(Net::HTTP).to receive(:start).with('foo-uri', 80).and_call_original download_cache.get(uri) {} end @@ -348,18 +337,7 @@ allow(ca_certs_directory).to receive(:exist?).and_return(true) allow(Net::HTTP).to receive(:Proxy).and_call_original - - # behavior changed between ruby 2 & 3 with how default hash kwargs are passed - # this causes different arguments for the mock based on the ruby version - # Remove this when we drop support for ruby 2 - case RUBY_VERSION - when /2\.\d+\.\d+/ - allow(Net::HTTP).to receive(:start).with('foo-uri', 80, {}).and_call_original - when /3\.\d+\.\d+/ - allow(Net::HTTP).to receive(:start).with('foo-uri', 80).and_call_original - else - raise 'unexpected ruby version' - end + allow(Net::HTTP).to receive(:start).with('foo-uri', 80).and_call_original download_cache.get(uri) {} end diff --git a/spec/java_buildpack/util/filtering_pathname_spec.rb b/spec/java_buildpack/util/filtering_pathname_spec.rb index 730cf66be6..0fdf972073 100644 --- a/spec/java_buildpack/util/filtering_pathname_spec.rb +++ b/spec/java_buildpack/util/filtering_pathname_spec.rb @@ -409,15 +409,15 @@ end it 'raises error if getwd is used' do - expect { described_class.getwd }.to raise_error(/undefined method `getwd'/) + expect { described_class.getwd }.to raise_error(NoMethodError, /undefined method [`']getwd'/) end it 'raises error if glob is used' do - expect { described_class.glob '' }.to raise_error(/undefined method `glob'/) + expect { described_class.glob '' }.to raise_error(NoMethodError, /undefined method [`']glob'/) end it 'raises error if pwd is used' do - expect { described_class.pwd }.to raise_error(/undefined method `pwd'/) + expect { described_class.pwd }.to raise_error(NoMethodError, /undefined method [`']pwd'/) end def create_file(filename) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6b0021bf5..6012db5df9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'tmpdir' require 'webmock/rspec' WebMock.disable_net_connect!(allow: 'codeclimate.com') From c269b5f37300e76028d4b4531c8f4ff0fbf81661 Mon Sep 17 00:00:00 2001 From: ramonskie Date: Tue, 18 Nov 2025 11:01:07 +0100 Subject: [PATCH 3/8] Update RuboCop toolchain for Ruby 3.4 support Add racc gem required by RuboCop parser in Ruby 3.4+, and update RuboCop to version 1.60+ which recognizes Ruby 3.4 as a supported version. Key changes: - Add racc gem (required by parser gem in Ruby 3.4+) - Update rubocop from 1.28.2 to 1.81.7 (adds Ruby 3.4 support) - Update rubocop-rspec from 2.10.0 to 3.8.0 - Modernize .rubocop.yml configuration: - Change 'require' to 'plugins' (new preferred syntax) - Replace deprecated RSpec/FilePath with RSpec/SpecFilePathFormat and RSpec/SpecFilePathSuffix - Update RSpec/VerifiedDoubleReference config (obsolete EnforcedStyle) This allows the buildpack's code quality tools to work with Ruby 3.4.7. --- .rubocop.yml | 4 ++-- Gemfile | 3 ++- Gemfile.lock | 47 +++++++++++++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 49fe20c4f8..38f85fc115 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ --- -require: +plugins: - rubocop-rspec AllCops: @@ -67,7 +67,7 @@ Lint/EmptyBlock: RSpec/MultipleMemoizedHelpers: Max: 10 RSpec/VerifiedDoubleReference: - EnforcedStyle: string + Enabled: false Style/OptionalBooleanParameter: Enabled: false Lint/RedundantCopDisableDirective: diff --git a/Gemfile b/Gemfile index e0334918f5..9c057db63f 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ source 'https://rubygems.org' gem 'base64' gem 'bigdecimal' gem 'digest' +gem 'racc' gem 'set' gem 'tmpdir' @@ -13,7 +14,7 @@ group :development do gem 'rake' gem 'redcarpet' gem 'rspec' - gem 'rubocop' + gem 'rubocop', '~> 1.60' gem 'rubocop-rspec' gem 'rubyzip' gem 'tee' diff --git a/Gemfile.lock b/Gemfile.lock index 3e3741456a..9206946216 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - ast (2.4.2) + ast (2.4.3) base64 (0.3.0) bigdecimal (3.3.1) crack (0.4.5) @@ -12,15 +12,21 @@ GEM digest (3.2.1) fileutils (1.8.0) hashdiff (1.0.1) - parallel (1.22.1) - parser (3.1.2.0) + json (2.16.0) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + parallel (1.27.0) + parser (3.3.10.0) ast (~> 2.4.1) + racc + prism (1.6.0) public_suffix (4.0.7) + racc (1.8.1) rainbow (3.1.1) rake (13.0.6) redcarpet (3.5.1) - regexp_parser (2.3.1) - rexml (3.2.5) + regexp_parser (2.11.3) + rexml (3.4.4) rspec (3.11.0) rspec-core (~> 3.11.0) rspec-expectations (~> 3.11.0) @@ -34,20 +40,24 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-support (3.11.0) - rubocop (1.28.2) + rubocop (1.81.7) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.17.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.17.0) - parser (>= 3.1.1.0) - rubocop-rspec (2.10.0) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.48.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-rspec (3.8.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + ruby-progressbar (1.13.0) rubyzip (2.3.2) set (1.1.2) tee (1.0.0) @@ -55,7 +65,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) tmpdir (0.3.1) fileutils - unicode-display_width (2.1.0) + unicode-display_width (2.6.0) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -71,10 +81,11 @@ DEPENDENCIES base64 bigdecimal digest + racc rake redcarpet rspec - rubocop + rubocop (~> 1.60) rubocop-rspec rubyzip set From a3f1d4c684bd3928b3f5da18d7f7f101a9b5e9bf Mon Sep 17 00:00:00 2001 From: ramonskie Date: Tue, 18 Nov 2025 11:01:29 +0100 Subject: [PATCH 4/8] Fix JavaMemoryAssistant spec missing test helper Add missing sub_configuration_context helper method to java_memory_assistant_spec.rb. This test has been broken since it was originally added in commit f2eee850 (Oct 26, 2016). The test references sub_configuration_context() on line 59 but never defined the helper method. Other specs (tomcat_spec.rb, open_jdk_like_spec.rb, ibm_jre_spec.rb) each define their own local helper following the same pattern. This is a pre-existing bug unrelated to the Ruby 3.4 migration - the test would have failed on any Ruby version (2.5, 2.6, 2.7, 3.0, 3.1, 3.4) with NoMethodError for undefined method 'sub_configuration_context'. Fixes #436 (original PR where test was introduced) --- spec/java_buildpack/framework/java_memory_assistant_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/java_buildpack/framework/java_memory_assistant_spec.rb b/spec/java_buildpack/framework/java_memory_assistant_spec.rb index 6390202362..46ec183291 100644 --- a/spec/java_buildpack/framework/java_memory_assistant_spec.rb +++ b/spec/java_buildpack/framework/java_memory_assistant_spec.rb @@ -73,3 +73,9 @@ class StubJavaMemoryAssistant < JavaBuildpack::Framework::JavaMemoryAssistant public :command, :sub_components, :supports? end + +def sub_configuration_context(configuration) + c = context.clone + c[:configuration] = configuration + c +end From df40274d7464738f5bfaaf8c3aaa3da81a8339af Mon Sep 17 00:00:00 2001 From: ramonskie Date: Tue, 18 Nov 2025 11:19:12 +0100 Subject: [PATCH 5/8] Fix REXML compatibility issues for Ruby 3.4 - Update TomcatGeodeStore to properly create XML documents with REXML - Ruby 3.4's REXML no longer allows creating documents with just XML declaration - Remove trailing whitespace from XML fixture files (REXML Pretty formatter now strips these) - All 972 non-integration tests now passing --- lib/java_buildpack/container/tomcat/tomcat_geode_store.rb | 3 ++- .../container_no_tomcat_version_geode_store_context_after.xml | 2 +- spec/fixtures/container_tomcat_geode_store_context_after.xml | 2 +- spec/fixtures/container_tomcat_redis_store_context_after.xml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/java_buildpack/container/tomcat/tomcat_geode_store.rb b/lib/java_buildpack/container/tomcat/tomcat_geode_store.rb index 5973f26fe3..c3b8c69fd9 100644 --- a/lib/java_buildpack/container/tomcat/tomcat_geode_store.rb +++ b/lib/java_buildpack/container/tomcat/tomcat_geode_store.rb @@ -129,7 +129,8 @@ def cache_client_xml_path end def create_cache_client_xml - document = REXML::Document.new('') + document = REXML::Document.new + document << REXML::XMLDecl.new('1.0', 'UTF-8') add_client_cache document write_xml cache_client_xml_path, document end diff --git a/spec/fixtures/container_no_tomcat_version_geode_store_context_after.xml b/spec/fixtures/container_no_tomcat_version_geode_store_context_after.xml index 4dac5ae1c8..6eec7d93fe 100644 --- a/spec/fixtures/container_no_tomcat_version_geode_store_context_after.xml +++ b/spec/fixtures/container_no_tomcat_version_geode_store_context_after.xml @@ -14,7 +14,7 @@ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. - --> + --> diff --git a/spec/fixtures/container_tomcat_geode_store_context_after.xml b/spec/fixtures/container_tomcat_geode_store_context_after.xml index 8eb45842b4..5eb5387deb 100644 --- a/spec/fixtures/container_tomcat_geode_store_context_after.xml +++ b/spec/fixtures/container_tomcat_geode_store_context_after.xml @@ -14,7 +14,7 @@ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. - --> + --> diff --git a/spec/fixtures/container_tomcat_redis_store_context_after.xml b/spec/fixtures/container_tomcat_redis_store_context_after.xml index 6fdfc7bf0a..d762cf8cfb 100644 --- a/spec/fixtures/container_tomcat_redis_store_context_after.xml +++ b/spec/fixtures/container_tomcat_redis_store_context_after.xml @@ -14,7 +14,7 @@ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. - --> + --> From 8d7800bd6d40f752f2d38eb6547032a0fa9b4d86 Mon Sep 17 00:00:00 2001 From: ramonskie Date: Tue, 18 Nov 2025 11:53:03 +0100 Subject: [PATCH 6/8] Update platform support from bionic to jammy/noble - Remove bionic (Ubuntu 18.04 EOL April 2023) from PLATFORMS - Add noble (Ubuntu 24.04 LTS) to PLATFORMS for future support - Keep jammy (Ubuntu 22.04 LTS) as primary supported platform - Update all documentation references from bionic to jammy - Aligns buildpack with Ubuntu LTS lifecycle and support dates The platform detection at runtime already supported all Ubuntu codenames via /etc/os-release parsing. This change only affects offline buildpack packaging (which platforms to cache) and documentation examples. --- docs/extending-repositories.md | 4 ++-- docs/framework-google_stackdriver_debugger.md | 2 +- docs/framework-google_stackdriver_profiler.md | 2 +- docs/framework-your_kit_profiler.md | 4 ++-- docs/jre-graal_vm_jre.md | 4 ++-- docs/jre-open_jdk_jre.md | 8 ++++---- docs/jre-oracle_jre.md | 4 ++-- docs/jre-sap_machine_jre.md | 8 ++++---- docs/jre-zing_jre.md | 4 ++-- docs/jre-zulu_jre.md | 4 ++-- rakelib/package.rb | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/extending-repositories.md b/docs/extending-repositories.md index f1c58a6ac1..9d7854f17d 100644 --- a/docs/extending-repositories.md +++ b/docs/extending-repositories.md @@ -55,7 +55,7 @@ end | Variable | Description | | -------- | ----------- | | `{default.repository.root}` | The common root for all repositories. Currently defaults to `https://java-buildpack.cloudfoundry.org`. -| `{platform}` | The platform that the application is running on. Currently detects `bionic`. +| `{platform}` | The platform that the application is running on. Currently detects `jammy`, `noble`, etc. | `{architecture}` | The architecture of the system as returned by Ruby. The value is typically one of `x86_64` or `x86`. ## Configuration @@ -95,5 +95,5 @@ In addition to declaring a specific versions to use, you can also specify a boun [`config/repository.yml`]: ../config/repository.yml [`JavaBuildpack::Repository::ConfiguredItem`]: ../lib/java_buildpack/repository/configured_item.rb [Configuration and Extension]: ../README.md#configuration-and-extension -[example]: https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/index.yml +[example]: https://java-buildpack.cloudfoundry.org/openjdk/jammy/x86_64/index.yml diff --git a/docs/framework-google_stackdriver_debugger.md b/docs/framework-google_stackdriver_debugger.md index adf4bca22a..82d1a4b991 100644 --- a/docs/framework-google_stackdriver_debugger.md +++ b/docs/framework-google_stackdriver_debugger.md @@ -39,5 +39,5 @@ The framework can be configured by modifying the [`config/google_stackdriver_deb [`config/google_stackdriver_debugger.yml`]: ../config/google_stackdriver_debugger.yml [Google Stackdriver Debugger Service]: https://cloud.google.com/debugger/ [repositories]: extending-repositories.md -[this listing]: https://java-buildpack.cloudfoundry.org/google-stackdriver-debugger/bionic/x86_64/index.yml +[this listing]: https://java-buildpack.cloudfoundry.org/google-stackdriver-debugger/jammy/x86_64/index.yml [version syntax]: extending-repositories.md#version-syntax-and-ordering diff --git a/docs/framework-google_stackdriver_profiler.md b/docs/framework-google_stackdriver_profiler.md index bbc174efaa..7bc3fa645f 100644 --- a/docs/framework-google_stackdriver_profiler.md +++ b/docs/framework-google_stackdriver_profiler.md @@ -39,5 +39,5 @@ The framework can be configured by modifying the [`config/google_stackdriver_pro [`config/google_stackdriver_profiler.yml`]: ../config/google_stackdriver_profiler.yml [Google Stackdriver Profiler Service]: https://cloud.google.com/profiler/ [repositories]: extending-repositories.md -[this listing]: https://java-buildpack.cloudfoundry.org/google-stackdriver-profiler/bionic/x86_64/index.yml +[this listing]: https://java-buildpack.cloudfoundry.org/google-stackdriver-profiler/jammy/x86_64/index.yml [version syntax]: extending-repositories.md#version-syntax-and-ordering diff --git a/docs/framework-your_kit_profiler.md b/docs/framework-your_kit_profiler.md index 45d98685a2..8c56095116 100644 --- a/docs/framework-your_kit_profiler.md +++ b/docs/framework-your_kit_profiler.md @@ -24,7 +24,7 @@ The framework can be configured by creating or modifying the [`config/your_kit_p | `enabled` | Whether to enable the YourKit Profiler | `port` | The port that the YourKit Profiler will listen on. Defaults to `10001`. | `repository_root` | The URL of the YourKit Profiler repository index ([details][repositories]). -| `version` | The version of the YourKit Profiler to use. Candidate versions can be found in the listings for [bionic][]. +| `version` | The version of the YourKit Profiler to use. Candidate versions can be found in the listings for [jammy][]. ## Creating SSH Tunnel After starting an application with the YourKit Profiler enabled, an SSH tunnel must be created to the container. To create that SSH container, execute the following command: @@ -40,7 +40,7 @@ Once the SSH tunnel has been created, your YourKit Profiler should connect to `l ![YourKit Configuration](framework-your_kit_profiler.png) [`config/your_kit_profiler.yml`]: ../config/your_kit_profiler.yml -[bionic]: https://download.run.pivotal.io/your-kit/bioni/x86_64/index.yml +[jammy]: https://download.run.pivotal.io/your-kit/bioni/x86_64/index.yml [Configuration and Extension]: ../README.md#configuration-and-extension [repositories]: extending-repositories.md [version syntax]: extending-repositories.md#version-syntax-and-ordering diff --git a/docs/jre-graal_vm_jre.md b/docs/jre-graal_vm_jre.md index c80ef30372..5ec9a60144 100644 --- a/docs/jre-graal_vm_jre.md +++ b/docs/jre-graal_vm_jre.md @@ -44,7 +44,7 @@ cf restage | `jre.repository_root` | The URL of the GraalVM repository index ([details][repositories]). | `jre.version` | The version of Java runtime to use. Candidate versions can be found in the the repository that you have created to house the JREs. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -169,7 +169,7 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 [`config/graal_vm_jre.yml`]: ../config/graal_vm_jre.yml [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [OpenJDK JRE]: jre-open_jdk_jre.md [GraalVM]: https://www.graalvm.org/ diff --git a/docs/jre-open_jdk_jre.md b/docs/jre-open_jdk_jre.md index 050de39b28..f5cac3083e 100644 --- a/docs/jre-open_jdk_jre.md +++ b/docs/jre-open_jdk_jre.md @@ -25,9 +25,9 @@ The JRE can be configured by modifying the [`config/open_jdk_jre.yml`][] file in | Name | Description | ---- | ----------- | `jre.repository_root` | The URL of the OpenJDK repository index ([details][repositories]). -| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the listings for [bionic][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. +| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the listings for [jammy][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -152,10 +152,10 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 ``` [`config/open_jdk_jre.yml`]: ../config/open_jdk_jre.yml -[bionic]: https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/index.yml +[jammy]: https://java-buildpack.cloudfoundry.org/openjdk/jammy/x86_64/index.yml [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [OpenJDK]: http://openjdk.java.net [repositories]: extending-repositories.md diff --git a/docs/jre-oracle_jre.md b/docs/jre-oracle_jre.md index 48d1091ae5..2b0635d3d0 100644 --- a/docs/jre-oracle_jre.md +++ b/docs/jre-oracle_jre.md @@ -44,7 +44,7 @@ cf restage | `jre.repository_root` | The URL of the Oracle repository index ([details][repositories]). | `jre.version` | The version of Java runtime to use. Candidate versions can be found in the the repository that you have created to house the JREs. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -172,7 +172,7 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 [`config/oracle_jre.yml`]: ../config/oracle_jre.yml [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [OpenJDK JRE]: jre-open_jdk_jre.md [Oracle]: http://www.oracle.com/technetwork/java/index.html diff --git a/docs/jre-sap_machine_jre.md b/docs/jre-sap_machine_jre.md index 28057bb20d..2aee4e2fb3 100644 --- a/docs/jre-sap_machine_jre.md +++ b/docs/jre-sap_machine_jre.md @@ -32,9 +32,9 @@ cf restage | Name | Description | ---- | ----------- | `jre.repository_root` | The URL of the SapMachine repository index ([details][repositories]). -| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the listings for [bionic][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. +| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the listings for [jammy][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -155,10 +155,10 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 ``` [`config/sap_machine_jre.yml`]: ../config/sap_machine_jre.yml -[bionic]: https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/index.yml +[jammy]: https://java-buildpack.cloudfoundry.org/openjdk/jammy/x86_64/index.yml [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [repositories]: extending-repositories.md [SapMachine]: https://sapmachine.io diff --git a/docs/jre-zing_jre.md b/docs/jre-zing_jre.md index 8e4b097317..c29adb9595 100644 --- a/docs/jre-zing_jre.md +++ b/docs/jre-zing_jre.md @@ -36,7 +36,7 @@ cf restage | `jre.repository_root` | The URL of the Azul Platform Prime repository index ([details][repositories]). | `jre.version` | The version of Java runtime to use. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -138,7 +138,7 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 [Azul Platform Prime]: https://www.azul.com/products/prime/ [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [repositories]: extending-repositories.md [version syntax]: extending-repositories.md#version-syntax-and-ordering diff --git a/docs/jre-zulu_jre.md b/docs/jre-zulu_jre.md index cc70bec43b..8d5bbb5bdd 100644 --- a/docs/jre-zulu_jre.md +++ b/docs/jre-zulu_jre.md @@ -35,7 +35,7 @@ cf restage | `jre.repository_root` | The URL of the Zulu repository index ([details][repositories]). | `jre.version` | The version of Java runtime to use. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`. | `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]). -| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [bionic][jvmkill-bionic]. +| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [jammy][jvmkill-jammy]. | `memory_calculator` | Memory calculator defaults, described below under "Memory". ### Additional Resources @@ -164,7 +164,7 @@ JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=99199 [Azul Zulu]: https://www.azul.com/products/zulu/ [Configuration and Extension]: ../README.md#configuration-and-extension [Java Buildpack Memory Calculator]: https://github.com/cloudfoundry/java-buildpack-memory-calculator -[jvmkill-bionic]: https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml +[jvmkill-jammy]: https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml [Memory Calculator's README]: https://github.com/cloudfoundry/java-buildpack-memory-calculator [repositories]: extending-repositories.md [version syntax]: extending-repositories.md#version-syntax-and-ordering diff --git a/rakelib/package.rb b/rakelib/package.rb index f3948ee189..3635f27d55 100644 --- a/rakelib/package.rb +++ b/rakelib/package.rb @@ -76,7 +76,7 @@ def self.version BUILDPACK_VERSION = JavaBuildpack::BuildpackVersion.new(false).freeze - PLATFORMS = %w[bionic jammy].freeze + PLATFORMS = %w[jammy noble].freeze STAGING_DIR = "#{BUILD_DIR}/staging".freeze From 1e2bbbcc1d0bf8802b33bb6d0c201275f3b561fc Mon Sep 17 00:00:00 2001 From: ramonskie Date: Tue, 18 Nov 2025 11:57:35 +0100 Subject: [PATCH 7/8] Update CI Dockerfile to Ruby 3.4.7 and Ubuntu Jammy - Update base image from ubuntu:bionic to ubuntu:jammy - Remove old Ruby versions (2.5.9, 2.7.6, 3.0.4, 3.1.3) - Install only Ruby 3.4.7 and set as global default - Update libssl1.0-dev to libssl-dev for jammy compatibility - Update python to python3 (Python 2 removed from jammy) - Align bundler version with Gemfile.lock (2.3.12) This streamlines CI builds and aligns with the Ruby 3.4.7 migration. Reduces Docker image build time and size by removing 3 unused Ruby versions. --- ci/Dockerfile | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 79a666b0c0..0b9bc77e52 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,4 +1,4 @@ -ARG base_image=ubuntu:bionic +ARG base_image=ubuntu:jammy FROM ${base_image} RUN apt-get update && apt-get install -y wget gnupg @@ -10,11 +10,13 @@ RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ - libssl1.0-dev \ + libffi-dev \ + libssl-dev \ libreadline-dev \ + libyaml-dev \ lsb-release \ locales \ - python \ + python3 \ zip \ zlib1g-dev \ bellsoft-java17 \ @@ -32,16 +34,8 @@ RUN eval "$(rbenv init -)" \ RUN eval "$(rbenv init -)" \ && git clone https://github.com/sstephenson/rbenv-default-gems.git $(rbenv root)/plugins/rbenv-default-gems \ - && echo 'bundler 2.3.26' >> $(rbenv root)/default-gems + && echo 'bundler 2.3.12' >> $(rbenv root)/default-gems RUN eval "$(rbenv init -)" \ - && rbenv install 2.5.9 - -RUN eval "$(rbenv init -)" \ - && rbenv install 2.7.6 - -RUN eval "$(rbenv init -)" \ - && rbenv install 3.0.4 - -RUN eval "$(rbenv init -)" \ - && rbenv install 3.1.3 + && rbenv install 3.4.7 \ + && rbenv global 3.4.7 From a17ea51d480cf82a983d844de50afcc5e2de2afe Mon Sep 17 00:00:00 2001 From: ramonskie Date: Mon, 24 Nov 2025 16:28:21 +0100 Subject: [PATCH 8/8] Fix Ruby version compatibility by always using buildpack Ruby instead of system Ruby --- bin/run | 8 +++++--- config/ruby.yml | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/run b/bin/run index dc6220f0f1..f7ea7c9633 100755 --- a/bin/run +++ b/bin/run @@ -93,13 +93,15 @@ function main() { local phase phase="$(basename "${0}")" - if ! which ruby > /dev/null; then - mkdir -p "${RUBY_DIR}" + # Always install and use buildpack Ruby to ensure consistent version + # regardless of system Ruby availability + mkdir -p "${RUBY_DIR}" + if [ ! -d "${RUBY_DIR}/bin" ]; then util::install - util::environment::setup fi + util::environment::setup exec "${BUILDPACK_DIR}/bin/ruby-run" "${phase}" "${@-}" } diff --git a/config/ruby.yml b/config/ruby.yml index 94541f7ee4..0d05199092 100644 --- a/config/ruby.yml +++ b/config/ruby.yml @@ -14,6 +14,8 @@ # limitations under the License. # Configuration for Ruby +# Note: Ruby 3.2.8+ is required for Psych 5.0.1+ which supports YAML.load_file +# with permitted_classes and aliases keyword arguments used throughout the buildpack --- version: 3.2.+ repository_root: https://raw.githubusercontent.com/cloudfoundry/ruby-buildpack/master/java-index