Skip to content

startup: read the literal data directory manifest - #2870

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
louisdibiasi:louis/startup-manifest-literal
Nov 27, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
louisdibiasi:louis/startup-manifest-literal

Conversation

@louisdibiasi

Copy link
Copy Markdown
Contributor

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.

@KelboLive KelboLive left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
R0Y00 merged commit 3027202 into R0Y00:main Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants