diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-10 10:14:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-10 10:14:16 +0200 |
commit | 35e3bdadfc40738adb33e51ea84d7976059a8f54 (patch) | |
tree | 402b7209d2ab29819a3e5d37198918d9a1238bbc | |
parent | 946e4030197cefb5d1518576ce0091e93b578d51 (diff) |
Improve diagnostics: not sensible
-rw-r--r-- | bpkg/package-skeleton.cxx | 2 | ||||
-rw-r--r-- | bpkg/pkg-build.cxx | 27 |
2 files changed, 18 insertions, 11 deletions
diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx index eaebf26..9e2ce0d 100644 --- a/bpkg/package-skeleton.cxx +++ b/bpkg/package-skeleton.cxx @@ -493,7 +493,7 @@ namespace bpkg catch (const build2::failed&) { r.first = false; - r.second = ds.str (); + r.second = trim (ds.str ()); } ctx_ = nullptr; diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 296a41c..72b8b7a 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -4665,10 +4665,13 @@ namespace bpkg if (!pr.first) { - // @@ TODO: improve (see the other case). - // - fail << "unable to negotiate sensible configuration\n" - << " " << pr.second; + diag_record dr (fail); + dr << "unable to negotiate sensible configuration for " + << "dependency " << p << '\n' + << " " << pr.second; + + dr << info << "negotiated configuration:\n"; + pc.print (dr, " "); } b->skeleton->dependent_config (pc); @@ -6175,6 +6178,8 @@ namespace bpkg { // Verify and set the dependent configuration for this dependency. // + // Note: see similar code for the up-negotiation case. + // { assert (b->skeleton); // Should have been init'ed above. @@ -6185,16 +6190,18 @@ namespace bpkg if (!pr.first) { - // @@ TODO: improve (print dependencies, dependents, config). - // (also in the up-negotiation case). - // - // Note that the diagnostics from the dependent will most + // Note that the diagnostics from the dependency will most // likely be in the "error ..." form (potentially with // additional info lines) and by printing it with a two-space // indentation we make it "fit" into our diag record. // - fail << "unable to negotiate sensible configuration\n" - << " " << pr.second; + diag_record dr (fail); + dr << "unable to negotiate sensible configuration for " + << "dependency " << p << '\n' + << " " << pr.second; + + dr << info << "negotiated configuration:\n"; + pc.print (dr, " "); // Note 4 spaces since in nested info. } b->skeleton->dependent_config (pc); |