tests: resolve the temporary directory before matching run_preset paths #3512

Closed
KelboLive wants to merge 1 commit from upstream-pr/3512 into main
KelboLive commented 2026-11-29 19:50:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-29T19:50:42Z.


Change

tests/startup_run_preset_check.py compared --print output against a package path built from the
inherited TEMP. run_preset.py prints resolved paths, so on a host whose TEMP is the 8.3 short
form the check failed although the run itself was correct:

FAIL: --print output

Resolve the temporary directory once, before the package path is derived from it, so both sides name
the same path.

Verification

Base: upstream/main 5b86df1d6. Python 3.12, Windows 10.0.26100.

With TEMP=C:\Users\ADMINI~1\AppData\Local\Temp (the 8.3 short form):

before: FAIL: --print output   (1 failure)          exit 1
after:  OK: 12 preset choices, staging and controls exit 0

With TEMP=C:\Users\Administrator\AppData\Local\Temp (the long form), the check passes both before and
after, which is why this only shows up on a host that exports the short form.

The before/after pair is the negative control: the same command on the parent commit still prints
FAIL: --print output, and the only difference is the resolution added here.

Evidence and follow-up

CI runners export a long TEMP, so CI cannot reproduce the failure; the two runs above are the
evidence instead. No production code changes. run_preset.py already resolves, so nothing changes on
its side.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5554465913 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3512). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-29T19:50:42Z. --- ## Change `tests/startup_run_preset_check.py` compared `--print` output against a package path built from the inherited `TEMP`. `run_preset.py` prints resolved paths, so on a host whose `TEMP` is the 8.3 short form the check failed although the run itself was correct: ``` FAIL: --print output ``` Resolve the temporary directory once, before the package path is derived from it, so both sides name the same path. ## Verification Base: `upstream/main` `5b86df1d6`. Python 3.12, Windows 10.0.26100. With `TEMP=C:\Users\ADMINI~1\AppData\Local\Temp` (the 8.3 short form): ``` before: FAIL: --print output (1 failure) exit 1 after: OK: 12 preset choices, staging and controls exit 0 ``` With `TEMP=C:\Users\Administrator\AppData\Local\Temp` (the long form), the check passes both before and after, which is why this only shows up on a host that exports the short form. The before/after pair is the negative control: the same command on the parent commit still prints `FAIL: --print output`, and the only difference is the resolution added here. ## Evidence and follow-up CI runners export a long `TEMP`, so CI cannot reproduce the failure; the two runs above are the evidence instead. No production code changes. `run_preset.py` already resolves, so nothing changes on its side.
Leyukaka commented 2026-11-29 20:05:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T20:05:30Z.


This overlaps with #3508 (opened earlier, item (b) of #3507), which fixes the same --print output failure in tests/startup_run_preset_check.py.

The difference, by reading the two diffs: here the temp dir is resolved up front, so the expected and printed paths would still match if tools/startup/run_preset.py:264 stopped calling resolve(). #3508 passes the package as package/bin/.. and compares the whole mount line against package.resolve(), so it fails on that regression on any host, short TEMP or not. Neither change has run on an 8.3 TEMP in CI.

Only one of the two needs to land. Either is fine with us; maintainer's pick.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7261798758 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3512#issuecomment-7261798758). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T20:05:30Z. --- This overlaps with #3508 (opened earlier, item (b) of #3507), which fixes the same `--print output` failure in `tests/startup_run_preset_check.py`. The difference, by reading the two diffs: here the temp dir is resolved up front, so the expected and printed paths would still match if `tools/startup/run_preset.py:264` stopped calling `resolve()`. #3508 passes the package as `package/bin/..` and compares the whole mount line against `package.resolve()`, so it fails on that regression on any host, short TEMP or not. Neither change has run on an 8.3 TEMP in CI. Only one of the two needs to land. Either is fine with us; maintainer's pick.
Not-Saii commented 2026-11-29 21:33:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-29T21:33:32Z.

Review: COMMENTED


Review of cc1dc1a2af1156c6140028ec5354dca46da77300

The fix is correct and minimal. run_preset.py:264 resolves --package, and :286 prints the resolved path in the mount: subst line. The only path-string comparison in the check (tests/startup_run_preset_check.py:258) built its expected value from the unresolved TemporaryDirectory path. Resolving tmp once at :203, before package is derived, makes both sides use the same spelling. Rebinding the local tmp does not affect TemporaryDirectory cleanup. The PR changes only this one test file. It touches no CMake, CI, scripts or agent config, and adds no downloads or network calls.

There are no blocking findings. The two SHOULDs below are about the evidence text and about coordinating with #3508.

SHOULD 1: CI does reproduce this failure

