From cda3ab7bbbb943171e441e75c0a7a72c03446ffb Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 21 Feb 2026 22:17:34 +0100 Subject: [PATCH 1/9] Add Ruby 4 component Signed-off-by: Tim Meusel --- configs/components/ruby-4.0.json | 4 + configs/components/ruby-4.0.rb | 186 ++++++++++++++++++++++++++ configs/projects/agent-runtime-8.x.rb | 1 + 3 files changed, 191 insertions(+) create mode 100644 configs/components/ruby-4.0.json create mode 100644 configs/components/ruby-4.0.rb diff --git a/configs/components/ruby-4.0.json b/configs/components/ruby-4.0.json new file mode 100644 index 00000000..8356525c --- /dev/null +++ b/configs/components/ruby-4.0.json @@ -0,0 +1,4 @@ +{ + "version": "4.0.3", + "sha256sum": "77964acc370d5c8375b9502e5ba6c13c03ef91ab9eb9f521c84fb42b9c9a6b0f" +} diff --git a/configs/components/ruby-4.0.rb b/configs/components/ruby-4.0.rb new file mode 100644 index 00000000..f4e5e4a1 --- /dev/null +++ b/configs/components/ruby-4.0.rb @@ -0,0 +1,186 @@ +##### +# Component release information: +# https://github.com/ruby/ruby/releases +# https://www.ruby-lang.org/en/downloads/releases/ +# Notes: +# The file name of the ruby component must match the ruby_version +##### +component 'ruby-4.0' do |pkg, settings, platform| + pkg.load_from_json('configs/components/ruby-4.0.json') + + ruby_dir = settings[:ruby_dir] + ruby_bindir = settings[:ruby_bindir] + host_ruby = settings[:host_ruby] + + # rbconfig-update is used to munge rbconfigs after the fact. + pkg.add_source('file://resources/files/ruby/rbconfig-update.rb') + + # Most ruby configuration happens in the base ruby config: + instance_eval File.read('configs/components/_base-ruby.rb') + + ######### + # PATCHES + ######### + + # base = 'resources/patches/ruby_40' + + # if platform.is_windows? + # pkg.apply_patch "#{base}/windows_mingw32_mkmf.patch" + # pkg.apply_patch "#{base}/ruby-faster-load_32.patch" + # pkg.apply_patch "#{base}/revert_speed_up_rebuilding_loaded_feature_index.patch" + # pkg.apply_patch "#{base}/revert-ruby-double-load-symlink.patch" + # pkg.apply_patch "#{base}/revert_ruby_utf8_default_encoding.patch" + # end + + # if platform.is_fips? + # # This is needed on Ruby < 3.3 until the fix is backported (if ever) + # # See: https://bugs.ruby-lang.org/issues/20000 + # pkg.apply_patch "#{base}/openssl3_fips.patch" + # end + + #################### + # ENVIRONMENT, FLAGS + #################### + + cflags = settings[:cflags] + cppflags = settings[:cppflags] + if platform.is_macos? + pkg.environment 'optflags', cflags + pkg.environment 'CFLAGS', cflags + pkg.environment 'CPPFLAGS', cppflags + pkg.environment 'LDFLAGS', settings[:ldflags] + pkg.environment 'CC', settings[:cc] + pkg.environment 'CXX', settings[:cxx] + pkg.environment 'MACOSX_DEPLOYMENT_TARGET', settings[:deployment_target] + pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin' + elsif platform.is_windows? + optflags = "#{cflags} -O3" + pkg.environment 'optflags', optflags + pkg.environment 'CFLAGS', optflags + pkg.environment 'MAKE', 'make' + else + pkg.environment 'optflags', '-O2' + end + + special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} " + + if (platform.is_debian? && platform.os_version.to_i >= 13) || (platform.is_ubuntu? && platform.os_version.to_f >= 25.04 || platform.is_sles? && platform.os_version.to_i >= 16) + # A problem with --enable-dtrace, which I suspect may be because of GCC on the Trixie image. + # Check if this is still needed next time we bump Ruby and/or bump the Debian 13 + # container to the release version. + cflags += ' -Wno-error=implicit-function-declaration ' + end + + special_flags += " CFLAGS='#{cflags}' LDFLAGS='#{settings[:ldflags]}' CPPFLAGS='#{settings[:cppflags]}' " if settings[:supports_pie] + + # Ruby's build process requires a "base" ruby and we need a ruby to install + # gems into the /opt/puppetlabs/puppet/lib directory. + # + # For native compiles, we don't want ruby's build process to use whatever ruby + # is in the PATH, as it's probably too old to build ruby 4.0. And we don't + # want to use/maintain pl-ruby if we don't have to. Instead set baseruby to + # "no" which will force ruby to build and use miniruby. + special_flags += ' --with-baseruby=no ' + + if platform.is_windows? + # ruby's configure script guesses the build host is `cygwin`, because we're using + # cygwin opensshd & bash. So mkmf will convert compiler paths, e.g. -IC:/... to + # cygwin paths, -I/cygdrive/c/..., which confuses mingw-w64. So specify the build + # target explicitly. + special_flags += " CPPFLAGS='-DFD_SETSIZE=2048' debugflags=-g " + + special_flags += ' --build x86_64-w64-mingw32 ' + elsif platform.is_macos? + special_flags += " --with-openssl-dir=#{settings[:prefix]} " + end + + without_dtrace = [ + 'macos-all-arm64', + 'macos-all-x86_64', + 'sles-12-ppc64le', + 'windows-all-x64' + ] + + # sometimes dtrace will be enabled at compile time if the dtrace binary is present + special_flags += if without_dtrace.include? platform.name + ' --enable-dtrace=no ' + else + ' --enable-dtrace ' + end + + ########### + # CONFIGURE + ########### + pkg.configure { ['bash autogen.sh'] } + + pkg.configure do + [ + "bash configure \ + --enable-shared \ + --disable-install-doc \ + --disable-install-rdoc \ + #{settings[:host]} \ + #{special_flags}" + ] + end + + ######### + # INSTALL + ######### + + if platform.is_windows? + # Ruby 3.2 copies bin/gem to $ruby_bindir/gem.cmd, but generates bat files for + # other gems like bundle.bat, irb.bat, etc. Just rename the cmd.cmd to cmd.bat + # as we used to in ruby 2.7 and earlier. + # + # Note that this step must happen after the install step above. + pkg.install do + %w[gem].map do |name| + "mv #{ruby_bindir}/#{name}.cmd #{ruby_bindir}/#{name}.bat" + end + end + + # Required when using `stack-protection-strong` and older versions of mingw-w64-gcc + pkg.install_file File.join(settings[:gcc_bindir], 'libssp-0.dll'), File.join(settings[:bindir], 'libssp-0.dll') + end + + target_doubles = { + 'aarch64-redhat-linux' => 'aarch64-linux', + 'arm-linux-gnueabihf' => 'arm-linux-eabihf', + 'arm-linux-gnueabi' => 'arm-linux-eabi', + 'x86_64-w64-mingw32' => 'x64-mingw32' + } + rbconfig_topdir = if target_doubles.key?(settings[:platform_triple]) + File.join(ruby_dir, 'lib', 'ruby', '4.0.0', target_doubles[settings[:platform_triple]]) + else + "$$(#{ruby_bindir}/ruby -e \"puts RbConfig::CONFIG[\\\"topdir\\\"]\")" + end + + # When cross compiling or building on non-linux, we sometimes need to patch + # the rbconfig.rb in the "host" ruby so that later when we try to build gems + # with native extensions, like ffi, the "host" ruby's mkmf will use the CC, + # etc specified below. For example, if we're building on mac Intel for ARM, + # then the CC override allows us to build ffi_c.so for ARM as well. The + # "host" ruby is configured in _shared-agent-settings + rbconfig_changes = {} + if platform.is_macos? + rbconfig_changes['CC'] = "#{settings[:cc]} #{cflags}" + elsif platform.is_windows? + rbconfig_changes['CC'] = 'x86_64-w64-mingw32-gcc' + end + + pkg.add_source('file://resources/files/ruby_vendor_gems/operating_system.rb') + defaults_dir = File.join(settings[:libdir], 'ruby/4.0.0/rubygems/defaults') + pkg.directory(defaults_dir) + pkg.install_file '../operating_system.rb', File.join(defaults_dir, 'operating_system.rb') + + if rbconfig_changes.any? + pkg.install do + [ + "#{host_ruby} ../rbconfig-update.rb \"#{rbconfig_changes.to_s.gsub('"', '\"')}\" #{rbconfig_topdir}", + "cp original_rbconfig.rb #{settings[:datadir]}/doc/rbconfig-#{pkg.get_version}-orig.rb", + "cp new_rbconfig.rb #{rbconfig_topdir}/rbconfig.rb" + ] + end + end +end diff --git a/configs/projects/agent-runtime-8.x.rb b/configs/projects/agent-runtime-8.x.rb index 2228112f..04318170 100644 --- a/configs/projects/agent-runtime-8.x.rb +++ b/configs/projects/agent-runtime-8.x.rb @@ -2,6 +2,7 @@ # Set preferred component versions if they differ from defaults: proj.setting :ruby_version, '3.2' # Leave the .Z out for Ruby 3.2 proj.setting :rubygem_highline_version, '3.0.1' + proj.setting :openssl_version, '3.0' ######## # Load shared agent settings From 641d612ccf99ba49c2c28bbe6fb751c934c87fca Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 12 May 2026 17:04:05 +0200 Subject: [PATCH 2/9] openvox 9: Remove curl This is a leftover. openvox itself doesn't use curl and we agreed on removing it, we just didn't want to do it in a minor release. Signed-off-by: Tim Meusel --- configs/projects/agent-runtime-main.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index a0de9392..7f3a67c1 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -41,7 +41,6 @@ proj.component 'libyaml' proj.component "openssl-#{proj.openssl_version}" - proj.component 'curl' proj.component 'puppet-ca-bundle' proj.component "ruby-#{proj.ruby_version}" From 74c6862e93e6126469fadde156abbdb4b531d079 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 12 May 2026 17:05:02 +0200 Subject: [PATCH 3/9] openvox 9: Remove rubygem-multi_json We agreed on removing it: https://github.com/OpenVoxProject/openvox/pull/293 Signed-off-by: Tim Meusel --- configs/projects/agent-runtime-main.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index 7f3a67c1..f13ef461 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -55,7 +55,6 @@ proj.component 'rubygem-highline' proj.component 'rubygem-hocon' proj.component 'rubygem-locale' - proj.component 'rubygem-multi_json' # TODO: obsolete for openvox 9 - https://github.com/OpenVoxProject/openvox/pull/293 proj.component 'rubygem-net-ssh' proj.component 'rubygem-optimist' proj.component 'rubygem-semantic_puppet' From 77d56c09cf866b0e35eebf88d42cd76e26782579 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 12 May 2026 17:06:21 +0200 Subject: [PATCH 4/9] openvox 9: Update Ruby 3.2->4.0 Signed-off-by: Tim Meusel --- configs/components/runtime-agent.rb | 4 ++-- configs/projects/agent-runtime-main.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index c12555a2..2e6a66ee 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -3,9 +3,9 @@ pkg.environment 'PROJECT_SHORTNAME', 'puppet' pkg.add_source 'file://resources/files/runtime/runtime.sh' - if platform.is_macos? && platform.is_cross_compiled? && (settings[:ruby_version] =~ /^3\./) + if platform.is_macos? && platform.is_cross_compiled? pkg.install do - # These are dependencies of ruby@3.x, remove symlinks from /usr/local + # These are dependencies of ruby@3.x / 4.x, remove symlinks from /usr/local # so our build doesn't use the wrong headers "cd /etc/homebrew && su test -c '#{platform.brew} unlink openssl libyaml'" end diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index f13ef461..0f32241b 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -1,7 +1,8 @@ project 'agent-runtime-main' do |proj| # Set preferred component versions if they differ from defaults: - proj.setting :ruby_version, '3.2' # Leave the .Z out for Ruby 3.2 - proj.setting :rubygem_highline_version, '3.0.1' + proj.setting :ruby_version, '4.0' # Leave the .Z out + proj.setting :rubygem_highline_version, '3.1.2' + proj.setting :openssl_version, '3.0' ######## # Load shared agent settings From 543799bb483cf7b3ef1db2be099c3f3e80f42b41 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 21 Feb 2026 23:16:26 +0100 Subject: [PATCH 5/9] Add openssl 3.5 builds Signed-off-by: Tim Meusel --- configs/components/openssl-3.5.json | 5 + configs/components/openssl-3.5.rb | 142 +++++++++++++++++++++ configs/projects/_shared-agent-settings.rb | 2 - configs/projects/agent-runtime-main.rb | 2 +- 4 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 configs/components/openssl-3.5.json create mode 100644 configs/components/openssl-3.5.rb diff --git a/configs/components/openssl-3.5.json b/configs/components/openssl-3.5.json new file mode 100644 index 00000000..bb74a0a7 --- /dev/null +++ b/configs/components/openssl-3.5.json @@ -0,0 +1,5 @@ +{ + "version": "3.5.6", + "url": "https://github.com/openssl/openssl/releases/download/openssl-3.5.6/openssl-3.5.6.tar.gz", + "sha256sum": "deae7c80cba99c4b4f940ecadb3c3338b13cb77418409238e57d7f31f2a3b736" +} diff --git a/configs/components/openssl-3.5.rb b/configs/components/openssl-3.5.rb new file mode 100644 index 00000000..6a81d5b4 --- /dev/null +++ b/configs/components/openssl-3.5.rb @@ -0,0 +1,142 @@ +##### +# Component release information: +# https://github.com/openssl/openssl/releases +# 3.5 isn't latest openssl, but latest LTS: https://openssl-library.org/policies/releasestrat/index.html +##### +component 'openssl' do |pkg, settings, platform| + pkg.load_from_json('configs/components/openssl-3.5.json') + pkg.mirror "#{settings[:buildsources_url]}/openssl-#{pkg.get_version}.tar.gz" + + ############################# + # ENVIRONMENT, FLAGS, TARGETS + ############################# + + if platform.is_rpm? && !platform.is_sles? + pkg.build_requires 'perl-core' + else + pkg.build_requires 'perl' + end + + target = '' + cflags = settings[:cflags] + ldflags = settings[:ldflags] + + if platform.is_windows? + pkg.environment 'PATH', "$(shell cygpath -u #{settings[:gcc_bindir]}):$(PATH)" + pkg.environment 'CYGWIN', settings[:cygwin] + pkg.environment 'MAKE', platform[:make] + + target = 'mingw64' + elsif platform.is_macos? + pkg.environment 'PATH', '$(PATH):/opt/homebrew/bin:/usr/local/bin' + pkg.environment 'CC', settings[:cc] + pkg.environment 'MACOSX_DEPLOYMENT_TARGET', settings[:deployment_target] + + target = "darwin64-#{platform.architecture}" + elsif platform.is_linux? + pkg.environment 'PATH', '$(PATH):/usr/local/bin' + + ldflags = "#{settings[:ldflags]} -Wl,-z,relro" + case platform.architecture + when /aarch64$/ + target = 'linux-aarch64' + when /64$/ + target = 'linux-x86_64' + when 'armhf' + target = 'linux-armv4' + end + end + + #################### + # BUILD REQUIREMENTS + #################### + + pkg.build_requires "runtime-#{settings[:runtime_project]}" + + ########### + # CONFIGURE + ########### + + # Defining --libdir ensures that we avoid the multilib (lib/ vs. lib64/) problem, + # since configure uses the existence of a lib64 directory to determine + # if it should install its own libs into a multilib dir. Yay OpenSSL! + configure_flags = [ + "--prefix=#{settings[:prefix]}", + '--libdir=lib', + "--openssldir=#{settings[:prefix]}/ssl", + 'shared', + 'no-gost', + target, + 'no-camellia', + 'no-md2', + 'no-ssl3', + 'no-ssl3-method', + 'no-dtls1-method', + 'no-dtls1_2-method', + 'no-aria', + 'no-bf', + 'no-cast', + 'no-des', + 'no-rc5', + 'no-mdc2', + 'no-rmd160', + 'no-whirlpool' + ] + + if settings[:use_legacy_openssl_algos] + pkg.apply_patch 'resources/patches/openssl/openssl-3-activate-legacy-algos.patch' + else + configure_flags << 'no-legacy' << 'no-md4' + end + + # Individual projects may provide their own openssl configure flags: + project_flags = settings[:openssl_extra_configure_flags] || [] + configure_flags << project_flags + + pkg.environment 'CFLAGS', cflags + pkg.environment 'LDFLAGS', ldflags + pkg.configure do + ["./Configure #{configure_flags.join(' ')}"] + end + + ####### + # BUILD + ####### + + build_commands = [] + + if platform.is_windows? && platform.architecture == 'x86' + # mingw-w32 5.2.0 has a bug in include/winnt.h that declares GetCurrentFiber + # with __CRT_INLINE, which results in the function not being inlined and + # generates a linker error: undefined reference to `GetCurrentFiber'. + # This only affects 32-bit builds + # See https://github.com/openssl/openssl/issues/513 + # See https://github.com/mingw-w64/mingw-w64/commit/8da1aae7a7ff5bf996878dc8fe30a0e01e210e5a + pkg.add_source('file://resources/patches/windows/FORCEINLINE-i686-w64-mingw32-winnt.h') + build_commands << "#{platform.patch} --dir #{settings[:gcc_root]}/#{settings[:platform_triple]} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../FORCEINLINE-i686-w64-mingw32-winnt.h" + end + + build_commands << "#{platform[:make]} depend" + build_commands << platform[:make] + + pkg.build do + build_commands + end + + ######### + # INSTALL + ######### + + install_prefix = platform.is_windows? ? '' : 'INSTALL_PREFIX=/' + install_commands = [] + + # Skip man and html docs + install_commands << "#{platform[:make]} #{install_prefix} install_sw install_ssldirs" + install_commands << "rm -f #{settings[:prefix]}/bin/c_rehash" + + pkg.install do + install_commands + end + + pkg.install_file 'LICENSE.txt', "#{settings[:prefix]}/share/doc/openssl-#{pkg.get_version}/LICENSE" +end diff --git a/configs/projects/_shared-agent-settings.rb b/configs/projects/_shared-agent-settings.rb index 4d68aa76..21f3e198 100644 --- a/configs/projects/_shared-agent-settings.rb +++ b/configs/projects/_shared-agent-settings.rb @@ -130,8 +130,6 @@ # Load default compiler settings instance_eval File.read('configs/projects/_shared-compiler-settings.rb') -proj.setting(:openssl_version, '3.0') - if platform.is_windows? proj.setting(:gcc_root, '/usr/x86_64-w64-mingw32/sys-root/mingw') proj.setting(:gcc_bindir, "#{proj.gcc_root}/bin") diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index 0f32241b..17412b52 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -2,7 +2,7 @@ # Set preferred component versions if they differ from defaults: proj.setting :ruby_version, '4.0' # Leave the .Z out proj.setting :rubygem_highline_version, '3.1.2' - proj.setting :openssl_version, '3.0' + proj.setting :openssl_version, '3.5' ######## # Load shared agent settings From 89df48a0f68f99992ad9f22dbbc886f8e6d91f0d Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 22 Feb 2026 00:50:23 +0100 Subject: [PATCH 6/9] hiera-eyaml: clarify base64 ordering Signed-off-by: Tim Meusel --- configs/projects/agent-runtime-main.rb | 1 + configs/projects/openbolt-runtime.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index 17412b52..ca3c8755 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -45,6 +45,7 @@ proj.component 'puppet-ca-bundle' proj.component "ruby-#{proj.ruby_version}" + # needs to come before hiera-eyaml. Otherwise vanagon tries to install a deb/rpm called rubygem-base64 proj.component 'rubygem-base64' proj.component 'rubygem-concurrent-ruby' proj.component 'rubygem-deep_merge' diff --git a/configs/projects/openbolt-runtime.rb b/configs/projects/openbolt-runtime.rb index 99475bc5..549b8f64 100644 --- a/configs/projects/openbolt-runtime.rb +++ b/configs/projects/openbolt-runtime.rb @@ -175,6 +175,7 @@ proj.component 'rubygem-bindata' proj.component 'rubygem-builder' proj.component 'rubygem-CFPropertyList' + # needs to come before hiera-eyaml. Otherwise vanagon tries to install a deb/rpm called rubygem-base64 proj.component 'rubygem-base64' proj.component 'rubygem-rexml' proj.component 'rubygem-colored2' From 6828ebd6f7d4e1c47e6b9aa8f760513ad052065f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 24 Feb 2026 20:45:14 +0100 Subject: [PATCH 7/9] update ruby-show for modern ruby Signed-off-by: Tim Meusel --- configs/components/ruby-shadow-patched.json | 4 +++ configs/components/ruby-shadow-patched.rb | 34 +++++++++++++++++++++ configs/projects/agent-runtime-main.rb | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 configs/components/ruby-shadow-patched.json create mode 100644 configs/components/ruby-shadow-patched.rb diff --git a/configs/components/ruby-shadow-patched.json b/configs/components/ruby-shadow-patched.json new file mode 100644 index 00000000..cbf73ccb --- /dev/null +++ b/configs/components/ruby-shadow-patched.json @@ -0,0 +1,4 @@ +{ + "url": "https://github.com/voxpupuli/ruby-shadow", + "ref": "bc7752a9ddbde06c1418734d003a9607bafcc6df" +} diff --git a/configs/components/ruby-shadow-patched.rb b/configs/components/ruby-shadow-patched.rb new file mode 100644 index 00000000..7a7252a4 --- /dev/null +++ b/configs/components/ruby-shadow-patched.rb @@ -0,0 +1,34 @@ +##### +# Component release information: +# https://github.com/apalmblad/ruby-shadow/tags +# https://rubygems.org/gems/ruby-shadow +# contains https://github.com/apalmblad/ruby-shadow/pull/29 +# We are building https://github.com/voxpupuli/ruby-shadow/compare/patch-extconf +# * contains https://github.com/apalmblad/ruby-shadow/pull/29 +# * diff https://github.com/apalmblad/ruby-shadow/compare/master...bastelfreak:ruby-shadow:patch-extconf +##### +component 'ruby-shadow-patched' do |pkg, settings, platform| + pkg.load_from_json('configs/components/ruby-shadow-patched.json') + + pkg.build_requires "ruby-#{settings[:ruby_version]}" + + pkg.environment 'CONFIGURE_ARGS', '--vendor' + + if platform.is_cross_compiled? + pkg.environment 'RUBY', settings[:host_ruby] + ruby = "#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb" + else + ruby = File.join(settings[:ruby_bindir], 'ruby') + end + + pkg.build do + [ + "#{ruby} extconf.rb", + "#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)" + ] + end + + pkg.install do + ["#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1) DESTDIR=/ install"] + end +end diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index ca3c8755..843c25c2 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -81,7 +81,7 @@ end unless platform.is_windows? - proj.component 'ruby-shadow' + proj.component 'ruby-shadow-patched' end # We only build ruby-selinux for EL, Fedora, Debian and Ubuntu (amd64/i386) From dc69b86504bee53604230ee5cd3467a675ed93db Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 24 Feb 2026 21:01:12 +0100 Subject: [PATCH 8/9] Ruby 4: Enable YJIT/ZJIT Signed-off-by: Tim Meusel --- configs/components/ruby-4.0.rb | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/configs/components/ruby-4.0.rb b/configs/components/ruby-4.0.rb index f4e5e4a1..231fda42 100644 --- a/configs/components/ruby-4.0.rb +++ b/configs/components/ruby-4.0.rb @@ -113,6 +113,38 @@ ########### pkg.configure { ['bash autogen.sh'] } + # we want to provide the different just in time compilers where possible + # they require a modern rust version + # https://docs.ruby-lang.org/en/master/jit/zjit_md.html zjit: Rust 1.85.0 + # https://docs.ruby-lang.org/en/master/jit/yjit_md.html yjit: Rust 1.58.0 + platforms_without_rust = [ + 'debian-11-aarch64', + 'debian-11-amd64', + 'debian-12-aarch64', + 'debian-12-amd64', + 'debian-13-armhf', + 'macos-all-arm64', + 'macos-all-x86_64', + 'sles-15-x86_64', + 'sles-16-aarch64', + 'sles-16-x86_64', + 'ubuntu-22.04-aarch64', + 'ubuntu-22.04-amd64', + 'ubuntu-24.04-aarch64', + 'ubuntu-24.04-amd64', + 'ubuntu-24.04-armhf', + 'ubuntu-25.04-aarch64', + 'ubuntu-25.04-amd64', + 'ubuntu-25.04-armhf', + 'ubuntu-26.04-armhf', + 'windows-all-x64' + ] + if platforms_without_rust.include? platform.name + configure_flags = '' + else + pkg.build_requires 'rustc' + configure_flags = '--enable-yjit --enable-zjit' + end pkg.configure do [ "bash configure \ @@ -120,7 +152,8 @@ --disable-install-doc \ --disable-install-rdoc \ #{settings[:host]} \ - #{special_flags}" + #{special_flags} \ + #{configure_flags}" ] end From 620bd214a7b31b4b5f195d3c002d10d88ba21e32 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 14 May 2026 23:12:53 +0200 Subject: [PATCH 9/9] Dont update base64 on Ruby 4.0 Signed-off-by: Tim Meusel --- configs/components/rubygem-hiera-eyaml.rb | 2 +- configs/projects/agent-runtime-main.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/components/rubygem-hiera-eyaml.rb b/configs/components/rubygem-hiera-eyaml.rb index b65f6987..a387da38 100644 --- a/configs/components/rubygem-hiera-eyaml.rb +++ b/configs/components/rubygem-hiera-eyaml.rb @@ -7,7 +7,7 @@ ### Maintained by update_gems automation ### pkg.version '5.0.1' pkg.sha256sum 'b463fc9aa8f310659251cc7efd8c5db2e0fa893c4bc5b97e07276cb597cb93e6' - pkg.build_requires 'rubygem-base64' + # pkg.build_requires 'rubygem-base64' only required on Ruby 3.2 pkg.build_requires 'rubygem-highline' pkg.build_requires 'rubygem-optimist' ### End automated maintenance section ### diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index 843c25c2..6424668f 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -45,8 +45,6 @@ proj.component 'puppet-ca-bundle' proj.component "ruby-#{proj.ruby_version}" - # needs to come before hiera-eyaml. Otherwise vanagon tries to install a deb/rpm called rubygem-base64 - proj.component 'rubygem-base64' proj.component 'rubygem-concurrent-ruby' proj.component 'rubygem-deep_merge' proj.component 'rubygem-erubi'