pact-foundation / pact_broker-client

A Ruby and CLI client for the Pact Broker. Publish and retrieve pacts and verification results.
MIT License
69 stars 47 forks source link

ostruct will be dropped from stdlib in Ruby 3.5.0 #173

Open mefellows opened 1 month ago

mefellows commented 1 month ago

In the latest version of the CLI, the following warning is presented:

<path>/pact/lib/ruby/lib/ruby/3.3.0/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.

In general, fixing this should be a matter of making it an explicit dependency, albeit this might just be a matter of updating downstream dependencies.

Example PRs for other projects:

github-actions[bot] commented 1 month ago

🤖 Great news! We've labeled this issue as smartbear-supported and created a tracking ticket in PactFlow's Jira (PACT-2605). We'll keep work public and post updates here. Meanwhile, feel free to check out our docs. Thanks for your patience!

YOU54F commented 1 month ago

For a bit of history

https://github.com/ruby/json/issues/579

We are using json 2.7.1 (it is part of the standard lib for ruby 3.3.5 which we are using in traveling ruby)

When we move to ruby 3.4.x on release, we can bump the json gem in traveling ruby to 2.7.2 (currently locked in the pact-ruby-standalone repo, so we use std gems, and can build windows packages, as traveling ruby doesn't support building native extensions for windows)

https://github.com/pact-foundation/pact-ruby-standalone/blob/6a912648f56129188e00de2e4c331f636d31cc5b/packaging/Gemfile#L10-L14

https://stdgems.org/3.4.0/

json 2.7.2 makes the requirement on ostruct optional, but ostruct itself is required in a few of our projects explicitly so makes sense to add it.

YOU54F commented 1 month ago

Added the same for other usages of ostruct, adding a dev dep, where it is only used in specs

YOU54F commented 1 month ago

New versions of pact-ruby-standalone / pact-ruby-cli / pact-js-cli now going out

YOU54F commented 1 month ago

we've got one more on windows, this time for fiddle. I've formatted for readability

[15:22:32.551] DEBUG (1620): 

pact-cli@16.0.1: 
D:/a/pact-js-cli/pact-js-cli/
@pact-foundation/pact-cli-windows-x64/standalone/windows-x64-2.4.15/
pact/lib/ruby/lib/ruby/3.3.0/win32/registry.rb:2: 

warning: fiddle was loaded from the standard library, 
but will no longer be part of the default gems starting from Ruby 3.5.0.

Looks to be related to https://github.com/ruby/fiddle/issues/145

replicated in windows builds