Skip to content

Commit af90c84

Browse files
authored
Merge pull request #39 from OpenVoxProject/nmburgan/bump_ruby
Bump Ruby to 3.2.9, remove Boost from agent runtimes, remove PDK runtime
2 parents 2730c3a + 6f2d110 commit af90c84

File tree

10 files changed

+23
-272
lines changed

10 files changed

+23
-272
lines changed

configs/components/_base-ruby.rb

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,7 @@
6666
elsif platform.is_macos?
6767
pkg.environment 'optflags', settings[:cflags]
6868
if platform.is_cross_compiled?
69-
# Pin to an older version of [email protected] hosted by Puppet as Homebrew
70-
# moved its Ruby 2.7 formula from OpenSSL 1.1 to 3.0
71-
if ruby_version_y == "2.7"
72-
pkg.build_requires "puppetlabs/puppet/[email protected]"
73-
else
74-
pkg.build_requires "ruby@#{ruby_version_y}"
75-
end
69+
pkg.build_requires "ruby@#{ruby_version_y}"
7670
pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/
7771
pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/
7872
elsif platform.architecture == 'arm64' && platform.os_version.to_i >= 13
@@ -118,60 +112,3 @@
118112
pkg.install do
119113
[ "#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install" ]
120114
end
121-
122-
# For the pdk runtime, the ruby bin directory is different then the main bin
123-
# directory. In order to run ruby *outside* of the normal pdk.bat then we need
124-
# to copy all dlls that ruby depends on from the main bin directory to ruby's
125-
# bin directory. This is because the main bin directory is not in our system
126-
# PATH and Windows doesn't support RPATH. However, as mentioned in
127-
# https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order,
128-
# Windows searches for DLLs in "The folder the calling process was loaded from
129-
# (the executable's folder)."
130-
#
131-
# The agent runtime used to have the same issue prior to puppet 6, for example
132-
# RE-7593. However, Windows paths were changed to match *nix in puppet 6, see
133-
# commit 4b9d126dd5b. So only the pdk has this issue.
134-
if platform.is_windows? && settings[:bindir] != ruby_bindir
135-
bindir = settings[:bindir]
136-
137-
# Ruby 3+
138-
if Gem::Version.new(pkg.get_version) >= Gem::Version.new('3.0')
139-
pkg.install do
140-
[
141-
"cp #{settings[:gcc_bindir]}/libssp-0.dll #{ruby_bindir}",
142-
"cp #{bindir}/libffi-8.dll #{ruby_bindir}",
143-
"cp #{bindir}/libyaml-0-2.dll #{ruby_bindir}"
144-
]
145-
end
146-
end
147-
148-
if platform.architecture == "x64"
149-
gcc_postfix = 'seh'
150-
ssl_postfix = '-x64'
151-
else
152-
gcc_postfix = 'sjlj'
153-
ssl_postfix = ''
154-
end
155-
156-
# OpenSSL
157-
if Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('3.0')
158-
ssl_lib = "libssl-3#{ssl_postfix}.dll"
159-
crypto_lib = "libcrypto-3#{ssl_postfix}.dll"
160-
elsif Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('1.1.0')
161-
ssl_lib = "libssl-1_1#{ssl_postfix}.dll"
162-
crypto_lib = "libcrypto-1_1#{ssl_postfix}.dll"
163-
else
164-
ssl_lib = "ssleay32.dll"
165-
crypto_lib = "libeay32.dll"
166-
end
167-
168-
pkg.install do
169-
[
170-
"cp #{bindir}/libgcc_s_#{gcc_postfix}-1.dll #{ruby_bindir}",
171-
"cp #{bindir}/#{ssl_lib} #{ruby_bindir}",
172-
"cp #{bindir}/#{crypto_lib} #{ruby_bindir}"
173-
]
174-
end
175-
176-
pkg.directory ruby_dir
177-
end

configs/components/ruby-3.2.8.rb renamed to configs/components/ruby-3.2.rb

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
# The file name of the ruby component must match the ruby_version
2-
component 'ruby-3.2.8' do |pkg, settings, platform|
3-
pkg.version '3.2.8'
4-
# https://www.ruby-lang.org/en/downloads/releases/
5-
pkg.sha256sum '77acdd8cfbbe1f8e573b5e6536e03c5103df989dc05fa68c70f011833c356075'
1+
#####
2+
# Component release information:
3+
# https://github.com/ruby/ruby/releases
4+
# https://www.ruby-lang.org/en/downloads/releases/
5+
# Notes:
6+
# The file name of the ruby component must match the ruby_version
7+
#####
8+
component 'ruby-3.2' do |pkg, settings, platform|
9+
pkg.version '3.2.9'
10+
pkg.sha256sum 'abbad98db9aeb152773b0d35868e50003b8c467f3d06152577c4dfed9d88ed2a'
11+
12+
ruby_dir = settings[:ruby_dir]
13+
ruby_bindir = settings[:ruby_bindir]
14+
host_ruby = settings[:host_ruby]
615

716
# rbconfig-update is used to munge rbconfigs after the fact.
817
pkg.add_source("file://resources/files/ruby/rbconfig-update.rb")
918

