diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-09-24 13:10:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-09-24 13:10:25 +0200 |
commit | b6c61ea9afd2d738711770e44748e48be009154d (patch) | |
tree | 9f4e2ab650e8359e3fe0a9c5eed45dc2f2f4f160 /libbuild2/target.cxx | |
parent | c94f066bbd47520cf52937fc4ad08a699abda28a (diff) |
Give hints for common causes of "no rule to update ..." error
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r-- | libbuild2/target.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx index 7327b1b..8d76f56 100644 --- a/libbuild2/target.cxx +++ b/libbuild2/target.cxx @@ -412,7 +412,7 @@ namespace build2 dir_path out, string name, optional<string> ext, - bool implied, + target_decl decl, tracer& trace) { target_key tk {&tt, &dir, &out, &name, move (ext)}; @@ -447,7 +447,7 @@ namespace build2 if (p.second) { t->ext_ = &i->first.ext; - t->implied = implied; + t->decl = decl; t->state.inner.target_ = t; t->state.outer.target_ = t; return pair<target&, ulock> (*t, move (ul)); @@ -484,16 +484,12 @@ namespace build2 // Fall through (continue as if the first find() returned this target). } - if (!implied) + if (decl > t->decl) { - // The implied flag can only be cleared during the load phase. + // The decl value can only be adjusted during the load phase. // assert (ctx.phase == run_phase::load); - - // Clear the implied flag. - // - if (t->implied) - t->implied = false; + t->decl = decl; } return pair<target&, ulock> (*t, ulock ()); @@ -833,7 +829,7 @@ namespace build2 // const target* e (search_existing_target (t.ctx, pk)); - if (e == nullptr || e->implied) + if (e == nullptr || e->decl != target_decl::real) fail << "no explicit target for " << pk; return e; @@ -928,7 +924,7 @@ namespace build2 // const target* e (search_existing_target (t.ctx, pk)); - if (e != nullptr && !e->implied) + if (e != nullptr && e->decl == target_decl::real) return e; // If not found (or is implied), then try to load the corresponding @@ -977,7 +973,7 @@ namespace build2 if (e == nullptr) e = search_existing_target (t.ctx, pk); - if (e != nullptr && !e->implied) + if (e != nullptr && e->decl == target_decl::real) retest = true; else { @@ -1018,7 +1014,7 @@ namespace build2 if (e == nullptr) e = search_existing_target (t.ctx, pk); - if (e != nullptr && !e->implied) + if (e != nullptr && e->decl == target_decl::real) return e; } |