summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2021-02-04 21:17:58 +0900
committerKOBAYASHI Shuji <[email protected]>2021-02-04 21:17:58 +0900
commit67a28b56ab1bc8960a8302b2af273fcd8cd2a7bc (patch)
treeacf2d37f7b6fd2d173d9706da88770a893c691f9 /tasks
parent6f354322a8c77f07466aacd12d57674ead6726c9 (diff)
downloadmruby-67a28b56ab1bc8960a8302b2af273fcd8cd2a7bc.tar.gz
mruby-67a28b56ab1bc8960a8302b2af273fcd8cd2a7bc.zip
Check if `.pi` build rules are defined
`.pi` files are created for `.o` files that `build.products` depends on, but an error will occur if the build rule is unknown, so add a check. I don't think this situation would normally arise. However, in `mattn/mruby-onig-regexp`, when using bundled onigmo, onigmo's `.o` files are added to dependency of `libmruby.a` in the second and subsequent builds, and mruby does not know the build rule, so the following error had occured. ```console rake aborted! Don't know how to build task '/mruby/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/libonig_objs/ascii.pi' (See the list of available tasks with `rake --tasks`) ```
Diffstat (limited to 'tasks')
-rw-r--r--tasks/presym.rake12
1 files changed, 8 insertions, 4 deletions
diff --git a/tasks/presym.rake b/tasks/presym.rake
index 2efc4d790..1ebc1a737 100644
--- a/tasks/presym.rake
+++ b/tasks/presym.rake
@@ -17,7 +17,7 @@ MRuby.each_target do |build|
build.gems.each{|gem| gem.compilers.each{|c| c.include_paths << include_dir}}
prereqs = {}
- pps = []
+ ppps = []
build_dir = "#{build.build_dir}/"
mrbc_build_dir = "#{build.mrbc_build.build_dir}/" if build.mrbc_build
build.products.each{|product| all_prerequisites.(product, prereqs)}
@@ -25,11 +25,15 @@ MRuby.each_target do |build|
next unless File.extname(prereq) == build.exts.object
next unless prereq.start_with?(build_dir)
next if mrbc_build_dir && prereq.start_with?(mrbc_build_dir)
- pps << prereq.ext(build.exts.presym_preprocessed)
+ ppp = prereq.ext(build.exts.presym_preprocessed)
+ if Rake.application.lookup(ppp) ||
+ Rake.application.enhance_with_matching_rule(ppp)
+ ppps << ppp
+ end
end
- file presym.list_path => pps do
- presyms = presym.scan(pps)
+ file presym.list_path => ppps do
+ presyms = presym.scan(ppps)
current_presyms = presym.read_list if File.exist?(presym.list_path)
update = presyms != current_presyms
presym.write_list(presyms) if update