Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syslog & ostruct as runtime dependencies #9505

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

bastelfreak
Copy link
Contributor

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.

@bastelfreak bastelfreak requested a review from a team as a code owner October 21, 2024 18:36
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@bastelfreak bastelfreak force-pushed the syslog branch 2 times, most recently from fb644d7 to d76cf57 Compare October 21, 2024 18:46
puppet.gemspec Outdated Show resolved Hide resolved
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.
```
@bastelfreak bastelfreak force-pushed the syslog branch 2 times, most recently from 1bd312a to 88a6410 Compare October 21, 2024 21:19
puppet.gemspec Outdated Show resolved Hide resolved
@bastelfreak bastelfreak force-pushed the syslog branch 9 times, most recently from e2962f7 to f1b3d09 Compare October 24, 2024 18:38
@joshcooper
Copy link
Contributor

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

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.
```
@joshcooper joshcooper merged commit 2d332ce into puppetlabs:main Oct 24, 2024
11 checks passed
@bastelfreak bastelfreak deleted the syslog branch October 25, 2024 07:30
@joshcooper
Copy link
Contributor

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 added a commit that referenced this pull request Oct 25, 2024
This reverts commit 2d332ce, reversing
changes made to d2f3cd5.
@joshcooper
Copy link
Contributor

Reverted in b2b381b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants