diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-08-30 08:11:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-08-30 08:11:26 +0200 |
commit | 6900b21b1180ffa590f3e97d6be75c37707990ca (patch) | |
tree | 663a04b783c83918a13a9e5b3709f5363d3ff954 | |
parent | 563cc569eee517bb3e7163683b852ba323fab528 (diff) |
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.
-rw-r--r-- | libbuild2/cc/guess.cxx | 10 | ||||
-rw-r--r-- | 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). |