From 42fd339d7370e45b4316f5d8608f78d0f09e30db Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 4 Aug 2012 13:36:09 +0200 Subject: [PATCH] Changed: #1440 Don't use the added since last successful build cache in this case --HG-- branch : build_pipeline_v3 --- .../pipeline_process_impl_buildinfo.cpp | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp index db1959690..f4b640f0e 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp @@ -141,18 +141,20 @@ bool CPipelineProcessImpl::hasInputFileBeenModified(const std::string &inputFile bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string &inputDirectory, const std::set &excludeFiles, uint32 since) { - for (std::set::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr) + // for (std::set::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr) + for (std::map::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 ((pathr.size() > inputDirectory.size()) && (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 { - CFileStatus status; - if (!getDependencyFileStatusCached(status, pathr)) - nlerror("Cannot get cached status of known file"); + //CFileStatus status; + //if (!getDependencyFileStatusCached(status, pathr)) + // nlerror("Cannot get cached status of known file"); + const CFileStatus &status = it->second; if (status.FirstSeen >= since) // or > ? { nldebug("Found newly added '%s' in dependency directory '%s'", pathr.c_str(), inputDirectory.c_str()); @@ -166,17 +168,17 @@ bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string 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; + if (!getDependencyFileStatusCached(status, inputFile)) + nlerror("Cannot get cached status of known file"); + if (status.FirstSeen >= since) // or > ? { - CFileStatus status; - if (!getDependencyFileStatusCached(status, inputFile)) - nlerror("Cannot get cached status of known file"); - if (status.FirstSeen >= since) // or > ? - { - nldebug("Found newly added '%s' in dependency files", inputFile.c_str()); - return true; - } + nldebug("Found newly added '%s' in dependency files", inputFile.c_str()); + return true; } + /*}*/ return false; } @@ -470,6 +472,7 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i std::set inputsChecked; uint32 earliestBuildStart = 0xFFFFFFFF; + uint32 lastBuildStart = 0; // Check the .depend files of all the output files // also check that they exist :) for (std::vector::const_iterator it = outputPaths.begin(), end = outputPaths.end(); it != end; ++it) @@ -487,6 +490,8 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i { if (metaDepend.BuildStart < earliestBuildStart) earliestBuildStart = metaDepend.BuildStart; + if (metaDepend.BuildStart > lastBuildStart) + lastBuildStart = metaDepend.BuildStart; if (outputChanged) { // Compare the output checksum with the status output checksum @@ -538,8 +543,10 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i } // 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::const_iterator it = inputPaths.begin(), end = inputPaths.end(); it != end; ++it) { const std::string &path = *it;