puppetlabs / puppet-runtime

runtime dependencies for Vanagon projects
Apache License 2.0
5 stars 88 forks source link

Add syslog to runtimes with Ruby >= 3.4 #915

Closed mhashizume closed 1 month ago

mhashizume commented 1 month ago

Ruby 3.4 will move the syslog gem from a default gem to bundled gem. Ruby 3.3 is already warning about this:

warning: syslog was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add syslog to your Gemfile or gemspec.

Since syslog requires native extensions, we should include it in any runtimes that use Ruby >= 3.4, once that's been released.

github-actions[bot] commented 1 month ago

Migrated issue to PA-6971

joshcooper commented 1 month ago

Thanks for filing @mhashizume! I would expect the ruby 3.4 build and install all of the "bundled" gems, so I'm hoping we don't actually need to do anything? For example, our agent-runtime-main tarball contains the rss gem which isn't a runtime component, but is present in the tarball:

$ tar tf agent-runtime-main-202409090.ubuntu-20.04-amd64.tar.gz | grep 'rss-.*.gem'
opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/cache/rss-0.2.9.gem
opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/specifications/rss-0.2.9.gemspec

However, since the syslog gem contains native extensions, it may not be that simple, so thanks again for filing.

joshcooper commented 1 month ago

Based on https://github.com/ruby/ruby/blob/9d69619623ec6b86c464b7cac911b7201f74dab7/gems/bundled_gems#L35C1-L36C1 I think we safely assume syslog will be a bundled gem and will be present in the ruby that we build (if/when we move to Ruby 3.4.x).

Also racc was changed from default to bundled gem in 3.3.x, https://github.com/ruby/ruby/blob/ef084cc8f4958c1b6e4ead99136631bef6d8ddba/gems/bundled_gems#L23, so we can assume that is present as well.