Skip to content

[LLVM] Do not require shell for some tests #94595

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

Merged
merged 3 commits into from
Jun 6, 2024
Merged

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jun 6, 2024

Remove REQUIRES: shell from some tests that seem fine without it.
Tested on Windows and with LIT_USE_INTERNAL_SHELL=1 on Linux.

@jayfoad jayfoad changed the title [WIP] Do not require shell for some tests [LLVM] Do not require shell for some tests Jun 6, 2024
@jayfoad jayfoad marked this pull request as ready for review June 6, 2024 15:58
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2024

@llvm/pr-subscribers-debuginfo

Author: Jay Foad (jayfoad)

Changes

Remove REQUIRES: shell from some tests that seem fine without it.
Tested on Windows and with LIT_USE_INTERNAL_SHELL=1 on Linux.


Full diff: https://github.com/llvm/llvm-project/pull/94595.diff

6 Files Affected:

  • (modified) llvm/test/DebugInfo/symbolize-gnu-debuglink-no-realpath.test (-1)
  • (modified) llvm/test/Other/can-execute.txt (-1)
  • (modified) llvm/test/Other/lit-unicode.txt (-1)
  • (modified) llvm/test/tools/llvm-cov/gcov/intermediate-format.test (-1)
  • (modified) llvm/test/tools/llvm-rc/windres-prefix.test (-1)
  • (modified) llvm/test/tools/split-file/output-is-special.test (-1)
diff --git a/llvm/test/DebugInfo/symbolize-gnu-debuglink-no-realpath.test b/llvm/test/DebugInfo/symbolize-gnu-debuglink-no-realpath.test
index 5141ff6ce322c..9e46570783c93 100644
--- a/llvm/test/DebugInfo/symbolize-gnu-debuglink-no-realpath.test
+++ b/llvm/test/DebugInfo/symbolize-gnu-debuglink-no-realpath.test
@@ -1,4 +1,3 @@
-# REQUIRES: shell
 # Ensure that no realpath assumptions are made about .gnu_debuglink paths.
 
 # Copy inputs to some other location with arbitrary names, with the original
diff --git a/llvm/test/Other/can-execute.txt b/llvm/test/Other/can-execute.txt
index 46791cb892a28..37626e7357b28 100644
--- a/llvm/test/Other/can-execute.txt
+++ b/llvm/test/Other/can-execute.txt
@@ -1,5 +1,4 @@
 REQUIRES: can-execute
-REQUIRES: shell
 
 This tests that we abstract two peculiarities of unix in can_execute:
 
diff --git a/llvm/test/Other/lit-unicode.txt b/llvm/test/Other/lit-unicode.txt
index 2f40001451688..b375fc505b737 100644
--- a/llvm/test/Other/lit-unicode.txt
+++ b/llvm/test/Other/lit-unicode.txt
@@ -1,5 +1,4 @@
 FIXME: See if we can fix this in lit by using Unicode strings.
-REQUIRES: shell
 
 RUN: echo "ようこそ" | FileCheck %s
 CHECK: {{^}}ようこそ{{$}}
diff --git a/llvm/test/tools/llvm-cov/gcov/intermediate-format.test b/llvm/test/tools/llvm-cov/gcov/intermediate-format.test
index 583e670c2d3fa..89d52af111c2e 100644
--- a/llvm/test/tools/llvm-cov/gcov/intermediate-format.test
+++ b/llvm/test/tools/llvm-cov/gcov/intermediate-format.test
@@ -1,4 +1,3 @@
-REQUIRES: shell
 
 RUN: rm -rf %t && mkdir %t && cd %t
 RUN: cp %S/Inputs/test.gcno %S/Inputs/test.gcda .
diff --git a/llvm/test/tools/llvm-rc/windres-prefix.test b/llvm/test/tools/llvm-rc/windres-prefix.test
index 4c53fdfc3db65..fb26e645d3a01 100644
--- a/llvm/test/tools/llvm-rc/windres-prefix.test
+++ b/llvm/test/tools/llvm-rc/windres-prefix.test
@@ -1,4 +1,3 @@
-; REQUIRES: shell
 
 ; RUN: rm -rf %t && mkdir %t
 
diff --git a/llvm/test/tools/split-file/output-is-special.test b/llvm/test/tools/split-file/output-is-special.test
index 98bb4d36a4ff3..0b1e0f786c4d2 100644
--- a/llvm/test/tools/split-file/output-is-special.test
+++ b/llvm/test/tools/split-file/output-is-special.test
@@ -1,5 +1,4 @@
 # UNSUPPORTED: system-windows
-# REQUIRES: shell
 
 ## Don't delete the output if it is special, otherwise root may accidentally
 ## remove important special files.

@@ -1,4 +1,3 @@
REQUIRES: shell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If REQIRES: shell is the first line, delete the blank line after it as well.

@@ -1,4 +1,3 @@
; REQUIRES: shell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If REQIRES: shell is the first line, delete the blank line after it as well.

@jayfoad jayfoad merged commit 878deae into llvm:main Jun 6, 2024
5 of 6 checks passed
@jayfoad jayfoad deleted the no-shell branch June 6, 2024 19:50
@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 11, 2024

Hi @zmodem, I have just noticed that you have reverted some of these changes because of gnuwin32 failures. What did the failures look like? Is there a bot I can look at? I'd prefer to find a more precise way to disable them than REQUIRES: shell because these tests clearly do not require an external shell (at least not on all platforms).

@zmodem
Copy link
Collaborator

zmodem commented Jun 11, 2024

The ones with ln are pretty simple :-)

'ln': command not found

Other/lit-unicode.txt is less straight-forward:

UnicodeEncodeError: 'charmap' codec can't encode characters in position 6-9: character maps to <undefined>

I assumed that's some gnuwin32 thing having poor unicode support.

Both of these can be seen here https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8745531620523249025/+/u/package_clang/stdout

@pogo59
Copy link
Collaborator

pogo59 commented Jun 11, 2024

Yeah I think ln qualifies as deserving a REQUIRES: shell ?

For the unicode thing, seems sketchy to expect it to work on Windows. I cut the file down to just the echo command and tried to run it on my box, and got junk out.

@petrhosek
Copy link
Member

ln should be invoked by the internal shell as an external command, the error suggests that the internal shell may have an issue with resolving the right tool.

@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 12, 2024

Yeah I think ln qualifies as deserving a REQUIRES: shell ?

I don't think so. REQUIRES: shell means the RUN lines need to be run using bash instead of lit's internal shell, but (as @petrhosek said) the internal shell can still run external commands like /usr/bin/ln.

I think UNSUPPORTED: system-windows is probably more appropriate on the grounds that Windows doesn't have Unix-like symlinks.

For the unicode thing, seems sketchy to expect it to work on Windows. I cut the file down to just the echo command and tried to run it on my box, and got junk out.

This sounds similar to the printf problems that were worked around in #83907, and again the solution was UNSUPPORTED: system-windows.

jayfoad added a commit to jayfoad/llvm-project that referenced this pull request Jun 12, 2024
These tests do not require bash. Skip them because they use features not
available on Windows. This is a follow up to llvm#94595.
@pogo59
Copy link
Collaborator

pogo59 commented Jun 12, 2024

Works for me, I was not aware the internal shell could call out to things like ln.

jayfoad added a commit that referenced this pull request Jun 12, 2024
These tests do not require bash. Skip them because they use features not
available on Windows. This is a follow up to #94595.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants