nodejs/node · error · Exception
Unimplemented platform: {platform.system()}
Error message
Unimplemented platform: {platform.system()} What it means
setup-reclient.py's DetectShell() identifies the parent shell to wire up reclient (the remote execution client wrapper). It only knows how to resolve the shell on Linux (via /proc/<pid>/exe readlink) and macOS (via lsof). On any other platform.system() return value (e.g. 'Windows', 'AIX', 'FreeBSD') it raises a bare Exception with no recovery path, halting the reclient bootstrap.
Source
Thrown at deps/v8/tools/dev/setup-reclient.py:49
MachineType.GOOGLE_LAPTOP: "Google Laptop",
}
def DetectShell():
# We could just read the SHELL environment variable, but that can be
# inaccurate when users use multiple shells. So instead, detect the
# shell that this script was called from.
pid = subprocess.check_output(f"ps -p {os.getpid()} -o ppid=", shell=True)
pid = pid.decode("utf-8").strip()
if platform.system() == "Linux":
shell = subprocess.check_output(["readlink", "-f", f"/proc/{pid}/exe"])
return shell.decode("utf-8").strip()
elif platform.system() == "Darwin":
shell = subprocess.check_output(
f"lsof -p {pid} | grep txt | head -1", shell=True)
return shell.decode("utf-8").strip().split(" ")[-1]
else:
raise Exception(f"Unimplemented platform: {platform.system()}")
SHELL = DetectShell()
def InstallGCloudPublic():
existing = subprocess.call("which gcloud", shell=True)
if existing == 0:
print("GCloud is already installed, great.")
return False
print("Downloading and running GCloud installer. "
"Please let it add the CLI tools to your PATH when prompted.")
subprocess.check_call(
"curl -o gcloud-install.sh https://sdk.cloud.google.com", shell=True)
subprocess.check_call("bash gcloud-install.sh", shell=True)
subprocess.check_call("rm gcloud-install.sh", shell=True)
return True
View on GitHub (pinned to 1b2de5e052)
Solutions
- Run the script under WSL2 or a Linux container if you are on Windows; DetectShell only supports Linux and Darwin.
- If you must run natively on an unsupported OS, extend DetectShell() with a branch for platform.system() == 'Windows' (e.g. resolve the shell via the %COMSPEC% env var) before the else clause.
- Verify platform.system() returns what you expect (`python3 -c "import platform; print(platform.system())"`) to rule out an odd environment.
Example fix
// before
else:
raise Exception(f"Unimplemented platform: {platform.system()}")
// after
elif platform.system() == "Windows":
return os.environ.get("COMSPEC", "cmd.exe")
else:
raise Exception(f"Unimplemented platform: {platform.system()}") Defensive patterns
Strategy: validation
Validate before calling
import platform, sys
_supported = {'Linux', 'Darwin'}
if platform.system() not in _supported:
sys.exit(f"setup-reclient needs Linux or Darwin; this host reports {platform.system()!r}. Use WSL or extend DetectShell().") Type guard
null
Try / catch
null
Prevention
- Standardize reclient bootstrap on a Linux/Darwin environment (WSL2 on Windows).
- Pin the V8 tooling revision so DetectShell behavior doesn't change unexpectedly.
- Add a CI matrix step asserting platform.system() is in the supported set before invoking setup-reclient.
When it happens
Trigger: Running `v8/tools/dev/setup-reclient.py` (or any script that imports and calls DetectShell()) on Windows or another non-Linux/non-Darwin OS. The function calls subprocess.check_output for platform-specific shell detection and falls into the unconditional `else: raise` branch.
Common situations: A developer on Windows attempts to set up reclient for V8 builds; running under WSL is fine (Linux) but native Windows fails. Also triggered in CI images that report an unexpected platform string, or when platform.system() is mocked/stubbed during testing.
Related errors
- unrecognized platform string "%s"
- --v8-enable-hugepage is supported only on linux.
- Unsupported libffi target {os_name}/{target_arch}.
- Unsupported host platform {sys.platform!r}
- Unable to locate armasm64.exe
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/0d22c64825cb4fc8.
Report an issue: GitHub.