public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/puppet] f44: Fix ruby 4 issue (rhbz#246493)
@ 2026-06-04 16:44 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-04 16:44 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/puppet
Branch : f44
Commit : 0451922cc55cabede1d1631979b06b70cd269cae
Author : Terje Røsten <terjeros@gmail.com>
Date   : 2026-05-10T12:59:54+02:00
Stats  : +104/-4 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/puppet/c/0451922cc55cabede1d1631979b06b70cd269cae?branch=f44

Log:
Fix ruby 4 issue (rhbz#246493)

---
diff --git a/0001-Ruby-4-fixes-from-OpenVox.patch b/0001-Ruby-4-fixes-from-OpenVox.patch
new file mode 100644
index 0000000..66dbbde
--- /dev/null
+++ b/0001-Ruby-4-fixes-from-OpenVox.patch
@@ -0,0 +1,87 @@
+From 4f56ee5f83943a72e4e7bec5dc118bc9b969210b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Terje=20R=C3=B8sten?= <terjeros@gmail.com>
+Date: Sat, 9 May 2026 11:28:45 +0200
+Subject: [PATCH] Ruby 4 fixes from OpenVox
+
+---
+ lib/puppet/util/execution.rb      |  4 ++--
+ lib/puppet/util/monkey_patches.rb | 21 +--------------------
+ lib/puppet/util/tag_set.rb        |  3 ++-
+ 3 files changed, 5 insertions(+), 23 deletions(-)
+
+diff --git a/lib/puppet/util/execution.rb b/lib/puppet/util/execution.rb
+index c8673d2..171f49a 100644
+--- a/lib/puppet/util/execution.rb
++++ b/lib/puppet/util/execution.rb
+@@ -78,8 +78,8 @@ module Puppet::Util::Execution
+     # a predictable output
+     english_env = ENV.to_hash.merge({ 'LANG' => 'C', 'LC_ALL' => 'C' })
+     output = Puppet::Util.withenv(english_env) do
+-      # We are intentionally using 'pipe' with open to launch a process
+-      open("| #{command_str} 2>&1") do |pipe| # rubocop:disable Security/Open
++      # Use IO.popen instead of open for Ruby 4 compatibility
++      IO.popen("#{command_str} 2>&1", "r") do |pipe|
+         yield pipe
+       end
+     end
+diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
+index 0f72188..51d7260 100644
+--- a/lib/puppet/util/monkey_patches.rb
++++ b/lib/puppet/util/monkey_patches.rb
+@@ -22,15 +22,6 @@ module RDoc
+   end
+ end
+ 
+-class Object
+-  # ActiveSupport 2.3.x mixes in a dangerous method
+-  # that can cause rspec to fork bomb
+-  # and other strange things like that.
+-  def daemonize
+-    raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it."
+-  end
+-end
+-
+ unless Dir.singleton_methods.include?(:exists?)
+   class Dir
+     def self.exists?(file_name)
+@@ -52,22 +43,12 @@ end
+ require_relative '../../puppet/ssl/openssl_loader'
+ unless Puppet::Util::Platform.jruby_fips?
+   class OpenSSL::SSL::SSLContext
+-    if DEFAULT_PARAMS[:options]
+-      DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_NO_SSLv3
+-    else
+-      DEFAULT_PARAMS[:options] = OpenSSL::SSL::OP_NO_SSLv3
+-    end
+-
+     alias __original_initialize initialize
+     private :__original_initialize
+ 
+     def initialize(*args)
+       __original_initialize(*args)
+-      params = {
+-        :options => DEFAULT_PARAMS[:options],
+-        :ciphers => DEFAULT_PARAMS[:ciphers],
+-      }
+-      set_params(params)
++      set_params
+     end
+   end
+ end
+diff --git a/lib/puppet/util/tag_set.rb b/lib/puppet/util/tag_set.rb
+index 6bc09db..2ec1d19 100644
+--- a/lib/puppet/util/tag_set.rb
++++ b/lib/puppet/util/tag_set.rb
+@@ -11,7 +11,8 @@ class Puppet::Util::TagSet < Set
+   end
+ 
+   def to_yaml
+-    @hash.keys.to_yaml
++    # Ruby 4 changed Set's internal structure, use to_a instead of @hash.keys
++    to_a.to_yaml
+   end
+ 
+   def self.from_data_hash(data)
+-- 
+2.54.0
+

diff --git a/puppet.spec b/puppet.spec
index 3d7b6a9..a2ef08f 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -4,13 +4,14 @@
 
 Name:           puppet
 Version:        8.10.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Network tool for managing many disparate systems
 License:        Apache-2.0
 URL:            https://puppet.com
 Source0:        https://downloads.puppetlabs.com/puppet/%{name}-%{version}.tar.gz
 Source1:        https://downloads.puppetlabs.com/puppet/%{name}-%{version}.tar.gz.asc
 Source2:        RPM-GPG-KEY-puppet-20250406
+Patch:          0001-Ruby-4-fixes-from-OpenVox.patch
 # Get these by checking out the right tag from https://github.com/puppetlabs/puppet-agent and:
 # sed 's|.\+puppetlabs/\([a-z_-]\+\).git.\+tags/v\?\([0-9\.]\+\)"}|https://forge.puppet.com/v3/files/\1-\2.tar.gz|' configs/components/module-puppetlabs-*.json
 Source3:        https://forge.puppet.com/v3/files/puppetlabs-augeas_core-1.5.0.tar.gz
@@ -33,13 +34,17 @@ Patch:          openvox-dnf5.patch
 BuildArch: noarch
 
 # ruby-devel does not require the base package, but requires -libs instead
+BuildRequires: facter
+BuildRequires: gnupg2
+BuildRequires: hiera
 BuildRequires: ruby
 BuildRequires: ruby-devel
+BuildRequires: rubygem(concurrent-ruby) >= 1.1.9
+BuildRequires: rubygem(deep_merge) >= 1.0
+BuildRequires: rubygem(racc)
+BuildRequires: rubygem(semantic_puppet) >= 1.0.2
 BuildRequires: rubygem-json
-BuildRequires: facter
-BuildRequires: hiera
 BuildRequires: systemd
-BuildRequires: gnupg2
 Requires: hiera >= 3.3.1
 Requires: facter >= 4.3.0
 Requires: rubygem(concurrent-ruby) >= 1.1.9
@@ -146,6 +151,11 @@ echo "D %{_rundir}/%{name} 0755 %{name} %{name} -" > \
 rm -r %{buildroot}%{_datadir}/%{name}/ext/{debian,osx,solaris,suse,windows,systemd,redhat}
 rm %{buildroot}%{_datadir}/%{name}/ext/{build_defaults.yaml,project_data.yaml}
 
+%check
+# Minimal runtime check
+export RUBYLIB=%{buildroot}%{_datadir}/ruby/vendor_ruby
+%{buildroot}%{_bindir}/puppet agent --help
+
 %files
 %attr(-, puppet, puppet) %{_localstatedir}/log/%{name}
 %attr(-, root, root) %{_datadir}/%{name}
@@ -215,6 +225,9 @@ rm %{buildroot}%{_datadir}/%{name}/ext/{build_defaults.yaml,project_data.yaml}
 %systemd_postun_with_restart %{name}.service
 
 %changelog
+* Sat May 09 2026 Terje Rosten <terjeros@gmail.com> - 8.10.0-5
+- Fix ruby 4 issue (rhbz#246493)
+
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 8.10.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-04 16:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 16:44 [rpms/puppet] f44: Fix ruby 4 issue (rhbz#246493) 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox