Repository navigation
startup: read the literal data directory manifest - #2870
Conversation
KelboLive
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Change
When
-DataDircontains wildcard characters,run.ps1treats itsMicrosoftGame.configpath as a pattern. A synthetic directory nameddata [test]caused both PowerShell 5.1 and 7 to read the manifest in the siblingdata tdirectory. 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, head682a6034: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's9999/99instead of the intended1234/42or no values. The ordinary path is a positive control.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.ps1reportedvswhere.exeunavailable 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