<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2015, at 7:57 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">Currently we do not seem to issue any form of diagnostic when there are missing headers named in a module map. See the attached test case. Even worse, we will just treat all headers in the module as textual. Hilarity ensues.</div></div></div></blockquote><div><br class=""></div><div>Yep, this is <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_PR20507&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=7emrXHe42ROIsOZ1QACM5mPMfKOp3EhepVmjzut4P_w&s=1YGQT_NMVwRCs_BjBKQBtFx9NjGkg5b-kkncFT6ikwk&e=" class="">llvm.org/PR20507</a></div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Some prior art in this area:<div class="">Daniel - r197485</div><div class="">Ben - r206664</div></div><div class=""><br class=""></div><div class="">Based on these commits, it ostensibly seems that clang does *some* sort of checking for missing files in a module map, but I can't seem to coax clang into doing this in C++ language mode.</div><div class=""><br class=""></div><div class="">Looking at the source code, it seems like we end up conflating "unavailable" due to a failed `requires` with "a header is missing". It sounds like we essentially need two notions "unsatisfied `requires`" and "necessary header is missing" (a header guarded by an unsatisfied `requires` does not count as "necessary"). Haven't dug in deep yet, but my hypothesis is that somewhere along the way we silently treat a module with missing headers as though it had an unsatisfied `requires`, leading to us silently neglecting that it was ever in a module at all.</div></div></div></blockquote><div><br class=""></div><div>Yes, they both come out as the module being “unvavailable”, which is why we don’t import it. I think the right answer is that attempting to import any unavailable module (even via an auto-import) should be an error. That is:</div><div><br class=""></div><div><div>module MissingHeader {</div><div> header “exists.h"</div><div> header “doesnt_exist.h”</div><div>}</div><div><br class=""></div><div>#include <exists.h> // error, this would import MissingHeader, which is unavailable because we're missing header “doesnt_exist.h"</div></div><div><br class=""></div><div>module Top {</div><div> header “Top.h”</div><div> module A {</div><div> requires non_existent</div><div> header “A.h”</div><div> }</div><div> module B {</div><div> header “B.h”</div><div> }</div><div>}</div><div><br class=""></div><div>#include <Top.h> // OK</div><div>#include <A.h> // error, this would import Top.A, which is unavailable because of the missing requirment</div><div>#include <B.h> // OK</div><div><br class=""></div><div>But handling the first case is more important I think.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I'm glad to put some effort into fixing this; I spent a good part of today with a bizarre error that I traced back to this and I don't want my users to have to deal with the same. Any pointers would be appreciated.</div></div></div></blockquote><div><br class=""></div><div>That would be great! I was coincidentally hoping to fix this myself in the next few weeks, but if you beat me to it even better.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">-- Sean Silva</div></div>
<span id="cid:4B58B833-6A2A-4BF6-8087-E20ED3859DC7@localhost"><testmoduledepbuildfail.tar></span></div></blockquote></div><br class=""></body></html>