Skip to content

[llvm-lit] The env command without args doesn't support redirection with lit internal shell #106627

@Harini0924

Description

@Harini0924

The lit internal shell doesn't support redirection to a temp file for env command without any arguments.
Error message:

UNRESOLVED: LLVM :: tools/not/disable-symbolization.test (1 of 1)
******************** TEST 'LLVM :: tools/not/disable-symbolization.test' FAILED ********************
Exception during script execution:
Traceback (most recent call last):
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/worker.py", line 76, in _execute_test_handle_errors
    result = test.config.test_format.execute(test, lit_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/formats/shtest.py", line 29, in execute
    return lit.TestRunner.executeShTest(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 2298, in executeShTest
    return _runShTest(test, litConfig, useExternalSh, script, tmpBase)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 2242, in _runShTest
    res = runOnce(execdir)
          ^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 2218, in runOnce
    res = executeScriptInternal(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1086, in executeScriptInternal
    exitCode, timeoutInfo = executeShCmd(
                            ^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 204, in executeShCmd
    finalExitCode = _executeShCmd(cmd, shenv, results, timeoutHelper)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 696, in _executeShCmd
    res = _executeShCmd(cmd.rhs, shenv, results, timeoutHelper)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 687, in _executeShCmd
    res = _executeShCmd(cmd.rhs, shenv, results, timeoutHelper)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 831, in _executeShCmd
    stdin, stdout, stderr = processRedirects(
                            ^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 655, in processRedirects
    fd = open(redir_filename, mode)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: b'/usr/local/google/home/harinidonthula/llvm-project/llvm/build/test/tools/not/Output/disable-symbolization.test.tmp'


********************

file with failure:

  • llvm/test/tools/not/disable-symbolization.test

Steps to reproduce:

  1. CMake Config:
    cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;llvm;clang-tools-extra;lld;lldb;bolt;mlir;libclc;polly" -DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libcxx;libunwind;libcxxabi" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build -S .
  2. Use this command to run lit's internal shell on this test.
    LIT_USE_INTERNAL_SHELL=1 LIT_FILTER="disable-symbolization.test" ninja check-llvm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions