Exclude the Windows gemspec from the chef git source - #56
Open
tas50 wants to merge 2 commits into
Open
Conversation
CI has been failing on every job since the last green scheduled run, with: Could not find chef-cli-6.1.34, win32-api-1.10.1 in locally installed gems (Bundler::GemNotFound) chef's repo ships chef-universal-mingw-ucrt.gemspec alongside chef.gemspec. That file loads chef.gemspec, sets the platform to universal-mingw-ucrt and adds the Windows only dependencies, but it keeps the gem name "chef". Bundler loads every gemspec it finds in a git source, so it picked up the mingw variant as well and win32-api, chef-powershell and the other win32-* gems ended up in the resolution on every platform. Those gems cannot install on Linux or macOS, so the bundle was never fully installed and bundle exec failed. Restrict the git source to chef.gemspec and the chef-* subdirectory gemspecs, which keeps chef-config, chef-utils and chef-bin resolving from the git checkout while leaving the mingw variant out. ohai is unaffected, its repo only has the one gemspec. Signed-off-by: Tim Smith <tsmith84@proton.me>
This was referenced Aug 22, 2026
Ruby 4.0 is released and chefspec supports it, so add it to the CI matrix alongside 3.1 through 3.4. Signed-off-by: Tim Smith <tsmith84@proton.me>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI has been failing on every job (Ruby 3.1 through 3.4) since the last green scheduled run. Both
rake unitandrake acceptancefail before running anything:Cause
chef's repo ships
chef-universal-mingw-ucrt.gemspecnext tochef.gemspec. It loadschef.gemspec, switches the platform, and adds the Windows only dependencies, but it keeps the gem namechef:Bundler loads every gemspec it finds in a git source (default glob
{,*,*/*}.gemspec), so it picks up the mingw variant too. The resulting lockfile lists the Windows gems as dependencies ofchefon every platform:Those gems cannot install on Linux or macOS, so the bundle is never fully installed and
bundle execfails. This is reproducible locally on a clean checkout, and it is whybundle installappears to succeed whilebundle checkstill reports missing gems.Nothing changed in this repo to trigger it, which is why it started failing on an unrelated push.
Fix
Restrict the git source glob so the mingw variant is skipped:
That still matches the gemspecs the resolution needs from the checkout:
and leaves out
chef-universal-mingw-ucrt.gemspec.ohaiis unaffected, its repo only has the one gemspec, so it is left alone.Testing
Verified on a clean
git archivecheckout of main, running the same commands CI runs:bundle installcompletes, andbundle checkreports "The Gemfile's dependencies are satisfied"win32-*orchef-powershellentries remain in the resolved lockfilebundle exec rake unit—206 examples, 0 failures, exit 0bundle exec rake acceptance— all example suites pass, exit 0Without the change, the same checkout reproduces the CI failure exactly.
Also in this PR
Adds Ruby 4.0 to the CI matrix, so the suite is covered on 3.1 through 4.0. Verified locally on Ruby 4.0.6:
rake unitandrake acceptanceboth exit 0.