aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-10-26 11:36:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-10-26 11:36:19 +0200
commit0fc035dd4d51c70231a46d6b8a6ba18a91e8ae43 (patch)
tree798aa85b019275fcd828d459b0ffb5fa715ebf76
parent9dac152ff70d9dc616318630d634a83d266aee4a (diff)
Minor diagnostics improvement
-rw-r--r--libbuild2/adhoc-rule-regex-pattern.cxx4
-rw-r--r--libbuild2/parser.cxx16
2 files changed, 15 insertions, 5 deletions
diff --git a/libbuild2/adhoc-rule-regex-pattern.cxx b/libbuild2/adhoc-rule-regex-pattern.cxx
index 257952f..c221bef 100644
--- a/libbuild2/adhoc-rule-regex-pattern.cxx
+++ b/libbuild2/adhoc-rule-regex-pattern.cxx
@@ -86,7 +86,9 @@ namespace build2
tt = n.untyped () ? &file::static_type : s.find_target_type (n.type);
if (tt == nullptr)
- fail (loc) << "unknown target type " << n.type;
+ fail (loc) << "unknown target type " << n.type <<
+ info << "perhaps the module that defines this target type is "
+ << "not loaded by project " << *s.root_scope ();
}
bool e (n.pattern &&
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 9ced841..55c5c6c 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -931,7 +931,9 @@ namespace build2
: scope_->find_target_type (n.type));
if (ttype == nullptr)
- fail (nloc) << "unknown target type " << n.type;
+ fail (nloc) << "unknown target type " << n.type <<
+ info << "perhaps the module that defines this target type is "
+ << "not loaded by project " << *scope_->root_scope ();
f (t, tt, nullopt, n.pattern, ttype, move (n.value), nloc);
};
@@ -1359,7 +1361,9 @@ namespace build2
: scope_->find_target_type (n.type);
if (ttype == nullptr)
- fail (nloc) << "unknown target type " << n.type;
+ fail (nloc) << "unknown target type " << n.type <<
+ info << "perhaps the module that defines this target type is "
+ << "not loaded by project " << *scope_->root_scope ();
if (!gns.empty ())
{
@@ -2773,7 +2777,9 @@ namespace build2
optional<string>& e (rp.second);
if (t == nullptr)
- fail (ploc) << "unknown target type " << n.type;
+ fail (ploc) << "unknown target type " << n.type <<
+ info << "perhaps the module that defines this target type is "
+ << "not loaded by project " << *scope_->root_scope ();
if (t->factory == nullptr)
fail (ploc) << "abstract target type " << t->name << "{}";
@@ -4339,7 +4345,9 @@ namespace build2
const target_type* bt (scope_->find_target_type (bn));
if (bt == nullptr)
- fail (t) << "unknown target type " << bn;
+ fail (t) << "unknown target type " << bn <<
+ info << "perhaps the module that defines this target type is "
+ << "not loaded by project " << *scope_->root_scope ();
// The derive_target_type() call below does not produce a non-abstract
// type if passed an abstract base. So we ban this for now (it's unclear