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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 23:25:25 PDT 2023


MaskRay added a comment.

In D154984#4508661 <https://reviews.llvm.org/D154984#4508661>, @Endill wrote:

> In D154984#4508361 <https://reviews.llvm.org/D154984#4508361>, @jdenny wrote:
>
>> 1. Keep "Script:".  To address the redundancy problem that motivated this patch, disable "Script:" by default when just given -a or -v, and add some new command-line option to enable it (or maybe recycle -vv).
>
> I can easily imagine people being confused that what was `-vv` is now `-v`, but `-vv` lives on with new semantics.

To address the redundancy problem, disabling "Script:" in `-a` and `-v` modes looks good to me. Keeping "Script:" functionality with `-vv` looks good if users need this feature.

I have had the habit to always use `-vv` instead of `-v` to know the failed command number. Some users may be like me.
Removing `Script:` from `-v` and reporting the failed commands will make the `-v` mode usable.

>> To address the PYTHON line problem that motivated this patch, "Script:" would not include RUN lines beyond the first PYTHON line.
>
> This doesn't feel intuitive for users as well. More like an implementation detail leaking to user interface, which users will have to learn about.
>
> Because of that, I'd discourage going with option 1 even as stopgap until landing another option.



> 2. Extend lit's internal shell to print full shell command lines before executing them. Reconfigure tests suites that need this functionality to use lit's internal shell.

Does this mean to print a pipe as one single command instead of two? Current output is:

  Script:
  --
  : 'RUN: at line 1';   echo xxx | cat
  : 'RUN: at line 2';   echo yyy | cat >&2
  --
  Exit Code: 0
  
  Command Output (stdout):
  --
  $ ":" "RUN: at line 1"
  $ "echo" "xxx"
  # command output:
  xxx
  
  $ "cat"
  $ ":" "RUN: at line 2"
  $ "echo" "yyy"
  # command output:
  yyy
  
  $ "cat"

I can see that preserving the pipe and redirection (`$ "echo" "xxx" | "cat" 2>&1`) will be more useful.

I don't know how people feel about printing `# command output:` immediately after printing a command with the internal shell (`LIT_USE_INTERNAL_SHELL=1`).

The external shell behavior seems to collect all stdout and stderr. I guess just removing the `+ ` sign at the beginning of a command will make the output a replacement of `Script:`.


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