[PATCH] D35880: Un-revert "Teach the CMake build system to run lit's test suite. These can be run"

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 03:58:16 PDT 2017


delcypher added a comment.

@george.karpenkov

In https://reviews.llvm.org/D35880#821849, @george.karpenkov wrote:

> @mgorny The problem here is that `%t` is expanded in a deterministic way based on a test filename.
>  This makes running concurrently the same test prone to race conditions.
>
> One way to fix it would be to create a true temporary file instead:
>  <snip>
>  This could be also undesirable, making figuring out test behavior hard to reproduce.
>  Again, an easy solution would be to add a flag and an environment variable to switch between the two modes (temporary deleted file vs. persistent file).


Wouldn't it be just simpler to use `tempfile.mkstemp()` and specify the `prefix` argument to be what the deterministic file name used to be?

That way we get a temporary file name but it starts with a prefix that a human can easily recognise.

There's another problem with this proposal though. In a project that I work on that depends on lit we use

  RUN: mkdir -p %t

Your proposed change to the semantics of `%t` would break all of these tests.


https://reviews.llvm.org/D35880





More information about the llvm-commits mailing list