The PR body says CI runners export a long TEMP, so CI cannot reproduce the failure. They can:

  • Main run 46272011845 (debug Windows job) shows a short-form runner temp directory (RUNNER~1 in other tests' paths).
  • In that run, startup_run_preset fails with the same FAIL: --print output. Issue #3507 item (b) records the same failure.
  • The PR check missed it for another reason: the Windows PR job does not run startup_run_preset, because it is not in the pr test filter. The full suite reproduces it (a main push, or workflow_dispatch on a fork).

Please correct the evidence section and cite that run.

SHOULD 2: #3508 fixes the same failure and claimed it first

  • Issue #3507 claims item (b), this exact failure. #3508 was opened about 50 minutes before this PR.
  • This PR has no Refs #3507 and no link to #3508. CONTRIBUTING.md:14 asks to link overlapping PRs and agree which one lands first.
  • The two PRs change different hunks of the same file and merge cleanly together (git merge-tree on both heads). They are also compatible in behavior: with both applied, #3508's package.resolve() is a no-op on a path that is already resolved.
  • They differ in regression coverage. #3508 passes --package through bin/.. and matches the whole mount line, so its check fails on any host if the launcher stops resolving. With this PR alone, deleting the fix still passes on a host whose temp path is already canonical, and on the Linux job. The sandbox run below confirms this (leg 4).

Please link #3507 and #3508 and agree with that author which PR lands. If this one lands, add a control that does not depend on the host's TEMP, for example the bin/.. argument.

NIT

  • Add Refs #3507 to the PR body.

What the test proves

  • On a host with a non-canonical temp path, startup_run_preset passing shows that the --print mount line matches the resolved package path.
  • On a canonical temp path (the Linux job, many Windows hosts), the test passes with or without the fix. It proves nothing about this change there.

Sandbox run (Windows Sandbox, networking disabled, vGPU on, PR tree mapped read-only)

  • Head: cc1dc1a2af1156c6140028ec5354dca46da77300, exported with git archive and copied to a scratch folder inside the sandbox.
  • Configure: cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python> exited 0. The test is pure Python, so no build was needed.
  • Command, per leg: ctest --preset dev --no-tests=error -R '^startup_run_preset$' -V, with TEMP and TMP set as listed below.

8.3 short names are disabled in the sandbox: the short form of the temp directory equals its long form. The exact 8.3 case was therefore not reproduced. I used a directory junction as TEMP instead. It is the same class of input: a temp path that Path.resolve() rewrites.

Leg Tree TEMP Result
1 head default (canonical) passed: OK: 12 preset choices, staging and controls
2 head junction passed: OK: 12 preset choices, staging and controls
3 mutation: line :203 deleted in the scratch copy junction failed: FAIL: --print output, 1 failure(s)
4 same mutation default (canonical) passed: the mutation is not caught on a canonical temp path (see SHOULD 2)
5 head, restored (hash matches the head file) junction passed
  • Totals: passed: legs 1, 2, 4, 5. Failed: leg 3 (expected, the mutation). Skipped (77): none. The PR registers no _hardware tests.
  • Mutation result: caught when TEMP is non-canonical, not caught when it is canonical.
  • Environment:
    • sandbox Windows 11 Enterprise 10.0.26100 (host 10.0.26300);
    • adapter NVIDIA GeForce RTX 4090 through sandbox vGPU, driver 10.0.26100.1150 as the sandbox reports it;
    • MSVC 14.44.35207, Windows SDK 10.0.26100, CMake 3.31.6, Python 3.14.8.
  • Debug layer: not applicable. This test creates no D3D12 device.

CI at this head (run 46303155493)

  • Windows build and test: passed, but it did not run startup_run_preset (pr filter).
  • Linux Python checks: ran tests/startup_run_preset_check.py (ok). Linux /tmp is canonical, so that run cannot tell fixed from unfixed.
  • gfx1013: passed. The /O2 and coverage jobs were skipped.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6104905767 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3512#pullrequestreview-6104905767). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-29T21:33:32Z. **Review:** COMMENTED --- ## Review of `cc1dc1a2af1156c6140028ec5354dca46da77300` The fix is correct and minimal. `run_preset.py:264` resolves `--package`, and `:286` prints the resolved path in the `mount: subst` line. The only path-string comparison in the check (`tests/startup_run_preset_check.py:258`) built its expected value from the unresolved `TemporaryDirectory` path. Resolving `tmp` once at `:203`, before `package` is derived, makes both sides use the same spelling. Rebinding the local `tmp` does not affect `TemporaryDirectory` cleanup. The PR changes only this one test file. It touches no CMake, CI, scripts or agent config, and adds no downloads or network calls. There are no blocking findings. The two SHOULDs below are about the evidence text and about coordinating with #3508. ### SHOULD 1: CI does reproduce this failure The PR body says CI runners export a long `TEMP`, so CI cannot reproduce the failure. They can: - Main run 46272011845 (debug Windows job) shows a short-form runner temp directory (`RUNNER~1` in other tests' paths). - In that run, `startup_run_preset` fails with the same `FAIL: --print output`. Issue #3507 item (b) records the same failure. - The PR check missed it for another reason: the Windows PR job does not run `startup_run_preset`, because it is not in the `pr` test filter. The full suite reproduces it (a main push, or `workflow_dispatch` on a fork). Please correct the evidence section and cite that run. ### SHOULD 2: #3508 fixes the same failure and claimed it first - Issue #3507 claims item (b), this exact failure. #3508 was opened about 50 minutes before this PR. - This PR has no `Refs #3507` and no link to #3508. CONTRIBUTING.md:14 asks to link overlapping PRs and agree which one lands first. - The two PRs change different hunks of the same file and merge cleanly together (`git merge-tree` on both heads). They are also compatible in behavior: with both applied, #3508's `package.resolve()` is a no-op on a path that is already resolved. - They differ in regression coverage. #3508 passes `--package` through `bin/..` and matches the whole mount line, so its check fails on any host if the launcher stops resolving. With this PR alone, deleting the fix still passes on a host whose temp path is already canonical, and on the Linux job. The sandbox run below confirms this (leg 4). Please link #3507 and #3508 and agree with that author which PR lands. If this one lands, add a control that does not depend on the host's `TEMP`, for example the `bin/..` argument. ### NIT - Add `Refs #3507` to the PR body. ### What the test proves - On a host with a non-canonical temp path, `startup_run_preset` passing shows that the `--print` mount line matches the resolved package path. - On a canonical temp path (the Linux job, many Windows hosts), the test passes with or without the fix. It proves nothing about this change there. ### Sandbox run (Windows Sandbox, networking disabled, vGPU on, PR tree mapped read-only) - **Head:** `cc1dc1a2af1156c6140028ec5354dca46da77300`, exported with `git archive` and copied to a scratch folder inside the sandbox. - **Configure:** `cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python>` exited 0. The test is pure Python, so no build was needed. - **Command, per leg:** `ctest --preset dev --no-tests=error -R '^startup_run_preset$' -V`, with `TEMP` and `TMP` set as listed below. 8.3 short names are disabled in the sandbox: the short form of the temp directory equals its long form. The exact 8.3 case was therefore not reproduced. I used a directory junction as `TEMP` instead. It is the same class of input: a temp path that `Path.resolve()` rewrites. | Leg | Tree | TEMP | Result | |---|---|---|---| | 1 | head | default (canonical) | passed: `OK: 12 preset choices, staging and controls` | | 2 | head | junction | passed: `OK: 12 preset choices, staging and controls` | | 3 | mutation: line `:203` deleted in the scratch copy | junction | **failed**: `FAIL: --print output`, `1 failure(s)` | | 4 | same mutation | default (canonical) | passed: the mutation is not caught on a canonical temp path (see SHOULD 2) | | 5 | head, restored (hash matches the head file) | junction | passed | - **Totals:** passed: legs 1, 2, 4, 5. Failed: leg 3 (expected, the mutation). Skipped (77): none. The PR registers no `_hardware` tests. - **Mutation result:** caught when `TEMP` is non-canonical, not caught when it is canonical. - **Environment:** - sandbox Windows 11 Enterprise 10.0.26100 (host 10.0.26300); - adapter NVIDIA GeForce RTX 4090 through sandbox vGPU, driver 10.0.26100.1150 as the sandbox reports it; - MSVC 14.44.35207, Windows SDK 10.0.26100, CMake 3.31.6, Python 3.14.8. - **Debug layer:** not applicable. This test creates no D3D12 device. ### CI at this head (run 46303155493) - **Windows build and test:** passed, but it did not run `startup_run_preset` (`pr` filter). - **Linux Python checks:** ran `tests/startup_run_preset_check.py` (ok). Linux `/tmp` is canonical, so that run cannot tell fixed from unfixed. - **gfx1013:** passed. The /O2 and coverage jobs were skipped.
KelboLive commented 2026-11-29 22:34:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-29T22:34:38Z.


Closing as a duplicate of #3508, which was opened earlier and fixes the same failure.

Its comparison is also the better one: it builds the expected mount line from \package.resolve()\ and passes the package as \package/bin/.., so it fails if
un_preset.py\ stops resolving. This version resolves the temporary directory up front, which would still match in that case.

Thanks for catching it — I checked for open PRs by issue number rather than by the file being changed, and missed #3508.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7263783690 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3512#issuecomment-7263783690). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-29T22:34:38Z. --- Closing as a duplicate of #3508, which was opened earlier and fixes the same failure. Its comparison is also the better one: it builds the expected mount line from \package.resolve()\ **and** passes the package as \package/bin/..\, so it fails if \ un_preset.py\ stops resolving. This version resolves the temporary directory up front, which would still match in that case. Thanks for catching it — I checked for open PRs by issue number rather than by the file being changed, and missed #3508.

Pull request closed

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
R0Y00/Xbox2Windows!3512
No description provided.