fix: find RetroArch-Win64 from WSL too

This commit is contained in:
Abdessamad Derraz committed 2026-11-03 10:12:38 +01:00
1 parent e9ef630b3a
commit b23b8f0a62
4 files changed
+21 -6

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
# and Invoke-WebRequest throws on a cut transfer before the hash is read:
# the site's build rewrites this line there (scripts/sitebootstrap.py).
$mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that."
$defaultInstallSha256 = "403b6e8a7efcd24858b0f46ffa19c2b9012cdeef149768729d8e48d0b68a296a"
$defaultInstallSha256 = "87d93c52753fedb9739816c628ba9109f92f6c5cc0aa6e1c5c3c3d2252244666"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+4 -4
View File
@@ -55,9 +55,9 @@ from collections.abc import Callable, Collection, Iterable, Iterator, Mapping
from pathlib import Path, PurePosixPath
from typing import Any, BinaryIO, ContextManager, NamedTuple, TextIO
# Manifests are read from the same ref the bootstrap verified this installer
# against, so a file list and the code reading it always come from one commit.
# RETROBIOS_REF pins an installation to a tag when reproducibility matters.
# File lists are read from main, the newest ones, whichever commit the
# installer came from. RETROBIOS_REF pins them to a tag or a commit when
# reproducibility matters.
DEFAULT_RELEASE_REF = "main"
RELEASE_REF = os.environ.get("RETROBIOS_REF", DEFAULT_RELEASE_REF)
DEFAULT_BASE_URL = (
@@ -2647,7 +2647,7 @@ def detect_platforms(os_type: str) -> list[tuple[str, Path]]:
# default is <exe folder>\system (configuration.c, platform_win32.c).
appdata = os.environ.get("APPDATA", "")
appdata_cfg = Path(appdata) / "RetroArch" / "retroarch.cfg" if appdata else None
exe_dirs = _windows_retroarch_dirs() if os_type == "windows" else []
exe_dirs = _windows_retroarch_dirs()
for exe_dir in exe_dirs:
ra_dir = _parse_retroarch_system_dir(exe_dir / "retroarch.cfg", exe_dir)
if ra_dir is None and appdata_cfg is not None:
+1 -1
View File
@@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins
# curl or wget stop on a cut transfer before the hash is read: the site's
# build rewrites this line there (scripts/sitebootstrap.py).
MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that."
DEFAULT_INSTALL_SHA256="403b6e8a7efcd24858b0f46ffa19c2b9012cdeef149768729d8e48d0b68a296a"
DEFAULT_INSTALL_SHA256="87d93c52753fedb9739816c628ba9109f92f6c5cc0aa6e1c5c3c3d2252244666"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+15
View File
@@ -3658,6 +3658,21 @@ class WindowsSeenFromWsl(unittest.TestCase):
install._detect_by_path("wsl", found)
self.assertIn(("retrobat", self.root / "c" / "RetroBat" / "bios"), found)
def test_retroarch_beside_its_exe_on_the_windows_side_is_detected(self):
"""The installer page said both sides are searched under WSL, and
RetroArch's install folders were looked in on Windows only: a
C:\\RetroArch-Win64 was never found from WSL."""
exe_dir = self.root / "c" / "RetroArch-Win64"
exe_dir.mkdir(parents=True)
(exe_dir / "retroarch.exe").write_bytes(b"MZ")
home = Path(_tempdir(self))
cleared = {name: "" for name in (*install._WINDOWS_VARIABLES, "SCOOP", "SCOOP_GLOBAL",
"ProgramData")}
with unittest.mock.patch.dict(os.environ, {**cleared, "HOME": str(home)}), \
unittest.mock.patch.object(Path, "home", return_value=home):
found = install.detect_platforms("wsl")
self.assertIn(("retroarch", exe_dir / "system"), found)
def test_the_windows_variables_are_read_through_cmd(self):
answers = {"USERPROFILE": "C:\\Users\\me", "APPDATA": "C:\\Users\\me\\AppData\\Roaming"}