Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm-lit] lit internal shell failing to parse and execute command substitution syntax #102384

Closed
3 of 4 tasks
connieyzhu opened this issue Aug 7, 2024 · 1 comment · Fixed by #105754 or #105902
Closed
3 of 4 tasks
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' compiler-rt:hwasan Hardware-assisted address sanitizer test-suite

Comments

@connieyzhu
Copy link
Contributor

connieyzhu commented Aug 7, 2024

lit’s internal shell cannot recognize and execute the $() command substitution syntax, which is used in tests across clang and compiler-rt.

Example error message:

FAIL: Clang :: Driver/offload-packager.c (17 of 20640)
******************** TEST 'Clang :: Driver/offload-packager.c' FAILED ********************
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 28
cd $(dirname "/usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp") && /usr/local/google/home/harinidonthula/llvm-project/build/bin/clang-offload-packager /usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp --image=kind=openmp
# executed command: cd '$(dirname' '/usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp)'
# .---command stderr------------
# | 'cd' supports only one argument
# `-----------------------------
# error: command failed with exit status: 127

Files with failures:

  • clang/test/Driver/offload-packager.c
  • clang/test/Modules/reduced-bmi-size.cppm
  • compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp
  • compiler-rt/test/msan/allocator_mapping.cpp
@EugeneZelenko EugeneZelenko added test-suite clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' and removed new issue labels Aug 7, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 7, 2024

@llvm/issue-subscribers-clang-driver

Author: Connie (connieyzhu)

lit’s internal shell cannot recognize and execute the `$()` command substitution syntax, which is used in tests across clang and compiler-rt.

Example error message:

FAIL: Clang :: Driver/offload-packager.c (17 of 20640)
******************** TEST 'Clang :: Driver/offload-packager.c' FAILED ********************
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 28
cd $(dirname "/usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp") && /usr/local/google/home/harinidonthula/llvm-project/build/bin/clang-offload-packager /usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp --image=kind=openmp
# executed command: cd '$(dirname' '/usr/local/google/home/harinidonthula/llvm-project/build/tools/clang/test/Driver/Output/offload-packager.c.tmp)'
# .---command stderr------------
# | 'cd' supports only one argument
# `-----------------------------
# error: command failed with exit status: 127

@EugeneZelenko EugeneZelenko added the compiler-rt:hwasan Hardware-assisted address sanitizer label Aug 27, 2024
@connieyzhu connieyzhu reopened this Aug 27, 2024
5c4lar pushed a commit to 5c4lar/llvm-project that referenced this issue Aug 29, 2024
… tests (llvm#105754)

This patch rewrites tests in clang and compiler-rt that uses bash
command substitution syntax $() to execute the dirname command. This is
done so that the tests can be run using lit's internal shell.

Fixes llvm#102384.
@connieyzhu connieyzhu reopened this Aug 29, 2024
dmpolukhin pushed a commit to dmpolukhin/llvm-project that referenced this issue Sep 2, 2024
… tests (llvm#105754)

This patch rewrites tests in clang and compiler-rt that uses bash
command substitution syntax $() to execute the dirname command. This is
done so that the tests can be run using lit's internal shell.

Fixes llvm#102384.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' compiler-rt:hwasan Hardware-assisted address sanitizer test-suite
Projects
None yet
3 participants