test_pr_ready: the launcher fallback test runs the bash on PATH, not WSL's

On Windows, subprocess.run(["bash", ...]) goes through CreateProcess, which
looks in System32 before PATH: with WSL installed it starts WSL's bash,
which fails (execvpe(/bin/bash)), and the test errored three times on any
Windows checkout. It now runs the bash on PATH (Git Bash), and skips only
when there is none, or only WSL's (#5383).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Evrim CicekandClaude Opus 5.5 committed 2026-11-02 14:47:29 +03:00
1 parent 8a45d7f9f2
commit 7840fe3549
1 file changed
+8 -1
+8 -1
View File
@@ -2,6 +2,7 @@ import argparse
import datetime
import json
import os
import shutil
import subprocess
import tempfile
import unittest
@@ -15,6 +16,11 @@ LIBRARIES = set(PACKAGES) - {"xtask"}
DEPENDENCIES = {"horizon-client": {"horizon-core"}}
MODS = ""
CLIPPY = pr_ready.CI_CLIPPY + " && " + pr_ready.CI_CLIPPY_SERVER
# The bash on PATH: Windows' CreateProcess looks in System32 before PATH, so a bare "bash" there is WSL's
# (#5383), which has none of the host's paths. Git Bash on PATH runs the launcher's snippets as on Linux.
BASH = shutil.which("bash")
POSIX_BASH = BASH is not None and not (
os.name == "nt" and os.path.dirname(os.path.normcase(BASH)).endswith(os.path.normcase(r"\system32")))
def args(host="local", quick=False):
@@ -110,6 +116,7 @@ class PrReadyTests(unittest.TestCase):
self.assertEqual(step.command, "cargo test --locked -p xtask mod_api")
self.assertEqual(step.skip, "native hooks untouched" if path == "README.md" else None)
@unittest.skipUnless(POSIX_BASH, "needs a bash that is not WSL's")
def test_the_launcher_fallback_asks_for_a_feature_the_launcher_has(self):
"""The macOS fallback must name gpui_platform/runtime_shaders: gpui_platform is launcher/Cargo.toml's
rename of gpui-fast-platform, whose runtime_shaders reaches gpui_macos; the gpui rename (gpui-fast)
@@ -139,7 +146,7 @@ class PrReadyTests(unittest.TestCase):
file.write(script)
os.chmod(path, 0o755)
env = dict(os.environ, PATH=fake_bin + os.pathsep + os.environ["PATH"])
return subprocess.run(["bash", "-c", command], capture_output=True, text=True,
return subprocess.run([BASH, "-c", command], capture_output=True, text=True,
cwd=pr_ready.ROOT, env=env, check=True).stdout.splitlines()
def test_python_tests_always_run(self):