aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-22 10:10:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-22 10:10:34 +0200
commit40863a594372ede117533d5c0970a96d60e34371 (patch)
treece5b481ebb443c75161d5866dc6a4207df9a766c /libbuild2/config
parent1ac5458eede2b4b2d3bc98cde787348f70328361 (diff)
Incorporate project environment checksum into cc::compiler_info cache key
Diffstat (limited to 'libbuild2/config')
-rw-r--r--libbuild2/config/init.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx
index 7b810bd..87b492c 100644
--- a/libbuild2/config/init.cxx
+++ b/libbuild2/config/init.cxx
@@ -455,13 +455,15 @@ namespace build2
rs.vars.erase (c_e); // Undefine.
}
- // Copy config.config.environment to scope::root_extra::environment.
+ // Copy config.config.environment to scope::root_extra::environment and
+ // calculate its checksum.
//
// Note that we store shallow copies that point to the c.c.environment
// value which means it should not change.
//
if (const strings* src = cast_null<strings> (rs[c_e]))
{
+ sha256 cs;
vector<const char*>& dst (rs.root_extra->environment);
// The idea is to only copy entries that are effective, that is those
@@ -511,10 +513,14 @@ namespace build2
}
dst.push_back (v.c_str ());
+ cs.append (v);
}
if (!dst.empty ())
+ {
dst.push_back (nullptr);
+ rs.root_extra->environment_checksum = cs.string ();
+ }
}
// Register alias and fallback rule for the configure meta-operation.