Skip to content

Exercise more Windows-skipped specs in RubyGems and Bundler#9672

Merged
hsbt merged 2 commits into
masterfrom
claude/vibrant-gould-de090b
Jul 2, 2026
Merged

Exercise more Windows-skipped specs in RubyGems and Bundler#9672
hsbt merged 2 commits into
masterfrom
claude/vibrant-gould-de090b

Conversation

@hsbt

@hsbt hsbt commented Jul 2, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings July 2, 2026 05:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #, and bundle 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
hsbt and others added 2 commits July 2, 2026 15:36
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>
@hsbt hsbt force-pushed the claude/vibrant-gould-de090b branch from b25451c to 83e6602 Compare July 2, 2026 06:36
@hsbt hsbt merged commit d70e321 into master Jul 2, 2026
110 checks passed
@hsbt hsbt deleted the claude/vibrant-gould-de090b branch July 2, 2026 07:06
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

Successfully merging this pull request may close these issues.

2 participants