test(libkernel): skip the Windows lstat link checks without the symlink privilege #3169
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3169"
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 boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T23:57:21Z.
What
guest_filesystemaborts on Windows machines without administrator rights or Developer Mode:The Windows
lstatlink checks (7f2a8826/314c3722, @MarcZX100) create symbolic links withCreateSymbolicLinkW(..., SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE). Without the symlink privilege, that flag isn't honoured, and the call fails withERROR_PRIVILEGE_NOT_HELD(1314). I checked this with a direct call on such a machine. The guest errno in the message is stale, so it points away from the cause. The CI runner has the privilege, so CI doesn't see this, but anyone runningctestlocally on a default Windows install does.The test now tries the first link. If that fails with
ERROR_PRIVILEGE_NOT_HELD, it prints a note and skips the link checks. Any other failure still fails the test. When links can be created, the checks run as before, unchanged apart from moving into theelsebranch.Tested
Windows 11 (no Developer Mode, not elevated), WinLibs GCC 15.2.0 r7, Release, on
main59a8cbab:main,guest_filesystemfails at line 276.--repeat until-fail:3). The rest of the test still runs; only the link block is skipped.check_conventions.pyandpr_overlap.py --branchpass.The privileged path, where the link checks run, is covered by the Windows CI job. A fork CI run for this head will be posted here.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-11T00:09:07Z.
Review: COMMENTED
The diagnosis is the valuable part here, and it is complete: a Windows machine without the symlink privilege refuses
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATEwithERROR_PRIVILEGE_NOT_HELD, the check aborts, and the guest errno in the failure message is stale — so the message points away from the cause. Establishing that with a direct call, and saying that the CI runner has the privilege and therefore never sees it, is what turns "this test is flaky" into a specific and testable claim.The skip is scoped correctly. Trying the first link and skipping the block only on that exact error, while any other failure still fails the test, keeps the coverage that can run and refuses to let a real failure hide behind the skip. Printing a note instead of skipping silently is the other half of that, and confirming the block still runs when links can be created is what makes this a skip rather than a removal.
The verification is what the platform allows, and it says so. On
mainit fails at line 276; with the change it passes three times running, with the rest of the test still active and only the link block skipped. A Windows-only path cannot be exercised from here — CI is the only place this runs — so a triple repeat is the right substitute for a local build.One thing worth filing rather than leaving in a description: the stale errno. A test that reports guest errno 14 for a Windows privilege failure will mislead exactly the next person it misled this time, and this fix works around the abort without correcting the message. If that error path is not already tracked somewhere, it reads like it deserves its own issue.
Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T00:17:49Z.
Thanks @Dextroid17. Agreed on the stale errno, so I filed it as #3178. I kept it out of this PR so this one stays a scoped test fix; the message is shared by several tests'
Checkhelpers. The fork CI run on the privileged Windows runner will be posted here when it finishes.Imported from boykopovar/AnyPS5. Originally posted by Zurisen on 2026-10-11T00:24:54Z.
Native run of the skip path, on a machine without the symlink privilege: Windows 11 Home (26200), Developer Mode off, not elevated, WinLibs GCC 15.2.0 r7, Release. A direct
CreateSymbolicLinkW(..., SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE)here returns false withERROR_PRIVILEGE_NOT_HELD(1314) and creates no link.mainf1ae427b:guest_filesystemfails 3/3 withFilesystem check failed at line 276 (guest errno 14).main+c332bdb3(merges cleanly):guest_filesystempasses 3/3 and printsWindows lstat link checks skipped: creating symbolic links needs Developer Mode or administrator rights.I can't cover the privileged path on this machine; the fork CI run you mentioned covers that.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T00:38:25Z.
Fork CI for this head (run 38096782280), merged onto current
main:guest_filesystem. The runner has the symlink privilege, so the Windowslstatlink checks ran in full there, which covers the privileged path.agc_unit_shadow,agc_driver_flat_apertures(timeout) andagc_driver_image_packed16_loadfail, and the same three fail on a rerun. They fail identically inmain's own push build (run 38098335801), and this PR changes only the Windows branch ofGuestFilesystem.cpp, so they're unrelated. Everything else passes.