[Lldb-commits] [PATCH] D54942: [PDB] Make PDB lit tests use the new builder

Aleksandr Urakov via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 6 00:25:02 PST 2018

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...

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` (
https://docs.python.org/3.7/library/tempfile.html) 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.

What do you think about the such approach?

On Wed, Dec 5, 2018 at 11:55 PM Zachary Turner <zturner at google.com> wrote:

> I was thinking that we could just automatically compute the output file
> names as:
> os.path.join(out_dir, basename(output_file) + '.' + basename(input_file) +
> '.obj')
> Currently it's just
> os.path.join(out_dir, basename(input_file) + '.obj')
> which is why I think the problem occurs.
> On Wed, Dec 5, 2018 at 12:47 PM Aleksandr Urakov <
> aleksandr.urakov at jetbrains.com> wrote:
>> 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.
>> Am Mi., 5. Dez. 2018, 23:30 hat Zachary Turner <zturner at google.com>
>> geschrieben:
>>> 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
>>> On Wed, Dec 5, 2018 at 12:26 PM Aleksandr Urakov via Phabricator <
>>> reviews at reviews.llvm.org> wrote:
>>>> aleksandr.urakov added a subscriber: zturner.
>>>> aleksandr.urakov added a comment.
>>>> The similar problem with `typedefs.test` is here:
>>>> http://lab.llvm.org:8014/builders/lldb-x64-windows-ninja/builds/1940/steps/test/logs/stdio
>>>> 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.
>>>> @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.
>>>> I will fix it only tomorrow, because I'm already at home today. Feel
>>>> free to revert it if needed.
>>>> Repository:
>>>>   rL LLVM
>>>>   https://reviews.llvm.org/D54942/new/
>>>> https://reviews.llvm.org/D54942

Aleksandr Urakov
Software Developer
The Drive to Develop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181206/1fd2123c/attachment-0001.html>

More information about the lldb-commits mailing list