From 40863a594372ede117533d5c0970a96d60e34371 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Apr 2021 10:10:34 +0200 Subject: Incorporate project environment checksum into cc::compiler_info cache key --- libbuild2/config/init.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libbuild2/config') 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 (rs[c_e])) { + sha256 cs; vector& 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. -- cgit v1.1