startup: compare resolved staging paths #2864
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2872"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by louisdibiasi on 2026-11-26T15:26:41Z.
Change
stage_package.ps1checks package and destination paths by their spelling. If the package is named through asubstdrive or directory junction and the destination uses the underlying path, it can stage inside the package even though the helper promises to keep the destination separate. An executable spelled inside the package can also resolve through a junction to a file outside it.Compare resolved Windows paths for the package, executable and the destination's nearest existing ancestor before writing. Preserve drive-root separators, and keep the existing destination reparse-point and nonempty-directory checks. If Windows cannot resolve a path, staging stops; normalized-path queries can fail on some SMB shares. The comparison is not a defense against a concurrent change to the filesystem between the check and copy. Add the staging check to the Windows PR preset so the regression runs in PR CI. #2827 adds a runtime build preset in a separate section of the same file.
Verification
Windows, base
b505c32b, final head9ca04115:out\pe-env\Scripts\python.exe -B tests\startup_stage_package_check.py powershell.exeand the same command withpwsh.exe— passed. The synthetic junction controls refuse a destination inside the package through an alias and an executable outside it through a junction, and allow a separate destination and an executable reached through a junction that stays inside the package. A volume-GUID path is also checked against a nested destination and a safe sibling; that control explicitly skips if the temporary volume has no GUID path. On upstream the package-alias control staged inside the package; a separate synthetic source-junction check also staged the outside executable.substmapping to a synthetic package reproduced the destination bypass on upstream. With the patch, both shells refused that nested destination and a physical drive-root alias, and staged to a separate sibling. The test mapping was removed. Network shares and concurrent path changes were not tested.out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.pyandgit diff --check— passed.. .\tools\dev.ps1; cmake --build --preset pr; ctest --preset pr --no-tests=error— build passed and 36 tests passed atd60a292a, with four min-LOD WARP skips.dev.ps1reportedvswhere.exeunavailable on PATH; the configured build completed. At the final head,ctest --preset pr -N -R '^startup_stage_package$'selected the staging test, andctest --preset pr --no-tests=errorpassed 37 tests with the same four skips.Evidence and follow-up
The fixture creates only synthetic files and junctions. The resolution uses Windows directory handles and
GetFinalPathNameByHandleW; the documented network-share limitation is noted in the run instructions. No title or GPU hardware behavior was tested.AI-assisted.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-26T20:24:43Z.
Review: COMMENTED
startup: compare resolved staging paths
Clear and focused change. Comparing resolved staging paths helps ensure that paths with different normalizations (e.g., trailing slashes,
..components, mixed separators) are treated consistently.Observations
.or..componentsQuestions
Verdict: Easy to review. Recommend looking for edge cases in path normalization and verifying the new comparison handles Windows-style paths consistently.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T19:54:48Z.
Review: COMMENTED
I tried to review
dbec99b0over currentmain454fc0ed. The trial merge conflicts inCMakePresets.json. Since this PR's basee446b072,mainhas added the page-run fixtures to theprpreset (0cfdd607, merged in104617d6), and this PR edits the same test-filter line. The resolution should keep both additions.I'll review it once it is updated with
main.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T02:43:06Z.
I merged
main(fdb6faaa) into this branch as7b7efadf, a plain merge commit with no rebase or force-push. It conflicted withmain.Conflict:
CMakePresets.json, theprtest preset filter.mainhad addedxmem_(run_break_readers|…),startup_dstorage_break_window,xmem_page_runs_device(_join)?_warpandlinear_buffer_backing_share_warp. I keptmain's filter and appended this branch'sstartup_stage_packageat the end, which is the same change as before. The file still parses as JSON.git diff --check origin/main...HEADis clean, and the net diff againstmainis this branch's 4 files.What I ran on
7b7efadf. I did a full build indevandrelease, then ranprpreset: 53 of 70 pass, includingstartup_stage_package. The other 17 return 77 (capability skip): 14spirv_*_warpand 3xmem_placeholder_split_*.A different reviewer will re-review the merged head.
Environment: AMD Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, WARP 10.0.26100.9818.
This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:00:52Z.
Review: APPROVED
Reviewed
7b7efadf8ewith mainc827d8ba(integrated tree830ee58dbc). The current PR preset keeps the earlier main test groups and includes startup_stage_package. The source, package, and nearest existing staging ancestor are resolved before directory creation. Existing reparse-point and nonempty-directory checks are retained. The documented limits for SMB path resolution and concurrent filesystem changes match the implementation.On Windows 11 26200.9974 both synthetic staging runs passed, including package preservation and the path guards. The launcher text control passed. No game files were involved.
The required hosted Windows CI job and the Linux Python and gfx1013 checks passed.