Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 1 addition & 64 deletions configs/components/_base-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@
elsif platform.is_macos?
pkg.environment 'optflags', settings[:cflags]
if platform.is_cross_compiled?
# Pin to an older version of ruby@2.7 hosted by Puppet as Homebrew
# moved its Ruby 2.7 formula from OpenSSL 1.1 to 3.0
if ruby_version_y == "2.7"
pkg.build_requires "puppetlabs/puppet/ruby@2.7"
else
pkg.build_requires "ruby@#{ruby_version_y}"
end
pkg.build_requires "ruby@#{ruby_version_y}"
pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/
pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/
elsif platform.architecture == 'arm64' && platform.os_version.to_i >= 13
Expand Down Expand Up @@ -118,60 +112,3 @@
pkg.install do
[ "#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install" ]
end

# For the pdk runtime, the ruby bin directory is different then the main bin
# directory. In order to run ruby *outside* of the normal pdk.bat then we need
# to copy all dlls that ruby depends on from the main bin directory to ruby's
# bin directory. This is because the main bin directory is not in our system
# PATH and Windows doesn't support RPATH. However, as mentioned in
# https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order,
# Windows searches for DLLs in "The folder the calling process was loaded from
# (the executable's folder)."
#
# The agent runtime used to have the same issue prior to puppet 6, for example
# RE-7593. However, Windows paths were changed to match *nix in puppet 6, see
# commit 4b9d126dd5b. So only the pdk has this issue.
if platform.is_windows? && settings[:bindir] != ruby_bindir
bindir = settings[:bindir]

# Ruby 3+
if Gem::Version.new(pkg.get_version) >= Gem::Version.new('3.0')
pkg.install do
[
"cp #{settings[:gcc_bindir]}/libssp-0.dll #{ruby_bindir}",
"cp #{bindir}/libffi-8.dll #{ruby_bindir}",
"cp #{bindir}/libyaml-0-2.dll #{ruby_bindir}"
]
end
end

if platform.architecture == "x64"
gcc_postfix = 'seh'
ssl_postfix = '-x64'
else
gcc_postfix = 'sjlj'
ssl_postfix = ''
end

# OpenSSL
if Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('3.0')
ssl_lib = "libssl-3#{ssl_postfix}.dll"
crypto_lib = "libcrypto-3#{ssl_postfix}.dll"
elsif Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('1.1.0')
ssl_lib = "libssl-1_1#{ssl_postfix}.dll"
crypto_lib = "libcrypto-1_1#{ssl_postfix}.dll"
else
ssl_lib = "ssleay32.dll"
crypto_lib = "libeay32.dll"
end

pkg.install do
[
"cp #{bindir}/libgcc_s_#{gcc_postfix}-1.dll #{ruby_bindir}",
"cp #{bindir}/#{ssl_lib} #{ruby_bindir}",
"cp #{bindir}/#{crypto_lib} #{ruby_bindir}"
]
end

pkg.directory ruby_dir
end
41 changes: 14 additions & 27 deletions configs/components/ruby-3.2.8.rb → configs/components/ruby-3.2.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
# The file name of the ruby component must match the ruby_version
component 'ruby-3.2.8' do |pkg, settings, platform|
pkg.version '3.2.8'
# https://www.ruby-lang.org/en/downloads/releases/
pkg.sha256sum '77acdd8cfbbe1f8e573b5e6536e03c5103df989dc05fa68c70f011833c356075'
#####
# 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-3.2' do |pkg, settings, platform|
pkg.version '3.2.9'
pkg.sha256sum 'abbad98db9aeb152773b0d35868e50003b8c467f3d06152577c4dfed9d88ed2a'

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")

# PDK packages multiple rubies and we need to tweak some settings
# if this is not the *primary* ruby.
if pkg.get_version !~ /3\.2/ && pkg.get_version != settings[:ruby_version]
# not primary ruby

# ensure we have config for this ruby
unless settings.key?(:additional_rubies) && settings[:additional_rubies].key?(pkg.get_version)
raise "missing config for additional ruby #{pkg.get_version}"
end

ruby_settings = settings[:additional_rubies][pkg.get_version]

ruby_dir = ruby_settings[:ruby_dir]
ruby_bindir = ruby_settings[:ruby_bindir]
host_ruby = ruby_settings[:host_ruby]
else
# primary ruby
ruby_dir = settings[:ruby_dir]
ruby_bindir = settings[:ruby_bindir]
host_ruby = settings[:host_ruby]
end

# Most ruby configuration happens in the base ruby config:
instance_eval File.read('configs/components/_base-ruby.rb')

Expand Down
2 changes: 1 addition & 1 deletion configs/components/ruby-shadow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
ruby = File.join(settings[:ruby_bindir], 'ruby')
end

