Skip to content

Commit

Permalink
merge revision(s) 9f708d4,0301473fb523c71d8cdc4966971f31f502001185,7f…
Browse files Browse the repository at this point in the history
…0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]

	Clear runtime dependencies if default gems is specified.

	The current build system uses runtime dependencies from only
	`.bundle` directory. We shouldn't install runtime dependencies
	from rubygems.org when `make test-bundled-gems` is invoked.

	Fixed dependencies list format

	Re-use strscan with ruby repo
  • Loading branch information
nagachika authored and hsbt committed Jun 19, 2024
1 parent 60011fb commit c2730c7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tool/lib/bundled_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
# unpack bundled gem files.

module BundledGem
DEFAULT_GEMS_DEPENDENCIES = [
"net-protocol", # net-ftp
"time", # net-ftp
"singleton", # prime
"ipaddr", # rinda
"forwardable", # prime, rinda
"ruby2_keywords", # drb
"strscan" # rexml
]

module_function

def unpack(file, *rest)
Expand Down Expand Up @@ -35,6 +45,9 @@ def prepare_test(spec, dir = ".")
gem_dir = File.join(dir, "gems", target)
yield gem_dir
spec_dir = spec.extensions.empty? ? "specifications" : File.join("gems", target)
if spec.extensions.empty?
spec.dependencies.reject! {|dep| DEFAULT_GEMS_DEPENDENCIES.include?(dep.name)}
end
File.binwrite(File.join(dir, spec_dir, "#{target}.gemspec"), spec.to_ruby)
unless spec.extensions.empty?
spec.dependencies.clear
Expand Down

0 comments on commit c2730c7

Please sign in to comment.