Skip to content

Commit 2784e40

Browse files
committed
Show bash and other WSL-relevant info but not PATH
Only on native Windows systems (since this is for debugging WSL). The Windows CI runners have WSL itself installed but no WSL systems installed. So some of these commands may fail if they call the bash.exe in the System32 directory, but this should still be illuminating. Results after a WSL system is set up will likely be more important, but doing this first allows for comparison. The reason PATH directories are no longer listed is to decrease noise.
1 parent ad07ecb commit 2784e40

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Diff for: .github/workflows/cygwin-test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
python -c 'import sys; print(sys.platform)'
7474
python -c 'import os; print(os.name)'
7575
python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly.
76-
printenv PATH | tr ':' '\n'
7776
7877
- name: Test with pytest
7978
run: |

Diff for: .github/workflows/pythonpackage.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,27 @@ jobs:
6565
python -c 'import sys; print(sys.platform)'
6666
python -c 'import os; print(os.name)'
6767
python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly.
68-
printenv PATH | tr ':' '\n'
68+
69+
# For debugging hook tests on native Windows systems that may have WSL.
70+
- name: Show where bash.exe may be found
71+
if: startsWith(matrix.os, 'windows')
72+
run: |
73+
set +e
74+
type -a bash.exe
75+
python -c 'import shutil; print(shutil.which("bash.exe"))'
76+
bash.exe --version
77+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "--version"]); print(f"result: {p!r}")'
78+
bash.exe -c 'echo "$BASH"'
79+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH" """]); print(f"result: {p!r}")'
80+
bash.exe -c 'echo "$BASH_VERSION"'
81+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH_VERSION" """]); print(f"result: {p!r}")'
82+
bash.exe -c 'printenv WSL_DISTRO_NAME'
83+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "printenv WSL_DISTRO_NAME"]); print(f"result: {p!r}")'
84+
bash.exe -c 'ls -l /proc/sys/fs/binfmt_misc/WSLInterop'
85+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "ls -l /proc/sys/fs/binfmt_misc/WSLInterop"]); print(f"result: {p!r}")'
86+
bash.exe -c 'uname -a'
87+
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "uname -a"]); print(f"result: {p!r}")'
88+
continue-on-error: true
6989

7090
- name: Check types with mypy
7191
run: |

0 commit comments

Comments
 (0)