From 34619c778f77c3c885c46e13c37880bc15836280 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 12 Aug 2026 06:13:21 +0200 Subject: [PATCH] fix: publish target aliases and refuse an unknown one The pack builder accepts the aliases declared in the target overrides, so --target switch works there, but the installer's target manifests carried only canonical names. The documented word was the one that failed, and the installer then carried on with every file: 1911 files and 4.1 GB where the user had asked for the 863 that target needs. Aliases are emitted beside their canonical target, and an unknown target now stops the run and lists what is available. A filter is applied or refused, never ignored. --- install.ps1 | 2 +- install.py | 17 +- install.sh | 2 +- install/targets/retroarch.json | 1315 ++++++++++++++++++++++++++++++++ scripts/generate_pack.py | 28 + tests/test_install.py | 45 ++ 6 files changed, 1406 insertions(+), 3 deletions(-) diff --git a/install.ps1 b/install.ps1 index b3daa3d2..7f60ad69 100644 --- a/install.ps1 +++ b/install.ps1 @@ -8,7 +8,7 @@ param( $ErrorActionPreference = "Stop" $defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" -$defaultInstallSha256 = "b83e7422b8516d666017964cf18fc9ef8c4f8bbdb6a594ed9da0c04158eff870" +$defaultInstallSha256 = "1e06e5d364d93beff2f9b98f7bf81b4eca4b6364a6a99c87e8fcc9a472c70764" $maximumInstallerBytes = 2MB $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } $temporary = $null diff --git a/install.py b/install.py index ce19f83f..e6ed0c09 100644 --- a/install.py +++ b/install.py @@ -1336,7 +1336,22 @@ def main() -> None: targets = fetch_targets(plat_name) target_info = targets.get(args.target) if target_info is None: - print(f" Warning: target '{args.target}' not found for {plat_name}") + # Carrying on would install every file, which is the opposite + # of what a filter was asked for: a 4 GB download instead of + # the subset the target needs. Refuse rather than ignore. + print( + f"Error: unknown target '{args.target}' for {plat_name}.", + file=sys.stderr, + ) + if targets: + print( + f" available: {', '.join(sorted(targets))}", file=sys.stderr + ) + else: + print( + f" {plat_name} publishes no target list", file=sys.stderr + ) + sys.exit(1) elif target_info.get("cores") is None: print( f" Target '{args.target}' publishes no core list; " diff --git a/install.sh b/install.sh index b8fd37cf..d478268d 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ esac TEMP_INSTALLER="" TEMP_DIRECTORY="" DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" -DEFAULT_INSTALL_SHA256="b83e7422b8516d666017964cf18fc9ef8c4f8bbdb6a594ed9da0c04158eff870" +DEFAULT_INSTALL_SHA256="1e06e5d364d93beff2f9b98f7bf81b4eca4b6364a6a99c87e8fcc9a472c70764" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/targets/retroarch.json b/install/targets/retroarch.json index 2e1ecb14..00106cee 100644 --- a/install/targets/retroarch.json +++ b/install/targets/retroarch.json @@ -830,6 +830,227 @@ "yabause", "ymir" ], + "desktop": [ + "2048", + "3dengine", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "applewin", + "ardens", + "arduous", + "atari800", + "azahar", + "b2", + "bbkemu", + "bk", + "blastem", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes-jg", + "bsnes2014_accuracy", + "bsnes2014_balanced", + "bsnes2014_performance", + "bsnes_cplusplus98", + "bsnes_hd_beta", + "bsnes_mercury_accuracy", + "bsnes_mercury_balanced", + "bsnes_mercury_performance", + "cannonball", + "cap32", + "cdi2015", + "chailove", + "citra", + "citra2018", + "clownmdemu", + "craft", + "crocods", + "desmume", + "desmume2015", + "dice", + "dinothawr", + "dirksimple", + "dolphin", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "doukutsu_rs", + "easyrpg", + "ecwolf", + "ep128emu_core", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_cps3", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "fixgb", + "fixnes", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "galaksija", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "geolith", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "hatari", + "hbmame", + "holani", + "irogb", + "jaxe", + "jollycv", + "jumpnbump", + "kronos", + "lowresnx", + "lutro", + "m2000", + "mame", + "mame2000", + "mame2003", + "mame2003_midway", + "mame2003_plus", + "mame2010", + "mcsoftserve", + "mednafen_gba", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_psx", + "mednafen_psx_hw", + "mednafen_saturn", + "mednafen_snes", + "mednafen_supafaust", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "melondsds", + "mesen", + "mesen-s", + "meteor", + "mgba", + "minivmac", + "mojozork", + "mrboom", + "mu", + "mupen64plus_next", + "native32emu", + "nekop2", + "neocd", + "nestopia", + "noods", + "np2kai", + "nuance", + "numero", + "nxengine", + "o2em", + "oberon", + "openlara", + "opera", + "panda3ds", + "parallel_n64", + "pcee2", + "pcsx2", + "pcsx_rearmed", + "pd777", + "picodrive", + "play", + "pocketcdg", + "pokemini", + "pokketstation", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "qemu", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "romcleaner", + "rustynes", + "same_cdi", + "sameboy", + "sameduck", + "scummvm", + "skyemu", + "smsplus", + "snes9x", + "snes9x2002", + "snes9x2005", + "snes9x2005_plus", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "swanstation", + "tamalibretro", + "tgbdual", + "theodore", + "thepowdertoy", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vemulator", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "virtualxt", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabasanshiro", + "yabause", + "ymir" + ], "ios-arm64": [ "2048", "81", @@ -1028,6 +1249,227 @@ "yabause", "ymir" ], + "linux": [ + "2048", + "3dengine", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "applewin", + "ardens", + "arduous", + "atari800", + "azahar", + "b2", + "bbkemu", + "bk", + "blastem", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes-jg", + "bsnes2014_accuracy", + "bsnes2014_balanced", + "bsnes2014_performance", + "bsnes_cplusplus98", + "bsnes_hd_beta", + "bsnes_mercury_accuracy", + "bsnes_mercury_balanced", + "bsnes_mercury_performance", + "cannonball", + "cap32", + "cdi2015", + "chailove", + "citra", + "citra2018", + "clownmdemu", + "craft", + "crocods", + "desmume", + "desmume2015", + "dice", + "dinothawr", + "dirksimple", + "dolphin", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "doukutsu_rs", + "easyrpg", + "ecwolf", + "ep128emu_core", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_cps3", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "fixgb", + "fixnes", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "galaksija", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "geolith", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "hatari", + "hbmame", + "holani", + "irogb", + "jaxe", + "jollycv", + "jumpnbump", + "kronos", + "lowresnx", + "lutro", + "m2000", + "mame", + "mame2000", + "mame2003", + "mame2003_midway", + "mame2003_plus", + "mame2010", + "mcsoftserve", + "mednafen_gba", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_psx", + "mednafen_psx_hw", + "mednafen_saturn", + "mednafen_snes", + "mednafen_supafaust", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "melondsds", + "mesen", + "mesen-s", + "meteor", + "mgba", + "minivmac", + "mojozork", + "mrboom", + "mu", + "mupen64plus_next", + "native32emu", + "nekop2", + "neocd", + "nestopia", + "noods", + "np2kai", + "nuance", + "numero", + "nxengine", + "o2em", + "oberon", + "openlara", + "opera", + "panda3ds", + "parallel_n64", + "pcee2", + "pcsx2", + "pcsx_rearmed", + "pd777", + "picodrive", + "play", + "pocketcdg", + "pokemini", + "pokketstation", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "qemu", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "romcleaner", + "rustynes", + "same_cdi", + "sameboy", + "sameduck", + "scummvm", + "skyemu", + "smsplus", + "snes9x", + "snes9x2002", + "snes9x2005", + "snes9x2005_plus", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "swanstation", + "tamalibretro", + "tgbdual", + "theodore", + "thepowdertoy", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vemulator", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "virtualxt", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabasanshiro", + "yabause", + "ymir" + ], "linux-armhf": [ "2048", "81", @@ -2052,6 +2494,154 @@ "x1", "xrick" ], + "nx": [ + "2048", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "ardens", + "arduous", + "atari800", + "bk", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes_hd_beta", + "cannonball", + "cap32", + "chailove", + "clownmdemu", + "crocods", + "desmume", + "dice", + "dinothawr", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "easyrpg", + "ecwolf", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "jaxe", + "jumpnbump", + "lowresnx", + "lutro", + "mame2000", + "mame2003", + "mame2003_plus", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "mesen", + "mesen-s", + "mesens", + "mgba", + "minivmac", + "mrboom", + "mu", + "mupen64plus_next", + "neocd", + "nestopia", + "np2kai", + "numero", + "nxengine", + "o2em", + "opera", + "pcsx_rearmed", + "pd777", + "picodrive", + "pocketcdg", + "pokemini", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "sameboy", + "sameduck", + "scummvm", + "smsplus", + "snes9x", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "tamalibretro", + "tgbdual", + "theodore", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabause" + ], "osx-arm64": [ "2048", "81", @@ -2469,6 +3059,227 @@ "yabause", "ymir" ], + "pc": [ + "2048", + "3dengine", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "applewin", + "ardens", + "arduous", + "atari800", + "azahar", + "b2", + "bbkemu", + "bk", + "blastem", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes-jg", + "bsnes2014_accuracy", + "bsnes2014_balanced", + "bsnes2014_performance", + "bsnes_cplusplus98", + "bsnes_hd_beta", + "bsnes_mercury_accuracy", + "bsnes_mercury_balanced", + "bsnes_mercury_performance", + "cannonball", + "cap32", + "cdi2015", + "chailove", + "citra", + "citra2018", + "clownmdemu", + "craft", + "crocods", + "desmume", + "desmume2015", + "dice", + "dinothawr", + "dirksimple", + "dolphin", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "doukutsu_rs", + "easyrpg", + "ecwolf", + "ep128emu_core", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_cps3", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "fixgb", + "fixnes", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "galaksija", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "geolith", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "hatari", + "hbmame", + "holani", + "irogb", + "jaxe", + "jollycv", + "jumpnbump", + "kronos", + "lowresnx", + "lutro", + "m2000", + "mame", + "mame2000", + "mame2003", + "mame2003_midway", + "mame2003_plus", + "mame2010", + "mcsoftserve", + "mednafen_gba", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_psx", + "mednafen_psx_hw", + "mednafen_saturn", + "mednafen_snes", + "mednafen_supafaust", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "melondsds", + "mesen", + "mesen-s", + "meteor", + "mgba", + "minivmac", + "mojozork", + "mrboom", + "mu", + "mupen64plus_next", + "native32emu", + "nekop2", + "neocd", + "nestopia", + "noods", + "np2kai", + "nuance", + "numero", + "nxengine", + "o2em", + "oberon", + "openlara", + "opera", + "panda3ds", + "parallel_n64", + "pcee2", + "pcsx2", + "pcsx_rearmed", + "pd777", + "picodrive", + "play", + "pocketcdg", + "pokemini", + "pokketstation", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "qemu", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "romcleaner", + "rustynes", + "same_cdi", + "sameboy", + "sameduck", + "scummvm", + "skyemu", + "smsplus", + "snes9x", + "snes9x2002", + "snes9x2005", + "snes9x2005_plus", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "swanstation", + "tamalibretro", + "tgbdual", + "theodore", + "thepowdertoy", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vemulator", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "virtualxt", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabasanshiro", + "yabause", + "ymir" + ], "playstation-ps2": [ "2048", "81", @@ -2705,6 +3516,289 @@ "xrick", "yabause" ], + "ps2": [ + "2048", + "81", + "DoubleCherryGB", + "amiarcadia", + "anarch", + "ardens", + "arduous", + "atari800", + "bk", + "bluemsx", + "dice", + "ecwolf", + "fceumm", + "fmsx", + "freechaf", + "freeintv", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "gearlynx", + "gearsystem", + "gme", + "gong", + "gpsp", + "handy", + "jaxe", + "jumpnbump", + "lowresnx", + "lutro", + "mednafen_lynx", + "mednafen_wswan", + "mgba", + "minivmac", + "mrboom", + "mu", + "neocd", + "numero", + "nxengine", + "o2em", + "pd777", + "picodrive", + "pocketcdg", + "prboom", + "quasi88", + "quicknes", + "race", + "retro8", + "smsplus", + "snes9x2002", + "squirreljme", + "stella2014", + "tamalibretro", + "tgbdual", + "theodore", + "tia", + "uw8", + "uzem", + "vaporspec", + "wasm4", + "x1" + ], + "psp": [ + "2048", + "81", + "DoubleCherryGB", + "amiarcadia", + "anarch", + "ardens", + "arduous", + "atari800", + "bk", + "bluemsx", + "crocods", + "ecwolf", + "fceumm", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "gearlynx", + "gearsystem", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "jaxe", + "jumpnbump", + "lowresnx", + "lutro", + "mame2003", + "mame2003_plus", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_wswan", + "mgba", + "minivmac", + "mrboom", + "mu", + "nestopia", + "np2kai", + "numero", + "nxengine", + "o2em", + "pd777", + "picodrive", + "pocketcdg", + "prboom", + "prosystem", + "quasi88", + "quicknes", + "race", + "retro8", + "smsplus", + "snes9x2005", + "snes9x2005_plus", + "squirreljme", + "tgbdual", + "theodore", + "tia", + "uw8", + "uzem", + "vaporspec", + "wasm4", + "x1" + ], + "switch": [ + "2048", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "ardens", + "arduous", + "atari800", + "bk", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes_hd_beta", + "cannonball", + "cap32", + "chailove", + "clownmdemu", + "crocods", + "desmume", + "dice", + "dinothawr", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "easyrpg", + "ecwolf", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "jaxe", + "jumpnbump", + "lowresnx", + "lutro", + "mame2000", + "mame2003", + "mame2003_plus", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "mesen", + "mesen-s", + "mesens", + "mgba", + "minivmac", + "mrboom", + "mu", + "mupen64plus_next", + "neocd", + "nestopia", + "np2kai", + "numero", + "nxengine", + "o2em", + "opera", + "pcsx_rearmed", + "pd777", + "picodrive", + "pocketcdg", + "pokemini", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "sameboy", + "sameduck", + "scummvm", + "smsplus", + "snes9x", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "tamalibretro", + "tgbdual", + "theodore", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabause" + ], "tvos-arm64": [ "2048", "81", @@ -3313,5 +4407,226 @@ "yabasanshiro", "yabause", "ymir" + ], + "x86_64": [ + "2048", + "3dengine", + "81", + "DoubleCherryGB", + "a5200", + "amiarcadia", + "anarch", + "applewin", + "ardens", + "arduous", + "atari800", + "azahar", + "b2", + "bbkemu", + "bk", + "blastem", + "bluemsx", + "boom3", + "boom3_xp", + "bsnes", + "bsnes-jg", + "bsnes2014_accuracy", + "bsnes2014_balanced", + "bsnes2014_performance", + "bsnes_cplusplus98", + "bsnes_hd_beta", + "bsnes_mercury_accuracy", + "bsnes_mercury_balanced", + "bsnes_mercury_performance", + "cannonball", + "cap32", + "cdi2015", + "chailove", + "citra", + "citra2018", + "clownmdemu", + "craft", + "crocods", + "desmume", + "desmume2015", + "dice", + "dinothawr", + "dirksimple", + "dolphin", + "dosbox_core", + "dosbox_pure", + "dosbox_svn", + "doukutsu_rs", + "easyrpg", + "ecwolf", + "ep128emu_core", + "fbalpha", + "fbalpha2012", + "fbalpha2012_cps1", + "fbalpha2012_cps2", + "fbalpha2012_cps3", + "fbalpha2012_neogeo", + "fbneo", + "fceumm", + "fixgb", + "fixnes", + "flycast", + "fmsx", + "freechaf", + "freeintv", + "frodo", + "fuse", + "galaksija", + "gam4980", + "gambatte", + "gearboy", + "gearcoleco", + "geargrafx", + "gearlynx", + "gearsystem", + "genesis_plus_gx", + "genesis_plus_gx_wide", + "geolith", + "gme", + "gong", + "gpsp", + "gw", + "handy", + "hatari", + "hbmame", + "holani", + "irogb", + "jaxe", + "jollycv", + "jumpnbump", + "kronos", + "lowresnx", + "lutro", + "m2000", + "mame", + "mame2000", + "mame2003", + "mame2003_midway", + "mame2003_plus", + "mame2010", + "mcsoftserve", + "mednafen_gba", + "mednafen_lynx", + "mednafen_ngp", + "mednafen_pce", + "mednafen_pce_fast", + "mednafen_pcfx", + "mednafen_psx", + "mednafen_psx_hw", + "mednafen_saturn", + "mednafen_snes", + "mednafen_supafaust", + "mednafen_supergrafx", + "mednafen_vb", + "mednafen_wswan", + "melonds", + "melondsds", + "mesen", + "mesen-s", + "meteor", + "mgba", + "minivmac", + "mojozork", + "mrboom", + "mu", + "mupen64plus_next", + "native32emu", + "nekop2", + "neocd", + "nestopia", + "noods", + "np2kai", + "nuance", + "numero", + "nxengine", + "o2em", + "oberon", + "openlara", + "opera", + "panda3ds", + "parallel_n64", + "pcee2", + "pcsx2", + "pcsx_rearmed", + "pd777", + "picodrive", + "play", + "pocketcdg", + "pokemini", + "pokketstation", + "potator", + "ppsspp", + "prboom", + "prosystem", + "puae", + "puae2021", + "px68k", + "qemu", + "quasi88", + "quicknes", + "race", + "reminiscence", + "retro8", + "romcleaner", + "rustynes", + "same_cdi", + "sameboy", + "sameduck", + "scummvm", + "skyemu", + "smsplus", + "snes9x", + "snes9x2002", + "snes9x2005", + "snes9x2005_plus", + "snes9x2010", + "squirreljme", + "stella", + "stella2014", + "stella2023", + "superbroswar", + "swanstation", + "tamalibretro", + "tgbdual", + "theodore", + "thepowdertoy", + "tia", + "tic80", + "tyrquake", + "uw8", + "uzem", + "vaporspec", + "vba_next", + "vbam", + "vecx", + "vemulator", + "vice_x128", + "vice_x64", + "vice_x64sc", + "vice_xcbm2", + "vice_xcbm5x0", + "vice_xpet", + "vice_xplus4", + "vice_xscpu64", + "vice_xvic", + "vircon32", + "virtualjaguar", + "virtualxt", + "vitaquake2", + "vitaquake2-rogue", + "vitaquake2-xatrix", + "vitaquake2-zaero", + "vitaquake3", + "wasm4", + "x1", + "xrick", + "yabasanshiro", + "yabause", + "ymir" ] } diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 55c40deb..85f1eb87 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -2798,6 +2798,23 @@ def generate_target_manifests(targets_dir: str, output_dir: str) -> None: targets = data.get("targets", {}) if not isinstance(targets, dict): raise ValueError(f"{yml_file}: targets must be a mapping") + + # The pack builder accepts the aliases declared in _overrides.yml, so + # --target switch works there. Emitting only canonical names left the + # installer rejecting the same word and, worse, carrying on with every + # file instead: the user asked for a filter and got the full pack. + overrides_path = targets_path / "_overrides.yml" + alias_map: dict[str, list[str]] = {} + if overrides_path.is_file(): + with open(overrides_path) as f: + all_overrides = yaml_load(f) or {} + for tname, ovr in ( + all_overrides.get(yml_file.stem, {}).get("targets", {}) or {} + ).items(): + names = [a for a in (ovr or {}).get("aliases", []) if isinstance(a, str)] + if names: + alias_map[tname] = names + result: dict[str, list[str] | None] = {} for target_name, target_info in targets.items(): if not isinstance(target_name, str) or not target_name: @@ -2818,6 +2835,17 @@ def generate_target_manifests(targets_dir: str, output_dir: str) -> None: "non-empty strings" ) result[target_name] = cores + + for target_name, names in alias_map.items(): + if target_name not in result: + continue + for alias in names: + if alias in result: + raise ValueError( + f"{yml_file}: alias {alias!r} collides with a target name" + ) + result[alias] = result[target_name] + out_path = Path(output_dir) / f"{yml_file.stem}.json" with open(out_path, "w") as f: json.dump(result, f, indent=2, sort_keys=True) diff --git a/tests/test_install.py b/tests/test_install.py index b07c9f59..b58d4770 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -556,6 +556,51 @@ class TestStandaloneCopiesExtraDirs(unittest.TestCase): ) +class TargetFlagIsAppliedOrRefused(unittest.TestCase): + """A filter the installer cannot apply must stop it, not be ignored. + + An unknown target used to print a warning and then install every file: + 4 GB where the user asked for a subset. And the aliases the pack builder + accepts -- switch, ps2, psp -- were absent from the published target + manifests, so the documented word was the one that failed. + """ + + def test_the_published_manifests_carry_the_builder_aliases(self): + path = REPO_ROOT / "install" / "targets" / "retroarch.json" + if not path.is_file(): + self.skipTest("no target manifest generated yet") + targets = json.loads(path.read_text()) + self.assertIn("nintendo-switch", targets) + for alias in ("switch", "nx"): + with self.subTest(alias=alias): + self.assertIn(alias, targets, f"builder accepts --target {alias}") + self.assertEqual(targets[alias], targets["nintendo-switch"]) + + def test_every_alias_resolves_to_its_canonical_core_list(self): + import sys as _sys + + _sys.path.insert(0, str(REPO_ROOT / "scripts")) + from common import load_target_config + + for name in ("install/targets/retroarch.json",): + path = REPO_ROOT / name + if not path.is_file(): + continue + targets = json.loads(path.read_text()) + for alias in ("switch", "ps2", "psp"): + if alias not in targets: + continue + with self.subTest(alias=alias): + resolved = load_target_config( + "retroarch", alias, str(REPO_ROOT / "platforms") + ) + self.assertEqual( + sorted(targets[alias] or []), + sorted(resolved), + f"{alias} disagrees with what the builder resolves", + ) + + class TestBaseUrlScheme(unittest.TestCase): """The bootstraps insist on HTTPS; the installer must not be laxer."""