startup: show live_view file opens under the run's package root #1273

Merged
MasterDomino merged 2 commits from upstream-pr/1280 into main 2026-11-24 07:03:40 +00:00
MasterDomino commented 2026-11-24 06:34:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T06:34:32Z.


Change

tools/startup/live_view.py showed game-file opens only for G:\ and for one hard-coded local package folder. That folder name was the title's name, which goes against the title-neutral wording rule in CONTRIBUTING.md. It also missed opens from any other -DataDir.

  • debug_launch.py now passes the run's working directory, the package root from run.ps1 -DataDir, to the viewer as a second argument.
  • live_view.py builds the file-open pattern from G:\ and that root. The root is escaped and has a trailing separator, so a sibling folder such as D:\PkgOther does not match D:\Pkg. The root is matched without regard to case.
  • Without the second argument, as when the viewer is started by hand on an old run directory, only G:\ is shown.

Nothing else in the viewer, the launcher or the logs changes.

Verification

Commit: this branch on 05ed719f, Windows 11 26H2 build 26300.9974, Python 3.13.1.

A synthetic run directory with seven files.txt lines (G:\, the root, the root in lower case, a sibling folder, the old hard-coded folder, C:\Windows, and an NtQueryAttributesFile line) plus a finished.txt, so the viewer exits on its own. The file lines it printed:

viewer package root argument file opens shown
main none G:\a.rpf, old hard-coded folder
this branch none G:\a.rpf
this branch D:\Pkg or D:\Pkg\ G:\a.rpf, D:\Pkg\b.rpf (failed 0xc0000034), d:\pkg\d.bin
this branch the old hard-coded folder identical to main
this branch G:\ G:\a.rpf

The sibling folder, C:\Windows and NtQueryAttributesFile lines are never shown. As a negative control, a mutant that drops the trailing separator from the root also shows the sibling folder, D:\PkgOther\e.rpf.

  • python -W error compile of both changed files: OK.
  • python -B tests/docs_links_check.py: 16 files, 285 links OK.
  • python -B tests/bidi_controls_check.py: OK.

I did not run a full startup run, because that needs local title files. No test is registered for the viewer, and the synthetic check above is the only coverage.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No change needed: docs/startup-runtime.md does not document the viewer's arguments.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6576125743 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1280). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-24T06:34:32Z. --- ## Change `tools/startup/live_view.py` showed game-file opens only for `G:\` and for one hard-coded local package folder. That folder name was the title's name, which goes against the title-neutral wording rule in `CONTRIBUTING.md`. It also missed opens from any other `-DataDir`. - `debug_launch.py` now passes the run's working directory, the package root from `run.ps1 -DataDir`, to the viewer as a second argument. - `live_view.py` builds the file-open pattern from `G:\` and that root. The root is escaped and has a trailing separator, so a sibling folder such as `D:\PkgOther` does not match `D:\Pkg`. The root is matched without regard to case. - Without the second argument, as when the viewer is started by hand on an old run directory, only `G:\` is shown. Nothing else in the viewer, the launcher or the logs changes. ## Verification Commit: this branch on `05ed719f`, Windows 11 26H2 build 26300.9974, Python 3.13.1. A synthetic run directory with seven `files.txt` lines (`G:\`, the root, the root in lower case, a sibling folder, the old hard-coded folder, `C:\Windows`, and an `NtQueryAttributesFile` line) plus a `finished.txt`, so the viewer exits on its own. The `file` lines it printed: | viewer | package root argument | file opens shown | |---|---|---| | `main` | none | `G:\a.rpf`, old hard-coded folder | | this branch | none | `G:\a.rpf` | | this branch | `D:\Pkg` or `D:\Pkg\` | `G:\a.rpf`, `D:\Pkg\b.rpf (failed 0xc0000034)`, `d:\pkg\d.bin` | | this branch | the old hard-coded folder | identical to `main` | | this branch | `G:\` | `G:\a.rpf` | The sibling folder, `C:\Windows` and `NtQueryAttributesFile` lines are never shown. As a negative control, a mutant that drops the trailing separator from the root also shows the sibling folder, `D:\PkgOther\e.rpf`. - `python -W error` compile of both changed files: OK. - `python -B tests/docs_links_check.py`: 16 files, 285 links OK. - `python -B tests/bidi_controls_check.py`: OK. I did not run a full startup run, because that needs local title files. No test is registered for the viewer, and the synthetic check above is the only coverage. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. (No change needed: `docs/startup-runtime.md` does not document the viewer's arguments.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
R0Y00 commented 2026-11-24 07:00:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T06:58:52Z.