matchdata = platform.settings[:ruby_version].match(/(\d+)\.(\d+)\.\d+/)
matchdata = platform.settings[:ruby_version].match(/(\d+)\.(\d+)(\.\d+)?/)
ruby_major_version = matchdata[1].to_i
if ruby_major_version >= 3
base = "resources/patches/ruby_32"
Expand Down
5 changes: 4 additions & 1 deletion configs/components/virt-what.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
pkg.version "1.25"
pkg.md5sum "2345f1ec5fa0836bff4071659730ac8f"

pkg.url "https://people.redhat.com/~rjones/virt-what/files/virt-what-#{pkg.get_version}.tar.gz"
# 2025-08-05: The upstream site was down, so using a mirror here. Revert this back to the
# original URL next time we bump this.
#pkg.url "https://people.redhat.com/~rjones/virt-what/files/virt-what-#{pkg.get_version}.tar.gz"
pkg.url "https://artifacts.voxpupuli.org/components/virt-what-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/virt-what-#{pkg.get_version}.tar.gz"

pkg.replaces 'pe-virt-what'
Expand Down
2 changes: 1 addition & 1 deletion configs/projects/_shared-agent-components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Common components required by all agent branches
proj.component 'runtime-agent'

matchdata = platform.settings[:ruby_version].match(/(\d+)\.\d+\.\d+/)
matchdata = platform.settings[:ruby_version].match(/(\d+)\.\d+(\.\d+)?/)
ruby_major_version = matchdata[1].to_i
# Ruby 3.2 does not package these two libraries so we need to add them as a component
if ruby_major_version >= 3
Expand Down
5 changes: 0 additions & 5 deletions configs/projects/_shared-agent-settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@

proj.timeout 7200 if platform.is_windows?

# These are the boost libraries we care about for OpenFact and friends
proj.setting(:boost_libs, ["chrono", "date_time", "filesystem", "locale", "log", "program_options",
"random", "regex", "system", "thread"])
proj.setting(:boost_link_option, "link=shared")

# Most branches of puppet-agent use these openssl flags in addition to the defaults in configs/components/openssl.rb -
# Individual projects can override these if necessary.
proj.setting(:openssl_extra_configure_flags, [
Expand Down
2 changes: 0 additions & 2 deletions configs/projects/agent-runtime-7.x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,4 @@
proj.component 'rubygem-nokogiri'
proj.component 'rubygem-mini_portile2'
end

proj.component 'boost' if ENV['NO_PXP_AGENT'].to_s.empty?
end
11 changes: 1 addition & 10 deletions configs/projects/agent-runtime-main.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
project 'agent-runtime-main' do |proj|

# Set preferred component versions if they differ from defaults:
proj.setting :ruby_version, '3.2.8'
proj.setting :rubygem_deep_merge_version, '1.2.2'
proj.setting :ruby_version, '3.2' # Leave the .Z out for Ruby 3.2
proj.setting :rubygem_highline_version, '3.0.1'
proj.setting :rubygem_hocon_version, '1.4.0'
proj.setting :rubygem_net_ssh_version, '7.2.3'
Expand Down Expand Up @@ -79,12 +78,4 @@
# Dependencies for gettext for Ruby >= 3.2 (PA-4815)
proj.component 'rubygem-erubi'
proj.component 'rubygem-prime'

# We are currently not building pxp-agent for Windows because it is unused for
# OpenVox aside from execution_wrapper which is soon to be replaced, and because
# we're having trouble getting things compiled correctly with the modern toolchain.
# For a Windows, only build these if BUILD_WINDOWS_PXP_AGENT is set.
# For other platforms, build these unless NO_PXP_AGENT is set.
build_for_pxp_agent = platform.is_windows? ? !ENV['BUILD_WINDOWS_PXP_AGENT'].to_s.empty? : ENV['NO_PXP_AGENT'].to_s.empty?
proj.component 'boost' if build_for_pxp_agent
end
2 changes: 1 addition & 1 deletion configs/projects/bolt-runtime.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project 'bolt-runtime' do |proj|
# Used in component configurations to conditionally include dependencies
proj.setting(:runtime_project, 'bolt')
proj.setting(:ruby_version, '3.2.8')
proj.setting(:ruby_version, '3.2') # Leave the .Z out for Ruby 3.2
proj.setting(:openssl_version, '3.0')
# Legacy algos must be enabled in OpenSSL >= 3.0 for Bolt's WinRM transport to work.
proj.setting(:use_legacy_openssl_algos, true)
Expand Down
160 changes: 0 additions & 160 deletions configs/projects/pdk-runtime.rb

This file was deleted.