fix(tools): anchor the release expected-library set to the repository #818

Closed
ebosido444-ai wants to merge 1 commit from upstream-pr/818 into main
ebosido444-ai commented 2026-10-06 06:36:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T06:36:24Z.


What

tools/package_release.py builds its expected-library guard from Path("core/libs/prx"), resolved against the current working directory while everything else in the file anchors to --build. Invoked from anywhere but the repository root it crashes before the guard; worse, under a directory that happens to contain its own core/libs/prx, the expected set silently shrinks and the "Missing patched libraries" check passes with libraries actually absent from the release. Anchored to the script location like tools/progress.py's ROOT.

Tested

Windows 11, Python 3.14: run the module from an unrelated scratch directory — previously FileNotFoundError before the guard, now the expected set resolves to the real repository libraries (the run proceeds to the intended Missing patched libraries error for the absent build). Assert check on the anchored path from a foreign CWD.

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 (n/a, tooling)
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (n/a)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4755092059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/818). Originally posted by [ebosido444-ai](https://github.com/ebosido444-ai) on 2026-10-06T06:36:24Z. --- ### What `tools/package_release.py` builds its expected-library guard from `Path("core/libs/prx")`, resolved against the current working directory while everything else in the file anchors to `--build`. Invoked from anywhere but the repository root it crashes before the guard; worse, under a directory that happens to contain its own `core/libs/prx`, the expected set silently shrinks and the "Missing patched libraries" check passes with libraries actually absent from the release. Anchored to the script location like `tools/progress.py`'s `ROOT`. ### Tested Windows 11, Python 3.14: run the module from an unrelated scratch directory — previously `FileNotFoundError` before the guard, now the expected set resolves to the real repository libraries (the run proceeds to the intended `Missing patched libraries` error for the absent build). Assert check on the anchored path from a foreign CWD. ### Checklist - [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 - [x] Unimplemented paths throw (n/a, tooling) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (n/a) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-06 07:36:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T07:36:01Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#600 tools/package_release.py L13-14
#676 tools/package_release.py L13-14
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6011632575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/818#issuecomment-6011632575). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-06T07:36:01Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #600 | `tools/package_release.py` [L13-14](https://github.com/boykopovar/AnyPS5/blob/481c85e7c9fa8ec39719f537a055b50aed50a865/tools/package_release.py#L13-L14) | | | | #676 | `tools/package_release.py` [L13-14](https://github.com/boykopovar/AnyPS5/blob/481c85e7c9fa8ec39719f537a055b50aed50a865/tools/package_release.py#L13-L14) | | |
ebosido444-ai commented 2026-10-06 07:46:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T07:46:02Z.


Closing in favour of #600, whose expected_libraries() already anchors to ROOT = Path(file).resolve().parent.parent — the same root-cause fix, inside a broader release rework that predates this. The foreign-CWD reproducer for the record: run python tools/package_release.py --platform linux --build bogus --version v1 --output out from any directory outside the repo — before either change it dies with FileNotFoundError on Path("core/libs/prx").iterdir(), after it reaches the intended Missing patched libraries error. Apologies for the duplicate-checklist miss; the pr-overlap report above caught it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6011776691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/818#issuecomment-6011776691). Originally posted by [ebosido444-ai](https://github.com/ebosido444-ai) on 2026-10-06T07:46:02Z. --- Closing in favour of #600, whose expected_libraries() already anchors to ROOT = Path(__file__).resolve().parent.parent — the same root-cause fix, inside a broader release rework that predates this. The foreign-CWD reproducer for the record: run python tools/package_release.py --platform linux --build bogus --version v1 --output out from any directory outside the repo — before either change it dies with FileNotFoundError on Path("core/libs/prx").iterdir(), after it reaches the intended Missing patched libraries error. Apologies for the duplicate-checklist miss; the pr-overlap report above caught it.

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
boykopovar/AnyPS5!818
No description provided.