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

Support JSON 2.x in aws-sdk-v1 #1372

Closed
esilverberg opened this issue Dec 26, 2016 · 9 comments
Closed

Support JSON 2.x in aws-sdk-v1 #1372

esilverberg opened this issue Dec 26, 2016 · 9 comments

Comments

@esilverberg
Copy link

esilverberg commented Dec 26, 2016

I realize that aws-sdk-v1 is deprecated, and we are trying to move to 2.X branch, but we have a lot of code and will continue to be on -v1 for some time.

That said, ruby 2.4, just released, is not compatible with JSON 1.8.X, and aws-sdk-v1 requires JSON ~> 1.4

Is it possible for you to release a 1.67.0 release that uses JSON 2.X so we can continue to take updates to ruby and rely on aws-sdk-v1?

Hopefully you could just change or relax the ~> 1.4 requirement and the library would continue to "just work" assuming all your regression tests passed.

Thanks in advance!

@awood45
Copy link
Member

awood45 commented Dec 30, 2016

One concern we have is that we can't do such a release if it breaks Ruby 1.8 support. While Ruby 1.8 is end of life, so is V1 of the SDK, so there's a fine line we have to walk.

One possible workaround while we look at this would be to just fork the V1 repo, make the changes you need, and vendor that gem or cut a purpose-built release. Since V1 is end of life, it doesn't really create a sync issue unless there is a security issue down the line (since the end-of-life concern does not apply to security patches).

@awood45
Copy link
Member

awood45 commented Dec 30, 2016

In fact, it looks from the JSON gemspec that the most recent version requires Ruby 2.0, which means that for V1, dropping the JSON version lock would break a non-trivial number of customers if they upgrade.

V2 gets around this by not requiring anything outside of the standard library to be present as far as JSON goes.

So, I don't think we can cut a new release, but happy to leave this open for a bit to discuss mitigation options.

@awood45
Copy link
Member

awood45 commented Jan 5, 2017

We have too many Ruby 1.8 and Ruby 1.9 customers, as well as V1 being end of life, so I'm closing this as "no plan to fix". V2 should hopefully avoid this kind of problem (and does appear to) since it only depends on the Ruby standard library.

Feel free to add any further questions you have, if you have questions or issues with mitigation strategies.

@awood45 awood45 closed this as completed Jan 5, 2017
nachokb added a commit to seielit/aws-sdk-v1-ruby24 that referenced this issue Nov 21, 2017
Older JSON versions are incompatible with Ruby 2.4, while JSON 2.0 is
incompatible with Ruby 1.8.

Thus this gem is renamed to avoid breaking Ruby 1.8 apps.

Ref: aws#1372 (comment)
@nachokb
Copy link

nachokb commented Mar 12, 2018

for those who really can't upgrade the AWS SDK gem, you might want to use this:

gem 'aws-sdk-v1-ruby24',
  github: 'seielit/aws-sdk-v1-ruby24',
  ref: 'aws-sdk-v1-ruby24'

@LimeBlast
Copy link

@nachokb You're a life saver. Thank you.

@pboling
Copy link

pboling commented Feb 17, 2023

Thanks @nachokb - I'm using it like this:

gem 'aws-sdk-v1-ruby24',
    '1.67.0',
    github: 'seielit/aws-sdk-v1-ruby24',
    branch: 'aws-sdk-v1-ruby24',
    ref: '41b1829a12d020a3f7880de958d7b3f4eebc8436',
    require: 'aws-sdk-v1'

@rajeevriitm
Copy link

@pboling @nachokb Can someone show an example of how the gemfile should look like for this to work? I am getting uninitialized constant Aws (NameError) Error

@pboling
Copy link

pboling commented Jun 2, 2023

@rajeevriitm my comment does show what the gemfile looks like, so I am not sure what you are asking.

gem 'aws-sdk-v1-ruby24',
    '1.67.0',
    github: 'seielit/aws-sdk-v1-ruby24',
    branch: 'aws-sdk-v1-ruby24',
    ref: '41b1829a12d020a3f7880de958d7b3f4eebc8436',
    require: 'aws-sdk-v1'

Given the error you are seeing, it looks like you have code that is expecting a different namespace. Sounds like you might have some code expecting version 1 and other code expecting version 2 or 3. Fortunately you should be able to load both of them at the same time.

The v2 Ruby SDK uses a different namespace [than the v1 SDK making it possible to load both at the same time].

See https://github.com/seielit/aws-sdk-v1-ruby24/tree/aws-sdk-v1-ruby24#installation for details.

@rajeevriitm
Copy link

@pboling Thanks it was due to conflicting sdk versions. Fixed it with require.

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

No branches or pull requests

6 participants