aboutsummaryrefslogtreecommitdiff
path: root/build2/depdb.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-21 11:39:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-21 11:39:48 +0200
commit8456beeb0529b8dde7f4eea9a949c1c4f91a6120 (patch)
tree880daba940330890e45d84da350c8dc2d18fe32e /build2/depdb.hxx
parentc7dabff3aaab59649fba8dc18ae5dadf0c0b8f20 (diff)
Diagnose failure to open depdb
The cause is often a missing fsdir{} if the user tries to stash the target in a subdirectory.
Diffstat (limited to 'build2/depdb.hxx')
-rw-r--r--build2/depdb.hxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/build2/depdb.hxx b/build2/depdb.hxx
index 520642e..6c68d19 100644
--- a/build2/depdb.hxx
+++ b/build2/depdb.hxx
@@ -14,7 +14,8 @@
namespace build2
{
// Auxiliary dependency database (those .d files). Uses io_error and
- // system_error exceptions to signal errors.
+ // system_error exceptions to signal errors except for openning (see
+ // below).
//
// This is a strange beast: a line-oriented, streaming database that can, at
// some point, be switched from reading to (over)writing. The idea is to
@@ -64,6 +65,12 @@ namespace build2
// has wrong format version, or is corrupt, then the database will be
// immediately switched to writing.
//
+ // If the database cannot be opened, issue diagnostics and throw failed.
+ // This commonly happens when the user tries to stash the target in a
+ // non-existent subdirectory but forgets to add the corresponding fsdir{}
+ // prerequisite. Handling this as io_error in every rule that uses depdb
+ // would be burdensome thus we issue the diagnostics here.
+ //
depdb (const path&);
// Return the modification time of the database. This value only makes