tooling: preserve form reference output permissions #2744

Merged
chadhyatt merged 2 commits from upstream-pr/2752 into main 2026-11-26 06:05:12 +00:00
chadhyatt commented 2026-11-26 05:59:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chadhyatt on 2026-11-26T05:59:31Z.


AI-assisted backport patch from x2w-microlift.

Atomic report replacement introduced by #2675 changes ordinary POSIX TSV permissions to the temporary file mode (0600). Preserve the destination mode on replacement and the normal umask-derived mode on creation. Windows behavior is unchanged; sibling replacement and cleanup remain intact.

Verification: bc8e05f8fd on macOS arm64, python3 -B tests/form_reference_cli_check.py: 10 passed in 0.500s, including real child-process umask 0027, new 0640 files, existing 0600/0664/0644 replacements and matching generated contents. Windows-specific runtime and GPU suites were not run; this is a portable tooling-only change.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6620560092 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2752). Originally posted by [chadhyatt](https://github.com/chadhyatt) on 2026-11-26T05:59:31Z. --- AI-assisted backport patch from x2w-microlift. Atomic report replacement introduced by #2675 changes ordinary POSIX TSV permissions to the temporary file mode (0600). Preserve the destination mode on replacement and the normal umask-derived mode on creation. Windows behavior is unchanged; sibling replacement and cleanup remain intact. Verification: bc8e05f8fd90 on macOS arm64, `python3 -B tests/form_reference_cli_check.py`: 10 passed in 0.500s, including real child-process umask 0027, new 0640 files, existing 0600/0664/0644 replacements and matching generated contents. Windows-specific runtime and GPU suites were not run; this is a portable tooling-only change.
tedin7 commented 2026-11-26 06:02:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T06:01:57Z.

Review: COMMENTED


Review of head bc8e05f8 (comment only).

Checked:

  • tools/form_reference.py _write_atomic: the temp file now gets the existing destination mode, or 0666 & ~umask when the file is new (POSIX only). Windows path is untouched. Cleanup on error is unchanged.
  • tests/form_reference_cli_check.py test_child_umask_modes_preserved_by_cli_rewrite: real child process with umask 0027, new files 0640, replaced files keep 0600/0664/0644, contents identical. It guards the behavior.
  • No other open or merged PR covers this slice.

Commands run locally (Linux, worktree at this head):

  • python3 -B tests/form_reference_cli_check.py: 10 tests OK (needs iced_x86).
  • Mutation 1: removing the os.chmod call makes the new test fail.
  • Mutation 2: using a fixed 0o600 for new files makes the new test fail.
  • python3 tests/docs_links_check.py: OK.
  • python3 tests/bidi_controls_check.py: OK.
  • git diff --check origin/main...HEAD: clean.

Windows runtime was not exercised by this review; the PR only changes tooling.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069252868 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2752#pullrequestreview-6069252868). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T06:01:57Z. **Review:** COMMENTED --- Review of head bc8e05f8 (comment only). Checked: - `tools/form_reference.py` `_write_atomic`: the temp file now gets the existing destination mode, or `0666 & ~umask` when the file is new (POSIX only). Windows path is untouched. Cleanup on error is unchanged. - `tests/form_reference_cli_check.py` `test_child_umask_modes_preserved_by_cli_rewrite`: real child process with umask 0027, new files 0640, replaced files keep 0600/0664/0644, contents identical. It guards the behavior. - No other open or merged PR covers this slice. Commands run locally (Linux, worktree at this head): - `python3 -B tests/form_reference_cli_check.py`: 10 tests OK (needs `iced_x86`). - Mutation 1: removing the `os.chmod` call makes the new test fail. - Mutation 2: using a fixed `0o600` for new files makes the new test fail. - `python3 tests/docs_links_check.py`: OK. - `python3 tests/bidi_controls_check.py`: OK. - `git diff --check origin/main...HEAD`: clean. Windows runtime was not exercised by this review; the PR only changes tooling. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T06:02:28Z.


Win2025 receipt for head f1a17be3 after updating with main (PR change identical to reviewed bc8e05f8).

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit f1a17be393c351d74fb5e97a32adca5330876c78:

  • Windows Python checks: tests/form_reference_cli_check.py ok (1.6s)
  • Wall: 6.9s

Note: PYCHECK name=tests/form_reference_cli_check.py rc=0; the new permission test is POSIX-only and skips on Windows (covered on Linux above).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184036393 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2752#issuecomment-7184036393). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T06:02:28Z. --- Win2025 receipt for head f1a17be3 after updating with main (PR change identical to reviewed bc8e05f8). Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `f1a17be393c351d74fb5e97a32adca5330876c78`: - **Windows Python checks**: `tests/form_reference_cli_check.py` ok (`1.6s`) - Wall: `6.9s` Note: PYCHECK name=tests/form_reference_cli_check.py rc=0; the new permission test is POSIX-only and skips on Windows (covered on Linux above). AI-assisted; commands listed were executed locally.
chadhyatt commented 2026-11-26 06:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chadhyatt on 2026-11-26T06:02:52Z.


Thank you for the independent Linux and mutation checks. Confirmed that the main reconciliation at f1a17be3 preserves the exact two verified patch files. No further changes from me.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184042769 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2752#issuecomment-7184042769). Originally posted by [chadhyatt](https://github.com/chadhyatt) on 2026-11-26T06:02:52Z. --- Thank you for the independent Linux and mutation checks. Confirmed that the main reconciliation at f1a17be3 preserves the exact two verified patch files. No further changes from me.
upstream-sync closed this pull request 2026-11-26 07:00:21 +00:00
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!2744
No description provided.