Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions clcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,35 +1537,36 @@ def processDirect(cache, objectFile, compiler, cmdLine, sourceFile):
baseDir = normalizeBaseDir(os.environ.get('CLCACHE_BASEDIR'))
manifestHash = ManifestRepository.getManifestHash(compiler, cmdLine, sourceFile)
manifestSection = cache.manifestRepository.section(manifestHash)
createNewManifest = False
with cache.lock:
createNewManifest = False
manifest = manifestSection.getManifest(manifestHash)
if manifest is not None:
# NOTE: command line options already included in hash for manifest name
try:
includesContentHash = ManifestRepository.getIncludesContentHashForFiles({
expandBasedirPlaceholder(path, baseDir):contentHash
for path, contentHash in manifest.includeFiles.items()
})

cachekey = manifest.includesContentToObjectMap.get(includesContentHash)
assert cachekey is not None
if manifest is not None:
# NOTE: command line options already included in hash for manifest name
try:
includesContentHash = ManifestRepository.getIncludesContentHashForFiles({
expandBasedirPlaceholder(path, baseDir):contentHash
for path, contentHash in manifest.includeFiles.items()
})

cachekey = manifest.includesContentToObjectMap.get(includesContentHash)
assert cachekey is not None
with cache.lock:
if cache.compilerArtifactsRepository.section(cachekey).hasEntry(cachekey):
return processCacheHit(cache, objectFile, cachekey)
else:
postProcessing = lambda compilerResult: postprocessObjectEvicted(
cache, objectFile, cachekey, compilerResult)
except IncludeChangedException:
createNewManifest = True
postProcessing = lambda compilerResult: postprocessHeaderChangedMiss(
cache, objectFile, manifestSection, manifestHash, sourceFile, compilerResult, stripIncludes)
except IncludeNotFoundException:
# register nothing. This is probably just a compile error
postProcessing = None
else:
except IncludeChangedException:
createNewManifest = True
postProcessing = lambda compilerResult: postprocessNoManifestMiss(
postProcessing = lambda compilerResult: postprocessHeaderChangedMiss(
cache, objectFile, manifestSection, manifestHash, sourceFile, compilerResult, stripIncludes)
except IncludeNotFoundException:
# register nothing. This is probably just a compile error
postProcessing = None
else:
createNewManifest = True
postProcessing = lambda compilerResult: postprocessNoManifestMiss(
cache, objectFile, manifestSection, manifestHash, sourceFile, compilerResult, stripIncludes)

if createNewManifest:
stripIncludes = False
Expand Down