<div dir="ltr">Hopefully fixed in r348511.  I went with the approach of concatenating the executable file name, for two reasons.  First, it's easier, since dealing with the tmpfile module and mkstemp and sorts has its own set of complexities and issues.  Secondly, because it means the build artifacts will still be in a normal place (instead of in temporary directory) and with an intuitive name.  So this means if a test failed it might be easier for a developer to inspect the build artifacts to try to determine what went wrong.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 6, 2018 at 9:22 AM Stella Stamenova <<a href="mailto:stilis@microsoft.com">stilis@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-545053060948037102WordSection1">
<p class="MsoNormal">I am in favor of unique filenames because it will guarantee we avoid any problems like this in the future, but in most cases, as long as the names are unique *<b>in the test suite</b>*, that should be sufficient. So I don’t have any objections
 to Zachary’s approach of making the filenames unique enough.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">-Stella<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Aleksandr Urakov <<a href="mailto:aleksandr.urakov@jetbrains.com" target="_blank">aleksandr.urakov@jetbrains.com</a>>
<br>
<b>Sent:</b> Thursday, December 6, 2018 12:25 AM<br>
<b>To:</b> Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>><br>
<b>Cc:</b> <a href="mailto:reviews%2BD54942%2Bpublic%2B2603ca548f36d222@reviews.llvm.org" target="_blank">reviews+D54942+public+2603ca548f36d222@reviews.llvm.org</a>; Stella Stamenova <<a href="mailto:stilis@microsoft.com" target="_blank">stilis@microsoft.com</a>>; <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>; Hafiz Abid Qadeer <<a href="mailto:abidh.haq@gmail.com" target="_blank">abidh.haq@gmail.com</a>>; Raphael Isemann <<a href="mailto:teemperor@gmail.com" target="_blank">teemperor@gmail.com</a>>; <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>; <a href="mailto:sanimir@subpath.org" target="_blank">sanimir@subpath.org</a>;
 <a href="mailto:chirag@raincode.com" target="_blank">chirag@raincode.com</a>; Brian Gianforcaro <<a href="mailto:b.gianfo@gmail.com" target="_blank">b.gianfo@gmail.com</a>></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-545053060948037102WordSection1"><p class="MsoNormal"><br>
<b>Subject:</b> Re: [PATCH] D54942: [PDB] Make PDB lit tests use the new builder<u></u><u></u></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-545053060948037102WordSection1"><p class="MsoNormal"></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Yes, this solution would solve the current problem. But theoretically the uniqueness may be defined by the directory, where the file is located, not by the name. It looks very unlikely, but who knows...<u></u><u></u></p></div></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-545053060948037102WordSection1"><div><div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I thought about what Stella have said, and it seems that I have found a good solution for this. We can use something like `tempfile` (<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3.7%2Flibrary%2Ftempfile.html&data=02%7C01%7Cstilis%40microsoft.com%7Cbdbb5017a9b24a0ad26708d65b5458e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796815166605217&sdata=JXoPXUaLdantqlee9S0E7Huv8WIDoLHltXyn67GnABY%3D&reserved=0" target="_blank">https://docs.python.org/3.7/library/tempfile.html</a>)
 for every internally generated file of the script. It will guarantee us the uniqueness of the file. But for the uniqueness of files named by script parameters the script user will remain responsible.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">What do you think about the such approach?<u></u><u></u></p>
</div>
</div></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-545053060948037102WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Dec 5, 2018 at 11:55 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">I was thinking that we could just automatically compute the output file names as:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">os.path.join(out_dir, basename(output_file) + '.' + basename(input_file) + '.obj')<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Currently it's just <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">os.path.join(out_dir, basename(input_file) + '.obj')<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">which is why I think the problem occurs.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Dec 5, 2018 at 12:47 PM Aleksandr Urakov <<a href="mailto:aleksandr.urakov@jetbrains.com" target="_blank">aleksandr.urakov@jetbrains.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">With such solution there would be even no need to change the current commit. But I'm not sure that it's trivial to do - the output file name may contain path with directories. May be we can replace slashes with
 underscores in the output file path and concatenate it with the object file name? Or even replace slashes in the source file path and concatenate it with the output file path - so object files will be located in the same place as the output file.<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Am Mi., 5. Dez. 2018, 23:30 hat Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> geschrieben:<u></u><u></u></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">It is not possible to specify object file name in compile and link mode. But perhaps we can just change the default object file name to include something from the output file as well
<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Dec 5, 2018 at 12:26 PM Aleksandr Urakov via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">aleksandr.urakov added a subscriber: zturner.<br>
aleksandr.urakov added a comment.<br>
<br>
The similar problem with `typedefs.test` is here: <a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flab.llvm.org%3A8014%2Fbuilders%2Flldb-x64-windows-ninja%2Fbuilds%2F1940%2Fsteps%2Ftest%2Flogs%2Fstdio&data=02%7C01%7Cstilis%40microsoft.com%7Cbdbb5017a9b24a0ad26708d65b5458e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796815166615226&sdata=CGSQScg8GAQnLurJBOCf1JaoT4hFhluoD6fVkvdECxw%3D&reserved=0" target="_blank">
http://lab.llvm.org:8014/builders/lldb-x64-windows-ninja/builds/1940/steps/test/logs/stdio</a><br>
<br>
I have an assumption about the cause of the problem. Are the tests running in parallel? In this case `typedefs.test` and `enums-layout.test` are writing to the same object file together, because they both are compiled from the same source.<br>
<br>
@zturner Is it possible to specify object file's name in `compile-and-link` mode? Then we can specify different names in different tests for both object files and executables. But I think that splitting the source or combining the tests would be a better idea.<br>
<br>
I will fix it only tomorrow, because I'm already at home today. Feel free to revert it if needed.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD54942%2Fnew%2F&data=02%7C01%7Cstilis%40microsoft.com%7Cbdbb5017a9b24a0ad26708d65b5458e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796815166625231&sdata=nagEt0RLn04uZdpSBsoisT4%2BxhlMLMK5vXYv3UkKdrg%3D&reserved=0" target="_blank">
https://reviews.llvm.org/D54942/new/</a><br>
<br>
<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD54942&data=02%7C01%7Cstilis%40microsoft.com%7Cbdbb5017a9b24a0ad26708d65b5458e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796815166625231&sdata=5O%2FLR7P8QEPgE7bhN0z9Szk0UgV1sChq8QNhAvzcHaU%3D&reserved=0" target="_blank">https://reviews.llvm.org/D54942</a><br>
<br>
<br>
<u></u><u></u></p>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Aleksandr Urakov<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Software Developer<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">JetBrains<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jetbrains.com&data=02%7C01%7Cstilis%40microsoft.com%7Cbdbb5017a9b24a0ad26708d65b5458e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636796815166635240&sdata=upmrCJ165lcxyFu8cMo250E88LUpK8MG4G2ZjMpsp2A%3D&reserved=0" target="_blank">http://www.jetbrains.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The Drive to Develop<u></u><u></u></p>
</div>
</div>
</div>
</div></div></blockquote></div>