llvm-project
c69b8c44 - [compiler-rt][NFC] Replace environment variable with %t (#102197)

Commit
1 year ago
[compiler-rt][NFC] Replace environment variable with %t (#102197) Certain tests within the compiler-rt subproject encountered "command not found" errors when using lit's internal shell, particularly when trying to use the `DIR` environment variable. When checking with the command `LIT_USE_INTERNAL_SHELL=1 ninja check-compiler-rt`, I encountered the following error: ``` ******************** Testing: FAIL: SanitizerCommon-ubsan-i386-Linux :: sanitizer_coverage_trace_pc_guard-init.cpp (146 of 9570) ******************** TEST 'SanitizerCommon-ubsan-i386-Linux :: sanitizer_coverage_trace_pc_guard-init.cpp' FAILED ******************** Exit Code: 127 Command Output (stdout): -- # RUN: at line 5 DIR=/usr/local/google/home/harinidonthula/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-i386-Linux/Output/sanitizer_coverage_trace_pc_guard-init.cpp.tmp_workdir # executed command: DIR=/usr/local/google/home/harinidonthula/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-i386-Linux/Output/sanitizer_coverage_trace_pc_guard-init.cpp.tmp_workdir # .---command stderr------------ # | 'DIR=/usr/local/google/home/harinidonthula/llvm-project/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-i386-Linux/Output/sanitizer_coverage_trace_pc_guard-init.cpp.tmp_workdir': command not found # `----------------------------- # error: command failed with exit status: 127 ``` In this patch, I resolved these issues by removing the use of the `DIR` environment variable. Instead, the tests now directly utilize `%t_workdir` for managing temporary directories. Additionally, I simplified the tests by embedding the clang command arguments directly into the test scripts, which avoids complications with environment variable expansion under lit's internal shell. This fix ensures that the tests run smoothly with lit's internal shell and prevents the "command not found" errors, improving the reliability of the test suite when executed in this environment. fixes: #102395 [link to RFC](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
Author
Parents
Loading