<div dir="ltr"><div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 5, 2018 at 9:56 PM, Antoine Pitrou <span dir="ltr"><<a href="mailto:antoine@python.org" target="_blank">antoine@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
Hello,<br>
<br>
On our project (Apache Arrow - <a href="https://arrow.apache.org/" rel="noreferrer" target="_blank">https://arrow.apache.org/</a>) we're using<br>
CMake for the C++ source tree and have many external dependencies<br>
fetched using ExternalProject. In turn building those dependencies can<br>
make up a significant portion of build times on CI services, especially<br>
AppVeyor. So I've been looking for a solution to cache those<br>
third-party builds from one CI run to the other.<br>
<br>
Right now, what I'm trying to do is to set EP_BASE to a well-known base<br>
directory and ask AppVeyor to cache and restore that directory in each<br>
new build. The AppVeyor caching seems to work fine (the EP_BASE<br>
directory is saved and restored). However, it seems that nevertheless<br>
CMake will rebuild all those projects again, despite the cached build<br>
results.<br></blockquote><div><br></div><div>When AppVeyor restores the cached directories and files, does it also preserve their timestamps? If not, that might explain why it always rebuilds.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
This is with CMake 3.12.1 on Windows.<br>
<br>
Here is the log for an example build step, here the zstd library:<br>
<a href="https://ci.appveyor.com/project/pitrou/arrow/build/1.0.700/job/i4tj6tifp4xq1mjn?fullLog=true#L803" rel="noreferrer" target="_blank">https://ci.appveyor.com/<wbr>project/pitrou/arrow/build/1.<wbr>0.700/job/i4tj6tifp4xq1mjn?<wbr>fullLog=true#L803</a><br>
<br>
As you can see, CMake notices the downloaded tarball is up-to-date and<br>
doesn't download it again, but it still extracts it again (why?) and<br>
builds the source code anew. Yet the entire EP_BASE directory (here<br>
"C:/Users/appveyor/arrow-<wbr>externals") is cached and restored by AppVeyor.<br>
<br>
Did someone manage to make this work, and/or is there another solution?<br><br></blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div>
</div></div></div>