diff --git a/Gemfile b/Gemfile index 2903d67..fd8b36b 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,10 @@ source "https://rubygems.org" gemspec -# gem 'rest-client', :git => 'https://github.com/chef/rest-client.git' +gem "rest-client", git: "https://github.com/chef/rest-client.git", branch: "jfm/ucrt_update1" group :pedant do - gem "oc-chef-pedant", git: "https://github.com/chef/chef-server.git", branch: "main" + gem "oc-chef-pedant", git: "https://github.com/chef/chef-server.git", branch: "jfm/chef-activesupport-update" end gem "ffi", ">= 1.15.5" @@ -21,14 +21,22 @@ group :style do gem "cookstyle", "~> 8.2" end -if ENV["GEMFILE_MOD"] - puts "GEMFILE_MOD: #{ENV["GEMFILE_MOD"]}" - instance_eval(ENV["GEMFILE_MOD"]) +if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new("3.1.7") + gem "chef-utils", git: "https://github.com/chef/chef.git", branch: "chef-18", glob: "chef-utils/chef-utils.gemspec", require: "chef-utils" + gem "chef", git: "https://github.com/chef/chef.git", branch: "chef-18" else - gem "chef", "~> 18.7" - gem "ohai", "~> 18.1" + gem "chef-utils", git: "https://github.com/chef/chef.git", branch: "main", glob: "chef-utils/chef-utils.gemspec", require: "chef-utils" + gem "chef", git: "https://github.com/chef/chef.git", branch: "main" end +# if ENV["GEMFILE_MOD"] +# puts "GEMFILE_MOD: #{ENV["GEMFILE_MOD"]}" +# instance_eval(ENV["GEMFILE_MOD"]) +# else +# gem "chef", "~> 18.7" +# gem "ohai", "~> 18.1" +# end + group :debug do gem "pry" gem "pry-byebug" diff --git a/chef-zero.gemspec b/chef-zero.gemspec index 672d7c3..f48a30f 100644 --- a/chef-zero.gemspec +++ b/chef-zero.gemspec @@ -13,10 +13,6 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 3.0" - # Note: 7.1.0 does not defaults its cache_format_version to 7.1 but 6.1 instead which gives deprecation warnings - # Remove the version constraint when we can upgrade to 7.1.1 post stable release of Activesupport 7.1 - # Similar issue with 7.0 existed: https://github.com/rails/rails/pull/45293 - s.add_dependency "activesupport", ">= 7", "< 8.1" s.add_dependency "mixlib-log", ">= 2.0", "< 4.0" s.add_dependency "hashie", ">= 2.0", "< 6.0" s.add_dependency "uuidtools", "~> 2.1" @@ -25,6 +21,16 @@ Gem::Specification.new do |s| s.add_dependency "rackup", "~> 2.2", ">= 2.2.1" s.add_dependency "unf_ext", "~> 0.0.8" s.add_dependency "webrick" + s.add_dependency "activesupport", "~> 7.1.5" + # We are running into some challenging things with activesupport and fiddle. + # Chef-18 requires Ruby 3.1 and Chef-19 requires Ruby 3.4. They have incompatible dependencies on activesupport and fiddle + # Activesupport 7.1.3.2 also has a CVE in it which requires an upgrade to 7.1.5.2. Activesupport 7.1.5 requires fiddle = 1.1.0, but Chef-19 requires fiddle >= 1.1.6. + # Also, fiddle is a built-in gem for Ruby 3.1 but is broken out into a separate gem starting in Ruby 3.2. + if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new("3.1.7") + s.add_dependency "fiddle", "= 1.1.0" + else + s.add_dependency "fiddle", ">= 1.1.8" + end s.bindir = "bin" s.executables = ["chef-zero"]