<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/100745/">http://git.reviewboard.kde.org/r/100745/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Manuel Massing.</div>


<p style="color: grey;"><i>Updated Feb. 27, 2011, 4:03 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks David for the review. Updated the patch for fine-grained (i.e, per-file) MRU semantics for currentDirs
search order.

I've checked and cmake parallel builds definitely interleave build directories, i.e.
subdirectories are not guaranteed to be processed in sequential order. This means it's
unfortunately not sufficient to check currentDirs.back().

While I think the last patch already matched the behaviour of the makefile case with
respect to search path order,you are right that updating the most recent build dirs
with higher (per-file instead of per-directory) granularity will reduce the probability of
associating an error with the incorrect source file (in any case, only a problem for parallel builds).

While it's still not completely watertight, mismatching a file can only occur
under very specific circumstances - I think the following must hold for a mismatch to occur:

1) Parallel builds
2) The build must take place in the source tree (otherwise the relative paths are unambiguous)
   - but in out-of-source build this could still affect e.g. auto-generated moc cpp files
3) At least two source files need to share the same name
4) The source files must reside in different source directories, but share a common sub-path, e.g.

                /src/commonSubPath/test.cpp
                /src/somePrefix/commonSubPath/test.cpp

5) Additionally, if currentDirs are held in per-file most-recently-used order, the source files must also be compiled directly
   one after the other

In such a case, currentDirs would contain:

        $buildDir/commsubSubPath
        $buildDir/somePrefix/commonSubPath

If a build error occurs in commonSubPath/test.cpp, gcc gives us the relative filename as "test.cpp".

Doing a most recently used match will then find the file $buildDir/somePrefix/commonSubPath/test.cpp
before the real culprit, $buildDir/commonSubPath/test.cpp

Anyway looks like a total edge-case to me. But I've been able to carefully hand-craft a cmake project where
it fails :-) Other than that, I doubt this case is hit in practice.

</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fixes MakeOutput items for cmake builds which use relative paths 
(i.e. cmake projects with CMAKE_USE_RELATIVE_PATHS set to on).

Previously, errors generated by source files with relativ paths
were not clickable because MakeOutputModel does not know about
the directories they are built in.

Because cmake is not verbose enough to indicate directory changes,
observes where object files are being built and use these paths
as search path for urlToFile.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested on cmake project with SET(CMAKE_USE_RELATIVE_PATHS ON).</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>projectbuilders/makebuilder/makeoutputmodel.h <span style="color: grey">(5ac45535a0d6d5496c48631d281e322c7b1b792e)</span></li>

 <li>projectbuilders/makebuilder/makeoutputmodel.cpp <span style="color: grey">(09bb72e4621e8033666d6c0c36c1fc34834754a9)</span></li>

 <li>projectbuilders/makebuilder/outputfilters.cpp <span style="color: grey">(3b6b806d73375daf85831f734153a5bf4e2293d6)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/100745/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>