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

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 13:08:36 PDT 2023


awarzynski added a comment.

In D154984#4539712 <https://reviews.llvm.org/D154984#4539712>, @jdenny wrote:

> Here's an example of what I mean, but we can certainly tweak more:

Thanks for the example.

> Would the above work for you?

Yes, that should work.

> Alternatively, lit can use external shells, such as `cmd` for windows or `bash`/`sh` for unix.

Thanks for the explanation - now I understand what you were referring to.

> I don't yet know how to prevent it from mixing the commands and their stderr (where it prints the commands).

I think that I have an example for that. For this "broken" version of `RUN` line from concatenate_dim_1.mlir <https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/SparseTensor/CPU/concatenate_dim_1.mlir>:

  <WORKDIR>build/release/bin/mlir-opt <WORKDIR>/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_index.mlir --sparse-compiler=enableruntime-library=true | <WORKDIR>/build/release/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=<WORKDIR>/build/release/lib/libmlir_c_runner_utils.so | <WORKDIR>/build/release/bin/FileCheck <WORKDIR>/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_index.mlir

I get:

  + <WORKDIR>/build/release/bin/mlir-opt <WORKDIR>/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_index.mlir --sparse-compiler=enableruntime-library=true
  + <WORKDIR>/build/release/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=<WORKDIR>/build/release/lib/libmlir_c_runner_utils.so
  + <WORKDIR>/build/release/bin/FileCheck <WORKDIR>/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_index.mlir
  <Pass-Options-Parser>: no such option enableruntime-library
  Error: entry point not found
  FileCheck error: '<stdin>' is empty.

This output is quite noisy - it's the 1st command that fails, but the error doesn't get printed until after the 3rd command from the `RUN` line. I am not aware of any way to improve this. One could use `BASH_XTRACEFD` to redirect the debug output, but I'm not convinced that that would be an improvement.


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