<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;"><br><div><blockquote type="cite"><div>On Jul 7, 2014, at 10:03 AM, Ben Langmuir <<a href="mailto:blangmuir@apple.com">blangmuir@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">On Jul 7, 2014, at 9:27 AM, Ulrich Weigand <<a href="mailto:Ulrich.Weigand@de.ibm.com">Ulrich.Weigand@de.ibm.com</a>> wrote:<br><br>Ben Langmuir <<a href="mailto:blangmuir@apple.com">blangmuir@apple.com</a>> wrote on 07.07.2014 18:12:21:<br><br><blockquote type="cite"><blockquote type="cite">And indeed running clang directly against the temporary files created<br></blockquote></blockquote>by<br><blockquote type="cite"><blockquote type="cite">the test case I get:<br>uweigand@bns:~> ./llvm/build/llvm-head-debug/Debug+Asserts/bin/clang<br>-fmodules<br></blockquote></blockquote>-I /tmp/libclang-test-6a8ede /tmp/libclang-test-6a8ede/MFile.m<br><blockquote type="cite"><blockquote type="cite">/tmp/libclang-test-6a8ede/MFile.m:2:25: error: variable has incomplete<br></blockquote></blockquote>type<br><blockquote type="cite"><blockquote type="cite">'struct Foo'<br>int main() { struct Foo foo; foo.bar = 7; foo.baz = 8; }<br>                     ^<br>/tmp/libclang-test-6a8ede/MFile.m:2:21: note: forward declaration of<br>'struct Foo'<br>int main() { struct Foo foo; foo.bar = 7; foo.baz = 8; }<br>                 ^<br>1 error generated.<br></blockquote><br>Could you try this again with the additional flags -Wmodule-build -<br>Wauto-import as a sanity check that the module is being found?  It<br>looks like the module isn’t being imported properly...<br></blockquote><br>Hmm, interesting.  I get:<br><br>uweigand@bns:~> ./llvm/build/llvm-head-debug/Debug+Asserts/bin/clang<br>-fmodules -I /tmp/libclang-test-75f2f2 /tmp/libclang-test-75f2f2/MFile.m<br>-Wmodule-build -Wauto-import<br>/tmp/libclang-test-75f2f2/MFile.m:1:1: warning: treating #include as an<br>import of module 'A' [-Wauto-import]<br>#include "HeaderFile.h"<br>^~~~~~~~~~~~~~~~~~~~~~~<br>@import A;<br>/tmp/libclang-test-75f2f2/MFile.m:1:2: remark: building module 'A' as<br>'/var/tmp/org.llvm.clang/ModuleCache/1MXAFKYV64X0T/A-25ZFQ1VWL2WP7.pcm' [-Rmodule-build]<br><br>#include "HeaderFile.h"<br>^<br>/tmp/libclang-test-75f2f2/MFile.m:2:25: error: variable has incomplete type<br>'struct Foo'<br>int main() { struct Foo foo; foo.bar = 7; foo.baz = 8; }<br>                      ^<br>/tmp/libclang-test-75f2f2/MFile.m:2:21: note: forward declaration of<br>'struct Foo'<br>int main() { struct Foo foo; foo.bar = 7; foo.baz = 8; }<br>                  ^<br>1 warning and 1 error generated.<br><br>However, the really interesting fact is that afterwards,<br>there is no /var/tmp/org.llvm.clang/ModuleCache/1MXAFKYV64X0T<br>directory -- and there cannot be, because there is a<br>/var/tmp/org.llvm.clang/ModuleCache directory, owned<br>by another user on the system, and my user ID does not<br>have the privileges to create subdirectories there ...<br><br><br>After I've removed that directory, the test case now passes!<br>(But it will presumably fail for other users now …)<br><br>How is this supposed to work on a multi-user machine?<br></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I’ll fix the test to specify a unique module cache path.</span></div></blockquote><div><br></div><div>r212467</div><br><blockquote type="cite"><div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">In general, we use llvm::sys::path::system_temp_dir to create the default module cache location.  On Darwin, we use DARWIN_USER_CACHE_DIR, which is user-specific so this isn’t an issue.  On Linux, we seem to honour the environment variable TMPDIR, before falling back to /var/tmp. I don’t know if this is correct for Linux; perhaps you know of a better way?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Ben</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>Bye,<br>Ulrich<br></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">cfe-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="mailto:cfe-commits@cs.uiuc.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">cfe-commits@cs.uiuc.edu</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></body></html>