From 6900b21b1180ffa590f3e97d6be75c37707990ca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 30 Aug 2024 08:11:26 +0200 Subject: Add absolute compiler path to compiler checksum In particular, this will allow us to use depdb change tracking to also detect changes to compilation database entries. --- libbuild2/cc/guess.cxx | 10 ++++++---- libbuild2/cc/guess.hxx | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index 5ae6fb2..f092933 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -1878,7 +1878,7 @@ namespace build2 move (ver), nullopt, move (gr.signature), - "", + "", // Checksum to be calculated from signature. move (t), move (ot), move (cpat), @@ -2128,7 +2128,7 @@ namespace build2 move (ver), nullopt, move (gr.signature), - move (gr.checksum), // Calculated on whole -v output. + "", // Checksum calculated on whole -v output. move (t), move (ot), move (pat), @@ -2898,7 +2898,7 @@ namespace build2 move (ver), move (var_ver), move (gr.signature), - move (gr.checksum), // Calculated on whole -v output. + "", // Checksum calculated on whole -v output. move (t), move (ot), move (cpat), @@ -3216,7 +3216,7 @@ namespace build2 move (ver), nullopt, move (gr.signature), - "", + "", // Checksum to be calculated from signature. move (t), move (ot), move (pat), @@ -3370,6 +3370,8 @@ namespace build2 cs.append (gr.type_signature); } + cs.append (r.path.effect_string ()); + r.checksum = cs.string (); // Derive binutils pattern unless this has already been done by the diff --git a/libbuild2/cc/guess.hxx b/libbuild2/cc/guess.hxx index 7cbbd87..dfa8aa2 100644 --- a/libbuild2/cc/guess.hxx +++ b/libbuild2/cc/guess.hxx @@ -160,6 +160,9 @@ namespace build2 // checksum will still change. This is currently the case for all the // compilers that we support. // + // And we assume that the checksum incorporates the absolute compiler + // path. This is used to detect compilation database changes. + // // The target is the compiler's traget architecture triplet. Note that // unlike all the preceding fields, this one takes into account the // compile options (e.g., -m32). -- cgit v1.1