forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler-rt][NFC] Replace environment variable with %t (llvm#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: llvm#102395 [link to RFC](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
- Loading branch information
1 parent
837bba9
commit 91c24aa
Showing
5 changed files
with
26 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters