From e10c14935a6ce51ca6fde7072cbff56f9f5d367f Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:37:38 +0100 Subject: [PATCH] docs: say install.py is built from installer/ The installer page, the tool list, the testing guide and the architecture tree name the package, the build script and its check. --- wiki/architecture.md | 4 +++- wiki/installer.md | 8 ++++++++ wiki/testing-guide.md | 5 +++-- wiki/tools.md | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wiki/architecture.md b/wiki/architecture.md index 977f0c01a..90b64bba2 100644 --- a/wiki/architecture.md +++ b/wiki/architecture.md @@ -40,7 +40,9 @@ scripts/ all tooling (Python and pyyaml, jsonschema for schema c exporter/ native format exporters (batocera, recalbox, emudeck...) install/ JSON install manifests per platform targets/ JSON target manifests per platform (cores per architecture) -install.py the installer, with install.sh and install.ps1 to start it +install.py the installer, with install.sh and install.ps1 to start it, + built from installer/ by scripts/build_installer.py +installer/ the installer's source, one module per concern ports/ launchers that run the installer on handhelds automation/ jobs.yml, the unattended jobs scripts/autorun.py runs data/ cached data directories (not BIOS, fetched at build) diff --git a/wiki/installer.md b/wiki/installer.md index 994b37c60..c90d814ad 100644 --- a/wiki/installer.md +++ b/wiki/installer.md @@ -2121,6 +2121,14 @@ Tests refuse any 3.9 syntax or API, and one runs the installer end to end under a real 3.8 interpreter, which CI installs beside 3.12 so the check cannot skip. The build scripts need 3.9 and are not bound by this. +`install.py` is generated: its source is the `installer/` package, one module +per concern (detection, file lists, downloads, the full screen), each importing +from the others what it uses, so ruff and mypy read every module on its own. +Edit the modules, then run `python scripts/build_installer.py`. It joins them +into `install.py` in import order and refuses an import from outside the +standard library, a name two modules define and an import cycle. CI runs it +with `--check`, which fails when `install.py` is not the file the package builds. + Every change to `install.py` recomputes the SHA-256 pinned in `install.sh` and `install.ps1` in the same commit: `python scripts/pin_installer.py` writes both (`--check` writes nothing and exits 1 on a stale pin). It also runs diff --git a/wiki/testing-guide.md b/wiki/testing-guide.md index 76d1f3381..04d4a5cfc 100644 --- a/wiki/testing-guide.md +++ b/wiki/testing-guide.md @@ -67,7 +67,7 @@ Every module in `tests/`, by the area it guards. | Packs and manifests | synthetic + real packs | `test_artifact_lock`, `test_atomic_artifacts`, `test_batocera_cores`, `test_core_data_trees`, `test_deterministic_zip`, `test_emulator_pack_counts`, `test_finalize_pack_names`, `test_large_file_cache`, `test_libretro_layout`, `test_manifest_entry`, `test_minui_platform`, `test_no_game_data`, `test_pack_conformance_dirs`, `test_pack_core_extras`, `test_pack_counts`, `test_pack_destinations`, `test_pack_failures`, `test_pack_file_names`, `test_pack_grouping`, `test_pack_integrity`, `test_pack_member_identity`, `test_pack_readme`, `test_platform_inheritance`, `test_platform_keys`, `test_release_packs`, `test_required_only_archives`, `test_required_only_twins`, `test_save_root`, `test_split_extras`, `test_split_names`, `test_split_pack`, `test_system_pack_extras`, `test_system_pack_parity`, `test_torrentzip`, `test_which_pack` | | Slots and regions | synthetic + profiles | `test_region`, `test_region_agnostic_scan`, `test_region_groups`, `test_region_held`, `test_region_platform_index`, `test_region_required_only`, `test_slot`, `test_slots`, `test_slots_shipped_file` | | Hardware targets and systems | synthetic + target files | `test_amberelec_targets`, `test_emuelec_targets`, `test_extract_targets`, `test_lakka_targets`, `test_libretro_slugs`, `test_system_ids`, `test_system_selection`, `test_target_names`, `test_target_scrapers`, `test_target_systems`, `test_target_verify` | -| Installer and downloads | loopback server | `test_check_release`, `test_download`, `test_install`, `test_install_cores`, `test_install_experience`, `test_install_expert`, `test_install_filesystems`, `test_install_app`, `test_install_from`, `test_install_games`, `test_install_journeys`, `test_install_offline`, `test_install_pack`, `test_install_removal`, `test_install_selection`, `test_install_tui`, `test_pypi_package` | +| Installer and downloads | loopback server | `test_build_installer`, `test_check_release`, `test_download`, `test_install`, `test_install_cores`, `test_install_experience`, `test_install_expert`, `test_install_filesystems`, `test_install_app`, `test_install_from`, `test_install_games`, `test_install_journeys`, `test_install_offline`, `test_install_pack`, `test_install_removal`, `test_install_selection`, `test_install_tui`, `test_pypi_package` | | Handheld launchers | a pty as the console, fake installer and firmware tools, stubbed PortMaster dialogs | `test_handheld_launchers`, `test_port`, `test_site_handheld` | | Running cores | parsers on fixed inputs, a libretro core built from C in the test when a compiler exists | `test_core_probe` | | Measurement records | synthetic record files, the committed `measurements/` against HEAD, the **Proof** line naming the BIOS a core ran, and that no page shows a Tested block, a region outcome or a time per frame | `test_measurements` | @@ -529,7 +529,8 @@ wired to pull requests alone would guard the road nobody takes. The test job with BIOS validation and auto-labeling too. Those two read pull request context and stay behind an event guard. -The schema job also runs mypy over `install.py` and `scripts/`. The code +The schema job also runs mypy over `install.py`, its `installer/` source and +`scripts/`, and `scripts/build_installer.py --check`. The code carried 993 type errors when the check started. They sat in a baseline until the last one was fixed, and the baseline is gone: the code carries no type error and any new one fails. diff --git a/wiki/tools.md b/wiki/tools.md index 8f92dc113..d4a0edce2 100644 --- a/wiki/tools.md +++ b/wiki/tools.md @@ -1359,6 +1359,7 @@ before a release (wiki/release-process.md). Its lines stay in | `validate_pr.py` | Validate BIOS files in pull requests, post markdown report | | `pr_checks.py` | Run the checks `validate.yml` runs on a pull request, in its order, past a failure as CI does, and name each check that failed or whose tool is absent (`--list` prints them) | | `validate_schemas.py` | Validate the data contracts: schemas and semantic invariants. `--source-only` checks `emulators/` and `platforms/` alone, which is what PR validation runs | +| `build_installer.py` | Join the modules of `installer/` into `install.py`, in import order, with one block of standard library imports. Refuses an import from outside the standard library, a name two modules define, an import cycle and a statement that reads at import time a name from a later module (`--check` writes nothing and exits 1 when `install.py` differs) | | `generate_event_schema.py` | Write `schemas/install-events.schema.json` from `EVENT_KEYS` in `install.py` (`--check` exits 1 when the file is stale, which `validate_schemas.py` also reports) | | `generate_installer_doc.py` | Rewrite the generated blocks of `wiki/installer.md` from `install.py`: the tables (options, events, exit codes, keys per route, card markers), the line menu, and the run samples `install.py` prints in a sandbox against the committed `install/*.json`, so a new list rewrites the page (`--check` exits 1 when a block is stale, `--page FILE` writes another copy of the page). Pipeline step 7 | | `pin_installer.py` | Write the SHA-256 of `install.py` into the pins of `install.sh` and `install.ps1`, which refuse any other installer (`--check` writes nothing and exits 1 when a pin is stale). `check_freshness.py` reports a stale pin and `refresh_stale.py` runs this |