I added a follow-up for filenames containing spaces. In a synthetic completed run, the viewer printed the full filename under a package root with spaces, kept a failing G: open with its original status, and ignored the sibling package directory. The new head is 8bacaa17.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124488584 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1280#issuecomment-7124488584). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T06:58:52Z. --- I added a follow-up for filenames containing spaces. In a synthetic completed run, the viewer printed the full filename under a package root with spaces, kept a failing G: open with its original status, and ignored the sibling package directory. The new head is `8bacaa17`.
upstream-sync closed this pull request 2026-11-24 07:07:38 +00:00
tedin7 commented 2026-11-24 07:07:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:06:52Z.

Review: COMMENTED


Dual-platform review at commit 8bacaa175017745d7623d6b67278be2b52aa8a06:

Linux checks

  • git diff --check origin/main...HEAD: passed
  • python -B tests/docs_links_check.py: passed (16 Markdown files, 285 links)
  • python -B tests/bidi_controls_check.py: passed (1072 tracked files)
  • python -B -m py_compile tools/startup/debug_launch.py tools/startup/live_view.py: passed
  • Regex check against the game_file pattern: verified case-insensitive matching with spaces under both G:\ and a package root, and non-matching for unrelated paths.

Windows Server 2025

  • Pure Python change (no C++/CMake changes) and tools/startup/live_view.py reads sys.argv[1] at module top level without a standalone self-test, so no Win2025 C++/CTest build was needed.

Notes & Edge Cases

  • Replacing the hardcoded path with cwd passed from tools/startup/debug_launch.py and matching up to (?= from (?:[^+]*\+)?0x[0-9a-fA-F]+ ) cleanly handles package roots and paths containing spaces.
  • Empty sys.argv[2] guard: in tools/startup/live_view.py, if len(sys.argv) > 2 will call os.path.abspath("") if an empty string is passed, which resolves to the viewer's own working directory. Guarding len(sys.argv) > 2 and sys.argv[2] (and cwd in debug_launch.py) avoids unintentionally matching the viewer's CWD.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035039392 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1280#pullrequestreview-6035039392). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T07:06:52Z. **Review:** COMMENTED --- Dual-platform review at commit `8bacaa175017745d7623d6b67278be2b52aa8a06`: ### Linux checks - `git diff --check origin/main...HEAD`: passed - `python -B tests/docs_links_check.py`: passed (16 Markdown files, 285 links) - `python -B tests/bidi_controls_check.py`: passed (1072 tracked files) - `python -B -m py_compile tools/startup/debug_launch.py tools/startup/live_view.py`: passed - Regex check against the `game_file` pattern: verified case-insensitive matching with spaces under both `G:\` and a package root, and non-matching for unrelated paths. ### Windows Server 2025 - Pure Python change (no C++/CMake changes) and `tools/startup/live_view.py` reads `sys.argv[1]` at module top level without a standalone self-test, so no Win2025 C++/CTest build was needed. ### Notes & Edge Cases - Replacing the hardcoded path with `cwd` passed from `tools/startup/debug_launch.py` and matching up to `(?= from (?:[^+]*\+)?0x[0-9a-fA-F]+ )` cleanly handles package roots and paths containing spaces. - **Empty `sys.argv[2]` guard**: in `tools/startup/live_view.py`, `if len(sys.argv) > 2` will call `os.path.abspath("")` if an empty string is passed, which resolves to the viewer's own working directory. Guarding `len(sys.argv) > 2 and sys.argv[2]` (and `cwd` in `debug_launch.py`) avoids unintentionally matching the viewer's CWD.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1273
No description provided.