Merge pull request #6118 from Emin017/emin/key-abc-scl-cache

liberty_cache: key SCL cache on ABC executable mtime and size
This commit is contained in:
nella 2026-08-15 20:08:27 +00:00 committed by GitHub
commit dbe5b7c03f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,14 @@ inline std::string convert_liberty_files_to_merged_scl(const std::vector<std::st
std::string hash_input;
time_t newest_mtime = 0;
// The SCL format is written/read by ABC and can change between ABC builds,
// so the cache key must identify the ABC executable.
if (!abc_exe.empty()) {
struct stat abc_stat;
if (stat(abc_exe.c_str(), &abc_stat) == 0)
hash_input += stringf("|abc:%s:%lld:%lld", abc_exe.c_str(), (long long)abc_stat.st_mtime, (long long)abc_stat.st_size);
}
for (const std::string &liberty_file : sorted_files) {
struct stat liberty_stat;
if (stat(liberty_file.c_str(), &liberty_stat) != 0) {