<table><tr><td style="">vbspam added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9297" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Hmm. There's a comment in the line above which states it explicitly uses canonicalFilePath to avoid issues with symlinks.</p></blockquote>

<p>I 100% agree, that is why I am cautious about this, therefore my question above.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>If we resolve symlinks like you suggest, there will be situations like files which are part of a project but for which the project's root directory is not a prefix of the file path.</p></blockquote>

<p>My test case scenario (<a href="https://bugs.kde.org/attachment.cgi?id=109155" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/attachment.cgi?id=109155</a>) is covering this. I have one CMake project inside, I have other (LibBar) which is "physically" outside and symlinked inside.</p>

<p>This test scenario works well with the fix now. What I found is that canonicalFilePath() (in other words unique path pointing to the original/physical file - outside the project root), does not work well with KDevelop call which uses absoluteFilePath() (in other words absolute path visually appearing as absolute path to the symlink (not to the target file) - so to be inside project).</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Are we somewhat sure this doesn't break in other places?</p></blockquote>

<p>It works for normal files, it also works for both absolute(don't get confused with absoluteFilePath above which which is this term not about) and relative symlinks.</p>

<p>Thank you for the question! You are right, I forgot to test symlinks to resources physically stored inside the project root. I quickly created such scenario now which can be found here (<a href="https://bugs.kde.org/attachment.cgi?id=109341" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/attachment.cgi?id=109341</a>). I reveals that it does not work, I believe however that KDevelop does not properly build the project tree. My new test scenario links "LibAnotherBar" to the project root from the "InsideProjectRoot/LibAnotherBar". The build system is instructed to use the LibAnotherBar (by cmake add_subdirectory(LibAnotherBar) ), KDevelop however assumes the build system meant InsideProjectRoot/LibAnotherBar" and shows the project treeview populated with the "InsideProjectRoot/LibAnotherBar" instead requested "LibAnotherBar".</p>

<p>I did check the CMake server response and it shows properly generated build system (please check attached test4.json <a href="https://phabricator.kde.org/F5543815" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F5543815: test4.json</a>)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9297" rel="noreferrer">https://phabricator.kde.org/D9297</a></div></div><br /><div><strong>To: </strong>vbspam, KDevelop<br /><strong>Cc: </strong>brauch, kdevelop-devel, vbspam, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>