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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Seahorse::Client::Plugin::PluginOption shape variation warnings #3002

Closed
bkuhlmann opened this issue Mar 31, 2024 · 6 comments 路 Fixed by #3003
Closed

Fix Seahorse::Client::Plugin::PluginOption shape variation warnings #3002

bkuhlmann opened this issue Mar 31, 2024 · 6 comments 路 Fixed by #3003
Labels
bug This issue is a bug. investigating Issue is being investigated

Comments

@bkuhlmann
Copy link

Describe the bug

Hello. 馃憢 I'm seeing Ruby warnings when installing the aws-sdk-core gem (via the aws-sdk-s3 gem).

Expected Behavior

I'd expect there to be no warnings when installing this gem.

Current Behavior

This is what I see when installing the gem:

/Users/demo/.cache/frum/versions/3.3.0/lib/ruby/gems/3.3.0/gems/aws-sdk-core-3.191.5/lib/seahorse/client/plugin.rb:116: warning: The class Seahorse::Client::Plugin::PluginOption reached 8 shape variations, instance variables accesses will be slower and memory usage increased.
It is recommended to define instance variables in a consistent order, for instance by eagerly defining them all in the #initialize method.

Reproduction Steps

To reproduce, run this Bundler Inline script:

#! /usr/bin/env ruby
# frozen_string_literal: true

# Save as `demo`, then `chmod 755 demo`, and run as `./demo`.

require "bundler/inline"

gemfile true do
  source "https://rubygems.org"

  gem "debug"
  gem "aws-sdk-s3"
  gem "nokogiri", "~> 1.13"
end

Possible Solution

The problem is that Seahorse::Client::Plugin::PluginOption is defining instance variables in the the wrong order (or they are being initialized in random order).

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-core

Environment details (Version of Ruby, OS environment)

ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [arm64-darwin23.4.0], macOS 14.4.1

@bkuhlmann bkuhlmann added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2024
@bkuhlmann bkuhlmann changed the title Fix Seahorse::Client::Plugin::PluginOption shape variations warnings Fix Seahorse::Client::Plugin::PluginOption shape variation warnings Mar 31, 2024
@jterapin
Copy link
Contributor

jterapin commented Apr 1, 2024

Thank you for the ticket! We will be taking a look.

@jterapin jterapin added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Apr 1, 2024
@jterapin
Copy link
Contributor

jterapin commented Apr 1, 2024

We were not able to reproduce the bug on our end. Is there any other flags or settings that you were using?

@jterapin
Copy link
Contributor

jterapin commented Apr 1, 2024

Disregard. We were able to reproduce the error with the -W:performance flag enabled.

We will now investigate a solution

@bkuhlmann
Copy link
Author

Thanks! Yeah, sorry, I should have mentioned you need that flag enabled. Here's what I always use in my Bash environment if it helps: export RUBYOPT="-W:deprecated -W:performance --yjit". This way I can detect potential production issues early rather than later.

Copy link

github-actions bot commented Apr 1, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@jterapin
Copy link
Contributor

jterapin commented Apr 1, 2024

This fix will be part of tomorrow's release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating Issue is being investigated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants