From 455a5689f317b2ce010db444a1b38354615014d8 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 17 Jul 2023 12:25:07 +0900 Subject: [PATCH] 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. --- lib/mruby/build/command.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 62f364cbf..e40b15533 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -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}$")