Results of find_program('some-script") should be consistent, irrespective of value of PATHEXT
Open
Nobody has claimed this yet.
needs-info
OS:windows
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
test_find_program() (a windows-only test) fails if .py isn't in PATHEXT
C:\meson>py run_unittests.py WindowsTests.test_find_program
F
Stdout:
Program cmd found: YES (C:\WINDOWS\system32\cmd.EXE)
Program cmd.exe found: YES (C:\WINDOWS\system32\cmd.exe)
Program C:\WINDOWS\system32\cmd found: YES (C:\WINDOWS\system32\cmd.exe)
Program C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script found: YES (python C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script)
Program C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script-ext.py found: YES (C:\Users\jon\AppData\Local\Programs\Python\Python36\python.exe C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script-ext.py)
Program test-script-ext found: NO
======================================================================
FAIL: test_find_program (__main__.WindowsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 3041, in test_find_program
self.assertTrue(prog.found(), msg='test-script-ext not found in PATH')
AssertionError: False is not true : test-script-ext not found in PATH
Stdout:
Program cmd found: YES (C:\WINDOWS\system32\cmd.EXE)
Program cmd.exe found: YES (C:\WINDOWS\system32\cmd.exe)
Program C:\WINDOWS\system32\cmd found: YES (C:\WINDOWS\system32\cmd.exe)
Program C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script found: YES (python C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script)
Program C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script-ext.py found: YES (C:\Users\jon\AppData\Local\Programs\Python\Python36\python.exe C:\cygwin64\wip\meson\test cases/windows\8 find program\test-script-ext.py)
Program test-script-ext found: NO
----------------------------------------------------------------------
Ran 1 test in 0.059s
FAILED (failures=1)
C:\meson>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
C:\meson>set PATHEXT=%PATHEXT%;.py
C:\meson>py run_unittests.py WindowsTests.test_find_program
.
----------------------------------------------------------------------
Ran 1 test in 0.025s
OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with run_unittests.py and WindowsTests.test_find_program, then reproduce the failure with and without .py in PATHEXT. Check the find_program behavior for test-script-ext and its explicit .py variant; done means the test passes consistently regardless of PATHEXT.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100