[Pkg-puppet-devel] Bug#973248: Deprecation warning in Ruby 2.7: $SAFE will become a normal global variable in Ruby 3.0

intrigeri intrigeri at debian.org
Mon Mar 8 07:50:20 GMT 2021


Control: tag -1 + patch
Control: severity -1 important

Hi,

Miquel van Smoorenburg (2020-10-27):
> I get this warning on a puppet run:
>
> /usr/lib/ruby/vendor_ruby/puppet/file_system/uniquefile.rb:126: warning: 
> $SAFE will become a normal global variable in Ruby 3.0

Confirmed here.

I'm bumping the severity to "important" because with typical Puppet
deployments, this bug will yield tons of noise in whatever monitoring
system is used, which makes it pretty much unusable as-is.

> So I tried another minimal approach. This fixes it for me, and it should 
> also fix those other deprecation warnings from #955532, so that patch 
> can be dropped if you want.

The way #955532 was fixed (by backporting an upstream commit) seems
cleaner to me so personally, I'd rather see the big-hammer approach
proposed here used as little as possible.

Below, I'll share the version of the patch that I'm now using.
It only tackles the problem this bug is about,
and I believe the code style is a bit more canonical Ruby
(guard clause instead of "if" + unspecified else).

Dear maintainers, I would like this bug to be fixed in Bullseye, to
avoid having to maintain a local workaround on the Tails infra for the
next 2-5 years. If it may help, I could negotiate a freeze exception
with the release team, and if they agree, upload a NMU.

What do you think?


--- /a/puppet 2020-10-25 17:04:24.000000000 +0000
+++ /b/puppet     2021-03-08 07:39:16.294675668 +0000
@@ -1,5 +1,12 @@
 #!/usr/bin/ruby

+
+def Warning.warn(w)
+  return if w =~ /warning: \$SAFE will become a normal global variable/
+
+  super w
+end
+
 begin
   require 'puppet/util/command_line'
   Puppet::Util::CommandLine.new.execute



More information about the Pkg-puppet-devel mailing list