startup: read the literal data directory manifest #2870

Manually merged
github merged 1 commit from github-bot/gh-2870 into gh-pr/2870/base 2026-11-27 08:02:21 +00:00 AGit
Owner

@⁠louisdibiasi on GitHub · 2026-11-26 15:10 UTC · original
louisdibiasi:louis/startup-manifest-literal → main · +19 −7 · 2 files · 1 commits · merged 2026-11-27 08:02 UTC

Change

When -DataDir contains wildcard characters, run.ps1 treats its MicrosoftGame.config path as a pattern. A synthetic directory named data [test] caused both PowerShell 5.1 and 7 to read the manifest in the sibling data t directory. The resulting title ID and storage quota are passed to the runtime from the wrong manifest. If the intended manifest is absent, the sibling was still read.

Use literal paths for both the existence check and the manifest read. This fixes the manifest lookup only; bracketed launcher workspace and log paths are separate limitations. #2867, #2820 and #2822 also touch this launcher or its test, so the later merge may need to reconcile those changes.

Verification

Windows, base b505c32b, head 682a6034:

  • out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py — passed on Windows PowerShell 5.1 and PowerShell 7. Before the fix the new bracketed and missing-manifest cases failed on both shells, selecting the sibling's 9999 / 99 instead of the intended 1234 / 42 or no values. The ordinary path is a positive control.
  • Independently reverting either literal-path change made its matching new control fail under each shell.
  • out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py --text-only — passed.
  • out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py — passed.
  • . .\tools\dev.ps1; cmake --build --preset pr; ctest --preset pr --no-tests=error — build passed; 36 passed and four min-LOD WARP tests skipped. dev.ps1 reported vswhere.exe unavailable on PATH; the configured build completed.
  • git diff --check — passed.

Evidence and follow-up

The regression creates both manifests and the debugger stub in a temporary source-built fixture; no title data is used. Runtime consumers of these environment values are in src/startup_stubs/runtime_proxy.cpp. This does not establish title startup or hardware behavior.

AI-assisted.

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 (not applicable).
  • I did not include game files, dumps, distribution links or secrets.
**@⁠louisdibiasi** on GitHub · 2026-11-26 15:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2870) `louisdibiasi:louis/startup-manifest-literal` → `main` · +19 −7 · 2 files · 1 commits · merged 2026-11-27 08:02 UTC ## Change When `-DataDir` contains wildcard characters, `run.ps1` treats its `MicrosoftGame.config` path as a pattern. A synthetic directory named `data [test]` caused both PowerShell 5.1 and 7 to read the manifest in the sibling `data t` directory. The resulting title ID and storage quota are passed to the runtime from the wrong manifest. If the intended manifest is absent, the sibling was still read. Use literal paths for both the existence check and the manifest read. This fixes the manifest lookup only; bracketed launcher workspace and log paths are separate limitations. #2867, #2820 and #2822 also touch this launcher or its test, so the later merge may need to reconcile those changes. ## Verification Windows, base `b505c32b`, head `682a6034`: - `out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py` — passed on Windows PowerShell 5.1 and PowerShell 7. Before the fix the new bracketed and missing-manifest cases failed on both shells, selecting the sibling's `9999` / `99` instead of the intended `1234` / `42` or no values. The ordinary path is a positive control. - Independently reverting either literal-path change made its matching new control fail under each shell. - `out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py --text-only` — passed. - `out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py` — passed. - `. .\tools\dev.ps1; cmake --build --preset pr; ctest --preset pr --no-tests=error` — build passed; 36 passed and four min-LOD WARP tests skipped. `dev.ps1` reported `vswhere.exe` unavailable on PATH; the configured build completed. - `git diff --check` — passed. ## Evidence and follow-up The regression creates both manifests and the debugger stub in a temporary source-built fixture; no title data is used. Runtime consumers of these environment values are in `src/startup_stubs/runtime_proxy.cpp`. This does not establish title startup or hardware behavior. AI-assisted. ## 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 (not applicable). - [x] I did not include game files, dumps, distribution links or secrets.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:27:27 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-11-26 20:56 UTC · original · reviewed

Using -LiteralPath instead of -Path fixes the bracket-matching pitfall in PowerShell where [ and ] are glob characters. This prevents manifest parsing from silently failing (or worse, matching the wrong directory) when the data path contains special characters.

The test harness mirrors this scenario well: a bracketed data directory, a decoy directory (data t), and a manifest="bracket_missing" case to confirm the fix doesn't break when the config is absent.

One small note: the decoy directory data t only exists for manifest.startswith("bracket"), so in the bracket_missing case it won't be created. Consider whether bracket_missing should still create the decoy to ensure we don't accidentally pick up a config from the wrong path — though since the test expects manifest in ("normal", "bracket") for a populated manifest, this edge is already covered.

No other concerns for this change.

**@⁠KelboLive** on GitHub · 2026-11-26 20:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2870#pullrequestreview-6080397840) · **reviewed** Using `-LiteralPath` instead of `-Path` fixes the bracket-matching pitfall in PowerShell where `[` and `]` are glob characters. This prevents manifest parsing from silently failing (or worse, matching the wrong directory) when the data path contains special characters. The test harness mirrors this scenario well: a bracketed data directory, a decoy directory (`data t`), and a `manifest="bracket_missing"` case to confirm the fix doesn't break when the config is absent. One small note: the decoy directory `data t` only exists for `manifest.startswith("bracket")`, so in the `bracket_missing` case it won't be created. Consider whether `bracket_missing` should still create the decoy to ensure we don't accidentally pick up a config from the wrong path — though since the test expects `manifest in ("normal", "bracket")` for a populated manifest, this edge is already covered. No other concerns for this change.
github-bot changed target branch from main to gh-pr/2870/base 2026-11-27 08:02:19 +00:00
github manually merged commit 682a6034bd into gh-pr/2870/base 2026-11-27 08:02:21 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 08:01 UTC · original · approved these changes

Reviewed 682a6034 against main 22107932. The launcher uses literal paths for both the existence check and the read. This prevents the manifest from a sibling matching the bracket pattern from supplying the runtime's title ID or storage quota.

python -B tests/startup_run_ps1_check.py passed with Windows PowerShell 5.1 and PowerShell 7, and the text-only check passed. In each shell I also ran the ordinary, bracketed and absent-manifest cases independently. Reverting Test-Path -LiteralPath failed the absent-manifest control. Reverting Get-Content -LiteralPath failed the bracketed-manifest control. These were source-built launcher stubs. Hosted Windows, Linux Python and gfx1013 checks passed.

**@⁠R0Y00** on GitHub · 2026-11-27 08:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2870#pullrequestreview-6085101821) · **approved these changes** Reviewed `682a6034` against `main` `22107932`. The launcher uses literal paths for both the existence check and the read. This prevents the manifest from a sibling matching the bracket pattern from supplying the runtime's title ID or storage quota. `python -B tests/startup_run_ps1_check.py` passed with Windows PowerShell 5.1 and PowerShell 7, and the text-only check passed. In each shell I also ran the ordinary, bracketed and absent-manifest cases independently. Reverting `Test-Path -LiteralPath` failed the absent-manifest control. Reverting `Get-Content -LiteralPath` failed the bracketed-manifest control. These were source-built launcher stubs. Hosted Windows, Linux Python and gfx1013 checks passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.