10-
# PDK packages multiple rubies and we need to tweak some settings
11-
# if this is not the *primary* ruby.
12-
if pkg.get_version !~ /3\.2/ && pkg.get_version != settings[:ruby_version]
13-
# not primary ruby
14-
15-
# ensure we have config for this ruby
16-
unless settings.key?(:additional_rubies) && settings[:additional_rubies].key?(pkg.get_version)
17-
raise "missing config for additional ruby #{pkg.get_version}"
18-
end
19-
20-
ruby_settings = settings[:additional_rubies][pkg.get_version]
21-
22-
ruby_dir = ruby_settings[:ruby_dir]
23-
ruby_bindir = ruby_settings[:ruby_bindir]
24-
host_ruby = ruby_settings[:host_ruby]
25-
else
26-
# primary ruby
27-
ruby_dir = settings[:ruby_dir]
28-
ruby_bindir = settings[:ruby_bindir]
29-
host_ruby = settings[:host_ruby]
30-
end
31-
3219
# Most ruby configuration happens in the base ruby config:
3320
instance_eval File.read('configs/components/_base-ruby.rb')
3421

configs/components/ruby-shadow.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
ruby = File.join(settings[:ruby_bindir], 'ruby')
3939
end
4040

41-
matchdata = platform.settings[:ruby_version].match(/(\d+)\.(\d+)\.\d+/)
41+
matchdata = platform.settings[:ruby_version].match(/(\d+)\.(\d+)(\.\d+)?/)
4242
ruby_major_version = matchdata[1].to_i
4343
if ruby_major_version >= 3
4444
base = "resources/patches/ruby_32"

configs/components/virt-what.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
pkg.version "1.25"
1212
pkg.md5sum "2345f1ec5fa0836bff4071659730ac8f"
1313

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

1720
pkg.replaces 'pe-virt-what'

configs/projects/_shared-agent-components.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Common components required by all agent branches
1414
proj.component 'runtime-agent'
1515

16-
matchdata = platform.settings[:ruby_version].match(/(\d+)\.\d+\.\d+/)
16+
matchdata = platform.settings[:ruby_version].match(/(\d+)\.\d+(\.\d+)?/)
1717
ruby_major_version = matchdata[1].to_i
1818
# Ruby 3.2 does not package these two libraries so we need to add them as a component
1919
if ruby_major_version >= 3

configs/projects/_shared-agent-settings.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@
208208

209209
proj.timeout 7200 if platform.is_windows?
210210

211-
# These are the boost libraries we care about for OpenFact and friends
212-
proj.setting(:boost_libs, ["chrono", "date_time", "filesystem", "locale", "log", "program_options",
213-
"random", "regex", "system", "thread"])
214-
proj.setting(:boost_link_option, "link=shared")
215-
216211
# Most branches of puppet-agent use these openssl flags in addition to the defaults in configs/components/openssl.rb -
217212
# Individual projects can override these if necessary.
218213
proj.setting(:openssl_extra_configure_flags, [

configs/projects/agent-runtime-7.x.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,4 @@
7777
proj.component 'rubygem-nokogiri'
7878
proj.component 'rubygem-mini_portile2'
7979
end
80-
81-
proj.component 'boost' if ENV['NO_PXP_AGENT'].to_s.empty?
8280
end

configs/projects/agent-runtime-main.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
project 'agent-runtime-main' do |proj|
22

33
# Set preferred component versions if they differ from defaults:
4-
proj.setting :ruby_version, '3.2.8'
5-
proj.setting :rubygem_deep_merge_version, '1.2.2'
4+
proj.setting :ruby_version, '3.2' # Leave the .Z out for Ruby 3.2
65
proj.setting :rubygem_highline_version, '3.0.1'
76
proj.setting :rubygem_hocon_version, '1.4.0'
87
proj.setting :rubygem_net_ssh_version, '7.2.3'
@@ -79,12 +78,4 @@
7978
# Dependencies for gettext for Ruby >= 3.2 (PA-4815)
8079
proj.component 'rubygem-erubi'
8180
proj.component 'rubygem-prime'
82-
83-
# We are currently not building pxp-agent for Windows because it is unused for
84-
# OpenVox aside from execution_wrapper which is soon to be replaced, and because
85-
# we're having trouble getting things compiled correctly with the modern toolchain.
86-
# For a Windows, only build these if BUILD_WINDOWS_PXP_AGENT is set.
87-
# For other platforms, build these unless NO_PXP_AGENT is set.
88-
build_for_pxp_agent = platform.is_windows? ? !ENV['BUILD_WINDOWS_PXP_AGENT'].to_s.empty? : ENV['NO_PXP_AGENT'].to_s.empty?
89-
proj.component 'boost' if build_for_pxp_agent
9081
end

configs/projects/bolt-runtime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project 'bolt-runtime' do |proj|
22
# Used in component configurations to conditionally include dependencies
33
proj.setting(:runtime_project, 'bolt')
4-
proj.setting(:ruby_version, '3.2.8')
4+
proj.setting(:ruby_version, '3.2') # Leave the .Z out for Ruby 3.2
55
proj.setting(:openssl_version, '3.0')
66
# Legacy algos must be enabled in OpenSSL >= 3.0 for Bolt's WinRM transport to work.
77
proj.setting(:use_legacy_openssl_algos, true)

configs/projects/pdk-runtime.rb

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

0 commit comments

Comments
 (0)