Changed: #1440 Don't use the added since last successful build cache in this case

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 7fb8ccca88
commit 42fd339d73

@ -141,18 +141,20 @@ bool CPipelineProcessImpl::hasInputFileBeenModified(const std::string &inputFile
bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string &inputDirectory, const std::set<std::string> &excludeFiles, uint32 since) bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string &inputDirectory, const std::set<std::string> &excludeFiles, uint32 since)
{ {
for (std::set<std::string>::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr) // for (std::set<std::string>::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr)
for (std::map<std::string, CFileStatus>::const_iterator it = m_FileStatusInputCache.begin(), end = m_FileStatusInputCache.end(); it != end; ++it)
{ {
const std::string &pathr = *itr; const std::string &pathr = it->first;
if (excludeFiles.find(pathr) == excludeFiles.end()) if (excludeFiles.find(pathr) == excludeFiles.end())
{ {
if ((pathr.size() > inputDirectory.size()) if ((pathr.size() > inputDirectory.size())
&& (pathr.substr(0, inputDirectory.size()) == inputDirectory) // inside the path && (pathr.substr(0, inputDirectory.size()) == inputDirectory) // inside the path
&& (pathr.substr(inputDirectory.size(), pathr.size() - inputDirectory.size())).find('/') == std::string::npos) // not in a further subdirectory && (pathr.substr(inputDirectory.size(), pathr.size() - inputDirectory.size())).find('/') == std::string::npos) // not in a further subdirectory
{ {
CFileStatus status; //CFileStatus status;
if (!getDependencyFileStatusCached(status, pathr)) //if (!getDependencyFileStatusCached(status, pathr))
nlerror("Cannot get cached status of known file"); // nlerror("Cannot get cached status of known file");
const CFileStatus &status = it->second;
if (status.FirstSeen >= since) // or > ? if (status.FirstSeen >= since) // or > ?
{ {
nldebug("Found newly added '%s' in dependency directory '%s'", pathr.c_str(), inputDirectory.c_str()); nldebug("Found newly added '%s' in dependency directory '%s'", pathr.c_str(), inputDirectory.c_str());
@ -166,8 +168,8 @@ bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string
bool CPipelineProcessImpl::hasFileBeenAddedSince(const std::string &inputFile, uint32 since) bool CPipelineProcessImpl::hasFileBeenAddedSince(const std::string &inputFile, uint32 since)
{ {
if (m_ListInputAdded.find(inputFile) != m_ListInputAdded.end()) /*if (m_ListInputAdded.find(inputFile) != m_ListInputAdded.end())
{ {*/
CFileStatus status; CFileStatus status;
if (!getDependencyFileStatusCached(status, inputFile)) if (!getDependencyFileStatusCached(status, inputFile))
nlerror("Cannot get cached status of known file"); nlerror("Cannot get cached status of known file");
@ -176,7 +178,7 @@ bool CPipelineProcessImpl::hasFileBeenAddedSince(const std::string &inputFile, u
nldebug("Found newly added '%s' in dependency files", inputFile.c_str()); nldebug("Found newly added '%s' in dependency files", inputFile.c_str());
return true; return true;
} }
} /*}*/
return false; return false;
} }
@ -470,6 +472,7 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector<std::string> &i
std::set<std::string> inputsChecked; std::set<std::string> inputsChecked;
uint32 earliestBuildStart = 0xFFFFFFFF; uint32 earliestBuildStart = 0xFFFFFFFF;
uint32 lastBuildStart = 0;
// Check the .depend files of all the output files // also check that they exist :) // Check the .depend files of all the output files // also check that they exist :)
for (std::vector<std::string>::const_iterator it = outputPaths.begin(), end = outputPaths.end(); it != end; ++it) for (std::vector<std::string>::const_iterator it = outputPaths.begin(), end = outputPaths.end(); it != end; ++it)
@ -487,6 +490,8 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector<std::string> &i
{ {
if (metaDepend.BuildStart < earliestBuildStart) if (metaDepend.BuildStart < earliestBuildStart)
earliestBuildStart = metaDepend.BuildStart; earliestBuildStart = metaDepend.BuildStart;
if (metaDepend.BuildStart > lastBuildStart)
lastBuildStart = metaDepend.BuildStart;
if (outputChanged) if (outputChanged)
{ {
// Compare the output checksum with the status output checksum // Compare the output checksum with the status output checksum
@ -538,8 +543,10 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector<std::string> &i
} }
// Find out if any files were added in dependency directories since last build start // Find out if any files were added in dependency directories since last build start
if (inputModified) if (lastBuildStart != m_ResultPreviousSuccess.BuildStart || earliestBuildStart != m_ResultPreviousSuccess.BuildStart)
{ {
nldebug("Found files that were built at a different time than the last successful build, find out if any input files have been added for them");
for (std::vector<std::string>::const_iterator it = inputPaths.begin(), end = inputPaths.end(); it != end; ++it) for (std::vector<std::string>::const_iterator it = inputPaths.begin(), end = inputPaths.end(); it != end; ++it)
{ {
const std::string &path = *it; const std::string &path = *it;

Loading…
Cancel
Save