puppetlabs / puppet

Server automation framework and application
https://puppet.com/open-source/#osp
Apache License 2.0
7.46k stars 2.19k forks source link

Add syslog & ostruct as runtime dependencies #9505

Closed bastelfreak closed 1 month ago

bastelfreak commented 1 month ago

The syslog gem moves from default gems to a normal gem in Ruby 3.4. It raises the following warning on Ruby 3.3.5:

lib/puppet/util/command_line.rb:14: warning: syslog was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.

The ostruct gem moves from default gems to a normal gem in Ruby 3.5. It raises the following warning on Ruby 3.3.5:

lib/puppet/util/command_line.rb:14: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
puppetlabs-jenkins commented 1 month ago

Can one of the admins verify this patch?

joshcooper commented 1 month ago

I think this will work in both bundler and rubygems contexts:

-  if platform == 'x64-mingw32' || platform == 'x86-mingw32'
+  if (platform == 'x64-mingw32' || platform == 'x86-mingw32') || Gem.win_platform?
     # ffi 1.16.0 - 1.16.2 are broken on Windows
     spec.add_runtime_dependency('ffi', '>= 1.15.5', '< 1.17.0', '!= 1.16.0', '!= 1.16.1', '!= 1.16.2')
     spec.add_runtime_dependency('minitar', '~> 0.9')
+  elsif !Gem.java_platform?
+    spec.add_runtime_dependency('syslog', '~> 0.1.2')
   end
 end
joshcooper commented 1 month ago

gah this broke CI, I'll need to revert and resubmit after the runtime is fixed

/opt/puppetlabs/puppet/lib/ruby/3.2.0/bundler.rb
Writing lockfile to /root/Gemfile.lock
Resolving dependencies...
Could not find compatible versions

Because every version of puppet depends on syslog ~> 0.1.2
   and syslog ~> 0.1.2 could not be found in locally installed gems,
   puppet cannot be used.
 So, because tmp.o83z2ywwyX depends on puppet = 8.11.0,
   version solving has failed.
joshcooper commented 1 month ago

Reverted in https://github.com/puppetlabs/puppet/commit/b2b381b7c663588ed7a731ca98891adced84d6dc