mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 08:25:20 +08:00
[ruby/rubygems] Load the worktree RubyGems in the dev binstubs
After flattening, lib/ holds both RubyGems and Bundler, so any dev binstub that puts the worktree lib/ on $LOAD_PATH now overlays the already-booted system RubyGems with the worktree one. bin/bundle hit this through the Bundler gemspec activation: the partial overlay mixed a worktree Gem with an older system Gem::ConfigFile, breaking native extension installs on Ruby 3.2/3.3 (undefined install_extension_in_lib) and corrupting spec names elsewhere. The same overlay breaks bin/rake, bin/ronn, bin/rubocop and bin/mdl, which unshift the worktree lib/ (or require it through rubygems_ext) but boot on the system RubyGems. On a host whose RubyGems differs from the worktree copy this double-loads files like rubygems/package and raises (undefined method `spec=' for class Gem::Package::Old). Route all of them through switch_rubygems, like bin/rspec and bin/test-unit already do, so they re-exec onto the worktree RubyGems before anything is loaded. Point the shared gem home job at the worktree copy too, since the dev binstub can no longer load a separately installed RubyGems, and the matrix is redundant for now. https://github.com/ruby/rubygems/commit/f50eb4216d
This commit is contained in:
1 parent
4eb711b8e9
commit
8ef77c3dfe
1 file changed
+1
Notes:
git
2026-06-24 05:44:19 +00:00
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../bundler/support/switch_rubygems"
|
||||
require_relative "../bundler/support/activate"
|
||||
|
||||
load File.expand_path("bundle", Spec::Path.exedir)
|
||||
Reference in new issue
Block a user