aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/module.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r--libbuild2/module.cxx60
1 files changed, 36 insertions, 24 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx
index 5cfb1ec..b5914cd 100644
--- a/libbuild2/module.cxx
+++ b/libbuild2/module.cxx
@@ -209,30 +209,42 @@ namespace build2
action_targets tgs;
action a (perform_id, update_id);
- // Note that for now we suppress progress since it would clash with
- // the progress of what we are already doing (maybe in the future we
- // can do save/restore but then we would need some sort of diagnostics
- // that we have switched to another task).
- //
- mo_perform.search ({}, /* parameters */
- rs, /* root scope */
- rs, /* base scope */
- path (), /* buildfile */
- rs.find_target_key (lr.first, loc),
- loc,
- tgs);
-
- mo_perform.match ({}, /* parameters */
- a,
- tgs,
- 1, /* diag (failures only) */
- false /* progress */);
-
- mo_perform.execute ({}, /* parameters */
- a,
- tgs,
- 1, /* diag (failures only) */
- false /* progress */);
+ {
+ // Cutoff the existing diagnostics stack and push our own entry.
+ //
+ diag_frame::stack_guard diag_cutoff (nullptr);
+
+ auto df = make_diag_frame (
+ [&loc, &mod](const diag_record& dr)
+ {
+ dr << info (loc) << "while loading build system module " << mod;
+ });
+
+ // Note that for now we suppress progress since it would clash with
+ // the progress of what we are already doing (maybe in the future we
+ // can do save/restore but then we would need some sort of
+ // diagnostics that we have switched to another task).
+ //
+ mo_perform.search ({}, /* parameters */
+ rs, /* root scope */
+ rs, /* base scope */
+ path (), /* buildfile */
+ rs.find_target_key (lr.first, loc),
+ loc,
+ tgs);
+
+ mo_perform.match ({}, /* parameters */
+ a,
+ tgs,
+ 1, /* diag (failures only) */
+ false /* progress */);
+
+ mo_perform.execute ({}, /* parameters */
+ a,
+ tgs,
+ 1, /* diag (failures only) */
+ false /* progress */);
+ }
assert (tgs.size () == 1);
const target& l (tgs[0].as_target ());