fix: reject aliased release note input and outputs #6424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6424"
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 MrMha on 2026-10-15T14:55:51Z.
What
Passing the same file, a symlink, or a hard link as the release-note input and an output overwrites the input JSON. Aliasing the two outputs also overwrites the full attachment with the shortened body. Check all three file identities before writing anything. The regression covers all three pairs and all three alias types while preserving previous bytes.
Tested
macOS 27.0.1 arm64, Python 3.12.14; tooling fixtures only, no title.
The new regression failed on main
ff23657before the fix. This branch was tested independently from that base.The combined local validation checkout containing all ten independent tooling fixes also built with
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ONand passed all 172 CTest tests. Full Windows/Linux runtime and GPU tests were not run.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T15:03:46Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
tools/tests/test_package_release.pyImported from boykopovar/AnyPS5. Originally posted by realshinmalphur on 2026-10-15T15:53:08Z.
Independent Linux validation of head
bca123a7b9597408ba7e6d0d1fc6b89872831a37, using CPython 3.14.7.python3 tools/tests/test_package_release.py: 27 tests, 24 passed and 3 platform-specific skips.mainat0c4816f6119e5dc1208b16b25a171d1c88aa18f4produces 9 failed subcases, no errors or skips.mainin an isolated checkout. All 27 tests still pass with the same 3 skips; conventions and whitespace checks pass.This validates release-note tooling only; no native runtime or GPU tests were run. AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T17:39:27Z.
Review: COMMENTED
The new test does not run on Python 3.9, which is the
python3that ships with Xcode on macOS.Machine: Apple M2 Max, macOS 27.2,
/usr/bin/python33.9.6 and Homebrew Python 3.14. Headbca123a7bapplied tomain03c4cb5e7.test_aliased_paths_preserve_input_and_existing_outputserrors on the threehardlinksubtests:Path.hardlink_towas added in Python 3.10.os.link(paths[first], paths[second])does the same thing, andosis already imported. With that one-line change, the test passes on 3.9.6, and on 3.14 it passes either way.The fix itself works on 3.9. On APFS, which ignores case, I also tried case-only aliases of the input (
notes.jsongiven asNOTES.jsonandNotes.JSONfor the body output). Both are refused withmust be distinct filesand the input is unchanged:resolve()keeps the spelling it is given, butsamefilecatches it.On
main,ReleaseNotesTests.test_full_notes_are_preserved_in_assetalready errors on 3.9 for a different reason, unrelated to this PR.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T18:26:41Z.
Review: COMMENTED
Re-checked head
0be11ff1a(merged ontomainb7cedd900) on an Apple M2 Max: theos.linkchange fixes it.test_aliased_paths_preserve_input_and_existing_outputsnow passes with the Xcode Python 3.9.6 on arm64 and on x86_64 under Rosetta, and with Python 3.14.7 on arm64. Applying only the test onmainstill fails all 9 subtests, so it guards the fix.The 4 remaining
ReleaseNotesTestserrors on 3.9 are the existingwrite_text(newline=)calls inprepare_release_notes.py:31-32. They fail the same way onmainand are not from this PR.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.