Bug 2280109 - Puppet regsubst/Regexp.new incompatibility with Ruby 3.3
Summary: Puppet regsubst/Regexp.new incompatibility with Ruby 3.3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: puppet
Version: 40
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Breno
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/puppetlabs/puppet-...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-05-11 23:30 UTC by Ed Marshall
Modified: 2025-04-24 03:38 UTC (History)
4 users (show)

Fixed In Version: puppet-8.10.0-1.fc43 puppet-8.10.0-1.fc42
Clone Of:
Environment:
Last Closed: 2025-04-15 19:07:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ed Marshall 2024-05-11 23:30:19 UTC
Puppet's regsubst function (specifically, the pattern-as-string signature variant) breaks with Ruby 3.3:
- https://github.com/puppetlabs/puppet-enterprise_issues/issues/8#issuecomment-2035524085 (re: not upgrading PE to Ruby 3.3 specifically because of this)
- vaguely related: https://github.com/puppetlabs/puppet/issues/9302

On the ruby side, the third argument to Regexp.new (encoding) was deprecated in Ruby 3.2, and removed completely in 3.3:
- https://bugs.ruby-lang.org/issues/18797

For my environment, the "fix" was to edit puppet/functions/regsubst.rb#regsubst_string and simply remove the encoding argument to Regexp.compile, but that's obviously incorrect; a real patch here would probably do a switch on the encoding enum and either forcibly set the string encoding, or add Regexp::NOENCODING to re_flags in the 'N' case.



Reproducible: Always

Steps to Reproduce:
Use the string variant of regsubst with puppet in Fedora 40.
Actual Results:  
It fails with:

Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, wrong number of arguments (given 3, expected 1..2)

Expected Results:  
No error, manifest compilation completes as expected.

Comment 1 Fedora Update System 2025-04-15 17:45:26 UTC
FEDORA-2025-43731b849e (puppet-8.10.0-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-43731b849e

Comment 2 Fedora Update System 2025-04-15 19:07:09 UTC
FEDORA-2025-43731b849e (puppet-8.10.0-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 3 Fedora Update System 2025-04-15 21:19:05 UTC
FEDORA-2025-13f2e70c1c (puppet-8.10.0-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-13f2e70c1c

Comment 4 Fedora Update System 2025-04-16 01:04:20 UTC
FEDORA-2025-13f2e70c1c has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-13f2e70c1c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-13f2e70c1c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2025-04-24 03:38:59 UTC
FEDORA-2025-13f2e70c1c (puppet-8.10.0-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.