[llvm] r328563 - [lit] Implement 'cat' command for internal shell

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 01:39:43 PDT 2018


On 26 March 2018 at 19:05, Reid Kleckner via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rnk
> Date: Mon Mar 26 11:05:12 2018
> New Revision: 328563
>
> URL: http://llvm.org/viewvc/llvm-project?rev=328563&view=rev
> Log:
> [lit] Implement 'cat' command for internal shell
>
> Fixes PR36449
>
> Patch by Chamal de Silva
>
> Differential Revision: https://reviews.llvm.org/D43501
>
> Added:
>     llvm/trunk/utils/lit/lit/builtin_commands/
>     llvm/trunk/utils/lit/lit/builtin_commands/cat.py
>     llvm/trunk/utils/lit/tests/Inputs/shtest-shell/cat-error-0.txt
>     llvm/trunk/utils/lit/tests/Inputs/shtest-shell/cat-error-1.txt
>     llvm/trunk/utils/lit/tests/Inputs/shtest-shell/cat_nonprinting.bin   (with props)
> Modified:
>     llvm/trunk/utils/lit/lit/TestRunner.py
>     llvm/trunk/utils/lit/tests/Inputs/shtest-shell/valid-shell.txt
>     llvm/trunk/utils/lit/tests/max-failures.py
>     llvm/trunk/utils/lit/tests/shtest-shell.py

This is triggering new test failures for me on an ArchLinux host. I'm
assuming this is a Python2/3 issue: Arch makes the questionable choice
of symlinking /usr/bin/python to /usr/bin/python3. Though we can see
that /usr/bin/python2.7 is being invoked directly to execute the main
lit.py entry point at least.

See http://lab.llvm.org:8014/builders/llvm-riscv-linux/builds/2582/steps/test-llvm/logs/stdio

Sample failure:

FAIL: lit :: shtest-shell.py (24657 of 24663)
******************** TEST 'lit :: shtest-shell.py' FAILED ********************
Script:
--
not /usr/bin/python2.7
/srv/buildslave/llvm-riscv-linux/llvm.src/utils/lit/lit.py -j 1 -v
/srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/../tests/Inputs/shtest-shell
> /srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/Output/shtest-shell.py.tmp.out
cat /srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/Output/shtest-shell.py.tmp.out
FileCheck --input-file
/srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/Output/shtest-shell.py.tmp.out
/srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/shtest-shell.py
--
Exit Code: 1

Command Output (stdout):
--
$ "not" "/usr/bin/python2.7"
"/srv/buildslave/llvm-riscv-linux/llvm.src/utils/lit/lit.py" "-j" "1"
"-v" "/srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/../tests/Inputs/shtest-shell"
$ "cat" "/srv/buildslave/llvm-riscv-linux/llvm.obj/utils/lit/tests/Output/shtest-shell.py.tmp.out"
# command stderr:
Traceback (most recent call last):
  File "/srv/buildslave/llvm-riscv-linux/llvm.src/utils/lit/lit/builtin_commands/cat.py",
line 59, in <module>
    main(sys.argv)
  File "/srv/buildslave/llvm-riscv-linux/llvm.src/utils/lit/lit/builtin_commands/cat.py",
line 51, in main
    sys.stdout.write(contents)
TypeError: write() argument must be str, not bytes

error: command failed with exit status: 1


More information about the llvm-commits mailing list