test(tools): build the select_tests fixture under a junction where Windows refuses symlinks #6961

Merged
savvaniss merged 1 commit from upstream-pr/6961 into main 2026-10-17 13:16:20 +00:00
savvaniss commented 2026-10-16 21:22:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-16T21:22:17Z.


What

The select_tests fixture builds its project under a directory symlink, so the paths CMake records differ from the resolved ones (2b056a479). Creating a symlink on Windows needs SeCreateSymbolicLinkPrivilege, which a user without Developer Mode or elevation lacks. setUpClass then fails with [WinError 1314] A required privilege is not held by the client, and select_tests fails on every such local run. On that error, the link is now a directory junction (_winapi.CreateJunction), which os.path.realpath resolves like a symlink. Where a symlink can be created, as on the CI runners, nothing changes.

Tested

Windows 11 Pro 26300, no Developer Mode, not elevated. Python 3.15.0, with WinLibs GCC 15.2.0 r7 and Ninja 1.13.2 on PATH, at main 0dc15620d.

  • main: select_tests fails in setUpClass with WinError 1314, and no test runs.
  • This branch: select_tests passes, and python tools/tests/test_select_tests.py -v runs and passes all 10 tests.
  • Negative control: with Build in tools/select_tests.py switched back to os.path.realpath (the code before 2b056a479), 6 of the 10 fail through the junction.
  • Not run on Linux or macOS. There symlink_to succeeds and the code path is the same as before.
  • python3 tools/check_conventions.py --base origin/main passes. python3 tools/pr_overlap.py --branch fix/select-tests-junction reports no overlap.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4894423668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6961). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-16T21:22:17Z. --- ### What The `select_tests` fixture builds its project under a directory symlink, so the paths CMake records differ from the resolved ones (2b056a479). Creating a symlink on Windows needs `SeCreateSymbolicLinkPrivilege`, which a user without Developer Mode or elevation lacks. `setUpClass` then fails with `[WinError 1314] A required privilege is not held by the client`, and `select_tests` fails on every such local run. On that error, the link is now a directory junction (`_winapi.CreateJunction`), which `os.path.realpath` resolves like a symlink. Where a symlink can be created, as on the CI runners, nothing changes. ### Tested Windows 11 Pro 26300, no Developer Mode, not elevated. Python 3.15.0, with WinLibs GCC 15.2.0 r7 and Ninja 1.13.2 on `PATH`, at `main` `0dc15620d`. - `main`: `select_tests` fails in `setUpClass` with WinError 1314, and no test runs. - This branch: `select_tests` passes, and `python tools/tests/test_select_tests.py -v` runs and passes all 10 tests. - Negative control: with `Build` in `tools/select_tests.py` switched back to `os.path.realpath` (the code before 2b056a479), 6 of the 10 fail through the junction. - Not run on Linux or macOS. There `symlink_to` succeeds and the code path is the same as before. - `python3 tools/check_conventions.py --base origin/main` passes. `python3 tools/pr_overlap.py --branch fix/select-tests-junction` reports no overlap. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cadenasynyster commented 2026-10-17 00:56:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cadenasynyster on 2026-10-17T00:56:03Z.


Confirmed on a second Windows machine, with a different Python version:

Windows 11 10.0.26200.9711, no Developer Mode, not elevated (checked: os.symlink raises OSError). Python 3.14.7, WinLibs GCC 15.2.0 r7.

  • main f3263dfbf: select_tests fails in setUpClass with WinError 1314.
  • this branch (c56dbc616): ctest -R select_tests passes, and python tools/tests/test_select_tests.py -v runs and passes all 10 tests.

So _winapi.CreateJunction behaves the same on 3.14 as on the 3.15 you tested.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227643208 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6961#issuecomment-6227643208). Originally posted by [cadenasynyster](https://github.com/cadenasynyster) on 2026-10-17T00:56:03Z. --- Confirmed on a second Windows machine, with a different Python version: Windows 11 10.0.26200.9711, no Developer Mode, not elevated (checked: os.symlink raises OSError). Python 3.14.7, WinLibs GCC 15.2.0 r7. - main f3263dfbf: select_tests fails in setUpClass with WinError 1314. - this branch (c56dbc616): ctest -R select_tests passes, and python tools/tests/test_select_tests.py -v runs and passes all 10 tests. So _winapi.CreateJunction behaves the same on 3.14 as on the 3.15 you tested. AI-assisted: yes
keravyn-ops commented 2026-10-17 10:40:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T10:40:33Z.


Windows run on a host where symlinks are refused: Windows 11 Home 10.0.26100, Developer Mode off (AllowDevelopmentWithoutDevLicense unset), non-elevated shell, Python 3.14.

Build select_tests, 2 runs
main 673f7406c fails 2/2: OSError: [WinError 1314] Dem Client fehlt ein erforderliches Recht (privilege not held) in setUpClass at the symlink_to
this PR at c56dbc616 passes 2/2 (7.6–8.0 s)

AI-assisted: yes (runs made on the host above).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232930633 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6961#issuecomment-6232930633). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-17T10:40:33Z. --- Windows run on a host where symlinks are refused: Windows 11 Home 10.0.26100, Developer Mode off (`AllowDevelopmentWithoutDevLicense` unset), non-elevated shell, Python 3.14. | Build | `select_tests`, 2 runs | |---|---| | `main` 673f7406c | fails 2/2: `OSError: [WinError 1314] Dem Client fehlt ein erforderliches Recht` (privilege not held) in `setUpClass` at the `symlink_to` | | this PR at c56dbc616 | passes 2/2 (7.6–8.0 s) | AI-assisted: yes (runs made on the host above).
oneandonlydean commented 2026-10-17 10:45:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T10:45:01Z.


Thanks for the run. Failing 2/2 on main with WinError 1314 and passing 2/2 here, on a host with Developer Mode off and a non-elevated shell, is exactly the case this PR targets. I've added it to the review notes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232969219 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6961#issuecomment-6232969219). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T10:45:01Z. --- Thanks for the run. Failing 2/2 on main with WinError 1314 and passing 2/2 here, on a host with Developer Mode off and a non-elevated shell, is exactly the case this PR targets. I've added it to the review notes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6961
No description provided.