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 newest version with ruby 3.2 #6537

Open
wyardley opened this issue Jun 16, 2023 · 5 comments
Open

Support newest version with ruby 3.2 #6537

wyardley opened this issue Jun 16, 2023 · 5 comments

Comments

@wyardley
Copy link

wyardley commented Jun 16, 2023

Describe the problem

Installing inspec v5.22.3 via bundler seems to fail on Ruby 3.2, apparently because of dependencies (I can file a bug under https://github.com/inspec/train-kubernetes as well if you'd like). v5.21.29 seems to work fine as it did previously.

Given the following Gemfile:

# frozen_string_literal: true

source 'https://rubygems.org'

gem 'inspec', '~> 5.22.3'
gem 'inspec-bin', '~> 5.22.3'

With older bundler versions, it just hangs forever (rubygems/rubygems#6686)

With the updated bundler version, the error is more helpful:

Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Could not find compatible versions

Because train-kubernetes < 0.1.3 depends on k8s-client = 0.10.0
  and train-kubernetes >= 0.1.3, < 0.1.4 depends on k8s-client ~> 0.10,
  train-kubernetes < 0.1.4 requires k8s-client >= 0.10.0, < 1.A.
And because every version of k8s-client depends on Ruby ~> 2.4
  and train-kubernetes >= 0.1.4, < 0.1.10 depends on k8s-ruby ~> 0.10,
  train-kubernetes < 0.1.10 requires Ruby ~> 2.4 or k8s-ruby ~> 0.10.
So, because train-kubernetes >= 0.1.10, < 0.1.12 depends on k8s-ruby = 0.10.5
  and k8s-ruby < 0.11.0 depends on Ruby ~> 2.4,
  train-kubernetes < 0.1.12 requires Ruby >= 2.4, < 3.A or k8s-ruby >= 0.11.0, < 1.A.

Possible Solution

@wyardley
Copy link
Author

In case this isn't expected, also mentioning jhawthorn/pub_grub#30 here since my original issue with bundler is now closed.

@luckeyca
Copy link

got the same issue on alpine docker image. ruby version is 3.2.2. inspec-bin version 5.21.29 installed fine, but 5.22.3 failed with dependency error.

@wyardley
Copy link
Author

wyardley commented Sep 7, 2023

FWIW, not sure if a fix finally landed somewhere (since #6622 etc. are still in progress), but it worked for me today with Ruby 3.2 and bundler 2.4.14 for some reason. 🤷

@Nik08
Copy link
Contributor

Nik08 commented Sep 8, 2023

It works out locally with Ruby version 3.2.x because k8-ruby changes for 3.2 were pulled in on inspec/k9s-ruby.
I'm still trying to figure out why it works locally and breaks on CI.
The work is still in progress in PR #6622 because there are certain tick boxes we need to achieve before releasing InSpec with ruby 3.2 support. I have updated the PR description with the list.

@wyardley
Copy link
Author

wyardley commented Sep 8, 2023

Yup, totally understand, and thanks for the explanation about why!

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

3 participants