10000 Make "make exts" build only gems listed in gems/bundled_gems by mame · Pull Request #7119 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Make "make exts" build only gems listed in gems/bundled_gems #7119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
16 changes: 16 additions & 0 deletions template/exts.mk.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,24 @@ confexts ||= []
macros["old_extensions"] = []

contpat = /(?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*/
bundled_gems_to_build = {}
File.foreach(File.join(__dir__, "../gems/bundled_gems")) do |line|
bundled_gem_name, bundled_gem_version, _, bundled_gem_rev = line.split
next unless bundled_gem_name
next if bundled_gem_name.start_with?("#")
bundled_gems_to_build[bundled_gem_name + "-" + bundled_gem_version] = true
if bundled_gem_rev
ver_file = File.join(__dir__, "../gems/src/#{ bundled_gem_name }/lib/#{ bundled_gem_name }/version.rb")
if File.readable?(ver_file) && File.read(ver_file) =~ /VERSION\s*=\s*["'](.+?)["']/
bundled_gems_to_build[bundled_gem_name + "-" + $1] = true
else
warn "#$0: failed to read: #{ ver_file }"
end
end
end
Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
gem = e.start_with?(".bundle/gems/")
next if gem && !bundled_gems_to_build[File.basename(File.dirname(e))]
s = File.read(e)
s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v|
v.gsub!(/\\\n[ \t]*/, ' ')
Expand Down
0