Exercise more Windows-skipped specs in RubyGems and Bundler#9672
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to exercise more RubyGems and Bundler specs on Windows by removing platform skips that are no longer necessary, and by changing the RubyGems installer test to avoid writing a malicious extension name (containing a newline) to disk.
Changes:
- Update RubyGems installer test to build an installer from an in-memory spec (avoids filesystem constraints on Windows).
- Remove Windows skips from several Bundler install specs (yanked materialization, git refs starting with
#, andbundle exec bundle).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/rubygems/test_gem_installer.rb | Switches malicious extensions check to use Gem::Installer.for_spec to run on Windows too. |
| spec/install/yanked_spec.rb | Removes Windows skip so yanked materialization behavior is asserted on Windows. |
| spec/install/gemfile/git_spec.rb | Removes Windows skip for branch/tag names starting with #. |
| spec/install/deploy_spec.rb | Removes Windows skip so bundle exec bundle behavior is tested on Windows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1908
to
+1909
| installer = Gem::Installer.for_spec spec | ||
| installer.gem_home = @gemhome |
The example built a gem on disk, and util_build_gem writes every entry of spec.files, which includes spec.extensions. On Windows the extension name embedding a newline cannot become a file name, so the example was skipped and the check went uncovered. Build the installer from the spec in memory with Installer.for_spec instead, matching the sibling non_string checks, so verify_spec still runs before the spec is eval'd without the newline ever reaching the disk. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These examples pass on Windows as is now. Materialization detects a yanked platform-specific locked spec and falls back to the generic variant the same as other platforms, `bundle exec bundle` resolves the bundle executable, and git on Windows accepts branch and tag names starting with `#`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b25451c to
83e6602
Compare
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.
The malicious extensions installer check was skipped on Windows because the example built a gem on disk, and the extension name embeds a newline that cannot become a file name there. Building the installer from the in-memory spec with Installer.for_spec runs verify_spec before the spec is eval'd without the newline ever reaching disk, so the check now runs on every platform.
A handful of Bundler install specs still carried Windows skips that no longer apply. Materialization now falls back from a yanked platform-specific locked spec to the generic variant, bundle exec bundle resolves the bundle executable, and git on Windows accepts branch and tag names starting with a hash, so those examples pass as is.
Both changes are forward-ported from ruby/ruby.