lib/mruby/build/command.rb: skip mrbgems in parent directory; fix #6029

If `mrbgems` is included in the parent directory path (MRUBY_ROOT), it
confuses gem path and build path.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-07-17 12:25:07 +09:00
parent f84f129d65
commit 455a5689f3
+5 -1
View File
@@ -99,7 +99,11 @@ module MRuby
gemrake = File.join(source_dir, "mrbgem.rake")
rakedep = File.exist?(gemrake) ? [ gemrake ] : []
if build_dir.include? "mrbgems/"
bd = build_dir
if bd.start_with?(MRUBY_ROOT)
bd = bd.sub(MRUBY_ROOT, '')
end
if bd.include? "mrbgems/"
generated_file_matcher = Regexp.new("^#{Regexp.escape build_dir}/(?!mrbc/)(.*)#{Regexp.escape out_ext}$")
else
generated_file_matcher = Regexp.new("^#{Regexp.escape build_dir}/(?!mrbc/|mrbgems/.+/)(.*)#{Regexp.escape out_ext}$")