diff --git a/clcache.py b/clcache.py index ca6cc976..cc1bfc02 100644 --- a/clcache.py +++ b/clcache.py @@ -192,8 +192,7 @@ def getManifestHash(compilerBinary, commandLine, sourceFile): return getFileHash(sourceFile, additionalData) @staticmethod - def getIncludesContentHashForFiles(includes): - listOfIncludesHashes = [] + def verifyIncludesHashes(includes): includeMissing = False for path in sorted(includes.keys()): @@ -201,14 +200,15 @@ def getIncludesContentHashForFiles(includes): fileHash = getFileHash(path) if fileHash != includes[path]: raise IncludeChangedException() - listOfIncludesHashes.append(fileHash) except FileNotFoundError: includeMissing = True if includeMissing: raise IncludeNotFoundException() - return ManifestRepository.getIncludesContentHashForHashes(listOfIncludesHashes) + @staticmethod + def getIncludesContentHashForFiles(includes): + return ManifestRepository.getIncludesContentHashForHashes(sorted(includes.values())) @staticmethod def getIncludesContentHashForHashes(listOfIncludesHashes): @@ -1514,10 +1514,12 @@ def processDirect(cache, objectFile, compiler, cmdLine, sourceFile): if manifest is not None: # NOTE: command line options already included in hash for manifest name try: - includesContentHash = ManifestRepository.getIncludesContentHashForFiles({ + includes = { expandBasedirPlaceholder(path, baseDir):contentHash for path, contentHash in manifest.includeFiles.items() - }) + } + ManifestRepository.verifyIncludesHashes(includes) + includesContentHash = ManifestRepository.getIncludesContentHashForFiles(includes) cachekey = manifest.includesContentToObjectMap.get(includesContentHash) assert cachekey is not None