<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">If the hash value of the module is different then most likely something else is going on -- are you passing any special flags or defines as part of the compiler command? If you run the same command from swiftc on the command line do you see the same behavior?<div class=""><br class=""></div><div class=""> - Daniel</div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 29, 2016, at 2:08 PM, Ramakrishna Mallireddy <<a href="mailto:ramakrishna.malli@gmail.com" class="">ramakrishna.malli@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Every-time I run swift frontend the clang creates a new cachedir with modulecache path hash(on every run the hash value is different for the same input string) as the name of the dir and generates default cocoa framework pcm files inside it.<div class=""><br class=""></div><div class="">I am using the swift front-end c++ api's to compile a simple swift file.</div><div class="">If I set the -fdisable-module-hash, then pcm files are generated without the hash as required under the ModuleCache Dir.</div><div class="">so problem is solved as clang now see the existing pcm files, but now I hit the next hurdle.</div><div class=""><br class=""></div><div class="">Now the pcm files are there in the cache, when I run the frontend again, I assume clang will load the AST from the pcm files but clang <b class="">ReadAST </b>returns with<b class=""> </b><b class="">ASTReader::OutOfDate </b>and as usual it calls<b class=""> </b><b class="">compileAndLoadModule </b>which I want to avoid in the first place<b class="">.</b></div><div class=""><br class=""></div><div class=""><span class="">Call to <b class="">CLang</b>::</span><b class="">CompilerInstance</b>::<span class=""><b class="">ModuleManager</b></span><span class="">-></span><span class=""><b class="">ReadAST</b></span><span class="">(ModuleFileName,</span></div>
<div class=""><p class=""><span class=""> </span><span class="">serialization</span><span class="">::</span><span class="">MK_ImplicitModule</span><span class="">,</span></p><p class=""><span class=""> ImportLoc, ARRFlags) </span><span class="">return with </span><b class="">ASTReader::OutOfDate</b></p><p class=""><span class="">as </span><span class=""><b class="">ReadASTCore</b>(FileName, Type, ImportLoc, </span><span class=""> </span><span class="">/*ImportedBy=*/</span><span class="">nullptr</span><span class="">, Loaded, </span><span class="">0</span><span class="">, </span><span class="">0</span><span class="">, </span><span class="">0</span><span class="">, </span>ClientLoadCapabilities) returns with <b class="">OutOfDate.</b></p><p class="">These files are generated just few minutes ago, how can it be OutOfDate I don't have any idea.</p><p class="">File<b class=""> modules.timestamp</b> under the ModuleCache Dir is 0 bytes.</p><p class="">Thanks</p><p class="">Ramakrishna</p>
</div>
</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 29, 2016 at 9:15 PM, Daniel Dunbar <span dir="ltr" class=""><<a href="mailto:daniel_dunbar@apple.com" target="_blank" class="">daniel_dunbar@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Clang will cache these automatically, can you give more details on exactly what you are seeing?<br class="">
<br class="">
- Daniel<br class="">
<div class=""><div class="h5"><br class="">
> On Apr 28, 2016, at 10:50 PM, Ramakrishna Mallireddy via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:<br class="">
><br class="">
> I have these precompiled module files generated every-time I run the swift compiler.<br class="">
><br class="">
> _Builtin_stddef_max_align_t-1LMTETLX3WNFT.pcm<br class="">
> CFNetwork-1UTIO6DPB9R5P.pcm<br class="">
> CoreFoundation-CF8BGN41VJ11.pcm<br class="">
> CoreGraphics-3SDFP08OX46EF.pcm<br class="">
> CoreImage-3SDFP08OX46EF.pcm<br class="">
> Darwin-4F8STAM1KXDF.pcm<br class="">
> Foundation-2LQ7EQYFLQOP.pcm<br class="">
> ...etc<br class="">
><br class="">
> How can I make the swift compiler to use these cache rather than compiling the libraries again.<br class="">
><br class="">
> Thanks<br class="">
> Ramakrishna<br class="">
</div></div>> _______________________________________________<br class="">
> swift-users mailing list<br class="">
> <a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>