Skip to content

Conversation

mstorsjo
Copy link
Member

Python 3.13 considers "/file/does/not/exist" to not be an absolute path on Windows, so the test runner does os.path.join(cwd, filePath), which can end up with an output path such as "D:/file/does/not/exist".

Accept a potential prefix before the missing path here.

This fixes running the lit tests on Windows with Python 3.13.

@llvmbot
Copy link
Member

llvmbot commented Sep 24, 2025

@llvm/pr-subscribers-testing-tools

Author: Martin Storsjö (mstorsjo)

Changes

Python 3.13 considers "/file/does/not/exist" to not be an absolute path on Windows, so the test runner does os.path.join(cwd, filePath), which can end up with an output path such as "D:/file/does/not/exist".

Accept a potential prefix before the missing path here.

This fixes running the lit tests on Windows with Python 3.13.


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

1 Files Affected:

  • (modified) llvm/utils/lit/tests/shtest-readfile.py (+1-1)
diff --git a/llvm/utils/lit/tests/shtest-readfile.py b/llvm/utils/lit/tests/shtest-readfile.py
index a122dd7664272..f2e4fb0a9e169 100644
--- a/llvm/utils/lit/tests/shtest-readfile.py
+++ b/llvm/utils/lit/tests/shtest-readfile.py
@@ -10,7 +10,7 @@
 
 # CHECK-LABEL: FAIL: shtest-readfile :: file-does-not-exist.txt ({{[^)]*}})
 # CHECK: # executed command: @echo 'echo %{readfile:/file/does/not/exist}'
-# CHECK: # | File specified in readfile substitution does not exist: /file/does/not/exist
+# CHECK: # | File specified in readfile substitution does not exist: {{.*}}/file/does/not/exist
 
 # CHECK-LABEL: FAIL: shtest-readfile :: relative-paths.txt ({{[^)]*}})
 # CHECK: echo hello

Python 3.13 considers "/file/does/not/exist" to not be an absolute
path on Windows, so the test runner does os.path.join(cwd, filePath),
which can end up with an output path such as "D:/file/does/not/exist".

Accept a potential prefix before the missing path here.

This fixes running the lit tests on Windows with Python 3.13.
@mstorsjo mstorsjo force-pushed the lit-test-win-python3.13 branch from 8aebb71 to 1a76bca Compare September 24, 2025 12:25
@mstorsjo mstorsjo merged commit 6e904e8 into llvm:main Sep 24, 2025
9 checks passed
@mstorsjo mstorsjo deleted the lit-test-win-python3.13 branch September 24, 2025 19:01
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…lvm#160503)

Python 3.13 considers "/file/does/not/exist" to not be an absolute path
on Windows, so the test runner does os.path.join(cwd, filePath), which
can end up with an output path such as "D:/file/does/not/exist".

Accept a potential prefix before the missing path here.

This fixes running the lit tests on Windows with Python 3.13.
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.

3 participants