Skip to content

Commit

Permalink
Show bash and other WSL-relevant info but not PATH
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EliahKagan committed Nov 24, 2023
1 parent ad07ecb commit 2784e40
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
python -c 'import sys; print(sys.platform)'
python -c 'import os; print(os.name)'
python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly.
printenv PATH | tr ':' '\n'
- name: Test with pytest
run: |
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,27 @@ jobs:
python -c 'import sys; print(sys.platform)'
python -c 'import os; print(os.name)'
python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly.
printenv PATH | tr ':' '\n'
# For debugging hook tests on native Windows systems that may have WSL.
- name: Show where bash.exe may be found
if: startsWith(matrix.os, 'windows')
run: |
set +e
type -a bash.exe
python -c 'import shutil; print(shutil.which("bash.exe"))'
bash.exe --version
python -c 'import subprocess; p = subprocess.run(["bash.exe", "--version"]); print(f"result: {p!r}")'
bash.exe -c 'echo "$BASH"'
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH" """]); print(f"result: {p!r}")'
bash.exe -c 'echo "$BASH_VERSION"'
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH_VERSION" """]); print(f"result: {p!r}")'
bash.exe -c 'printenv WSL_DISTRO_NAME'
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "printenv WSL_DISTRO_NAME"]); print(f"result: {p!r}")'
bash.exe -c 'ls -l /proc/sys/fs/binfmt_misc/WSLInterop'
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "ls -l /proc/sys/fs/binfmt_misc/WSLInterop"]); print(f"result: {p!r}")'
bash.exe -c 'uname -a'
python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "uname -a"]); print(f"result: {p!r}")'
continue-on-error: true

- name: Check types with mypy
run: |
Expand Down

0 comments on commit 2784e40

Please sign in to comment.