<div dir="ltr"><div>Hello,</div><div><br></div><div>I have fixed it but I am struggling with the new policy. The behaviour change goes into cmSystemTools::GetRealPath implementation and SystemTools has no context, so I am not sure how to check the policy.</div><div><br></div><div>Mimicking policy CMP0067 usage, I could create an old and a new version of GetRealPath and check for the policy prior calling it all along the code. On the other hand, I could pass the policy status as a parameter to every GetRealPath call. Which is the proper way?</div><div><br></div><div>To perform a pull request, should I previously open an issue about this or it is enough with the discusion here in the mailing list.</div><div><br></div><div>Regards.</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-16 11:35 GMT+02:00 Manu <span dir="ltr"><<a href="mailto:ianmalcom@gmail.com" target="_blank">ianmalcom@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">2017-08-15 16:43 GMT+02:00 Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_8977280881569181389gmail-">On 08/14/2017 06:35 AM, Manu wrote:<br>
> Recently I migrated from cmake 2.8.12 to cmake 3.8 and FILE(TIMESTAMP ...)<br>
> behaviour changed. Now it reports symbolic link timestamp instead of pointed<br>
> file timestamp.<br>
<br>
</span>Can you track down when that happened?<br>
<span class="gmail-m_8977280881569181389gmail-"><br></span></blockquote><div><br></div></span><div>I happened in release 3.1.0, back 2014. The commit which changed behaviour was this:</div><div><br></div><div><a href="https://github.com/Kitware/CMake/commit/9571214e55cb8b86dadb26b6b1d696ef488bdd4b" target="_blank">https://github.com/Kitware/<wbr>CMake/commit/<wbr>9571214e55cb8b86dadb26b6b1d696<wbr>ef488bdd4b</a><br></div><div><br></div><div><font face="arial, helvetica, sans-serif">In source file Source/cmTimestamp.cxx, </font><font face="monospace, monospace">stat </font><font face="arial, helvetica, sans-serif">call was replaced by kwsys </font><font face="monospace, monospace">ModifiedTime </font><font face="arial, helvetica, sans-serif">call. kwsys relies in system function GetFileAttributesExW which do not resolve symlinks, however stat does (in spite of not being documentented in MSDN).</font><br></div><div><br></div><div>Removing the #ifdef WIN32 clause in ModifiedTime and using stat call resolves the problem, nevertheless, this change does not resolves get_filename_compoment symlinks issue in Windows. The problem here is again in kwsys, which uses system call GetFullPathNameW (which do not resolves symlinks) instead of GetFinalPathNameByHandleW (which does).</div><div><br></div><div>Despite of being two different commands, I think they are very related in this issue and the change should be make together.</div><span class="gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_8977280881569181389gmail-">
> patch to fix both get_filename_compoment and FILE(TIMESTAMP ...)<br>
><br>
</span><span class="gmail-m_8977280881569181389gmail-">> What troubles me is that symlink under Windows is a feature introduced in<br>
> Windows Vista and the change for handling them will break Windows XP<br>
> compatibility. Is this acceptable?<br>
<br>
</span>We still support running on XP.  If any newer Windows APIs are needed they<br>
need to be looked up dynamically.  Also, behavior changes for existing commands<br>
may need a policy.<br>
<br></blockquote><div><br></div></span><div>I did not dig into cmake policies development but I am willing to submit a patch which includes a new policy as soon I can piece it up all together.</div><span class="gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
See also <a href="https://gitlab.kitware.com/cmake/cmake/issues/16926" rel="noreferrer" target="_blank">https://gitlab.kitware.com/cma<wbr>ke/cmake/issues/16926</a> for discussion<br>
of symbolic link APIs.<br>
<span class="gmail-m_8977280881569181389gmail-HOEnZb"><font color="#888888"><br>
-Brad<br>
</font></span></blockquote></span></div><br><div>Manuel.</div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">La victoria puede ser creada  -  Sun Tzu.</div></div>
</div></div>