[PATCH] D154984: [lit] Drop "Script:", make -v and -a imply -vv

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 09:01:43 PDT 2023


jdenny added a comment.

In D154984#4493743 <https://reviews.llvm.org/D154984#4493743>, @awarzynski wrote:

>> If a RUN line fails, you don't see the remaining RUN lines that didn't execute.  Are you saying you would like to see those too?
>
> I meant something slightly different. Some `RUN` get very complicated - especially when adding `{RE}DEFINE` to the mix and e.g. emulators to run tests on.  I would like to be able to simply check that LIT correctly interprets my `RUN` lines without running the tests (which can take some time to run and generate a lot of output). I think that that would be very useful.

So I'm hearing there are two issues with using `-vv`-like traces for your use case:

1. They are noisy.  I wonder if the real problem is that we just need a more readable format for the trace.  For example, I wonder if indenting all stdout/stderr lines with "> " or something would help distinguish them from command lines.  There's also the issue that we can easily control lit's internal shell, but external shells format the trace differently.
2. They take a long time to run.  I don't know how to address that in the -vv trace.  Indeed it seems you would need something like the "Script:" section.

> And looks like it's going to get harder to achieve :/

Right, PYTHON directives make shell commands more dynamic, so lit cannot always fully expand the shell commands until it's time to execute them.

However, one simple possibility is for your proposed `-print-script` to print all RUN lines before the first PYTHON directive.  If you don't use PYTHON directives (e.g., if the community rejects PYTHON directives), you'll get exactly what you want.  If you do use PYTHON directives, you'll get only any initial RUN commands.  Of course, we could also discuss printing "Script:" sections between PYTHON blocks as the test executes, but that runs into the execution time problem above.

> Btw, this patch changes the semantics of LIT. I think that it would be good post a short RFC on Discourse and to advertise this. Some people might rely on the current behavior.

After the points you raise, I agree we should have an RFC before landing this patch.  However, do you mind if we have more discussion here first?  I think that would produce a better RFC.

> Or perhaps this has already been discussed somewhere?

I don't recall anything.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154984/new/

https://reviews.llvm.org/D154984



More information about the llvm-commits mailing list