fix(agc): ignore Finder .DS_Store files in capture directories #7728

Merged
jotitadev merged 1 commit from upstream-pr/7728 into main 2026-10-20 01:13:13 +00:00
jotitadev commented 2026-10-19 03:16:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T03:16:41Z.


What

Follow-up to #6259. On macOS, Finder writes a .DS_Store file into any folder it shows, so opening the compute capture directory in Finder made the next new capture fail with capture directory contains an unexpected entry. With WriteOptional that error is not swallowed, so it reaches the caller like any other invalid directory. The author of #6259 confirmed it and asked for a separate PR (https://github.com/boykopovar/AnyPS5/pull/6259#issuecomment-6200985478).

The scan shared by Write and WriteOptional now skips an entry only when it is a regular file named exactly .DS_Store. Skipped entries do not count toward the 128-entry or 256 MiB bounds. Everything else is unchanged: other files (including other dot-files), a symbolic link named .DS_Store and a directory named .DS_Store are still rejected, so --optional-invalid keeps failing on a foreign entry as before.

The --optional-invalid case now writes a .DS_Store into a fresh capture directory, checks that Write and WriteOptional both add a record and leave the file alone, then adds the existing foreign file and checks that Write (with its diagnostic) and WriteOptional still reject the directory.

Tested

macOS 27.2 on an Apple M2 Max, Xcode 27.0 (Apple clang 21.0.0, libc++). Base: main fd423f9b2 (this head a51bb03cc merges cleanly onto it). libSceAgcDriver does not build on macOS yet, so I built tests/ComputePipelineCapture.cpp standalone with Execution/src/ComputePipelineCapture.cpp (-std=c++20 -O2, Vulkan SDK 1.4.363 headers), for -arch arm64 and -arch x86_64 (run under Rosetta). Every mode: default, --optional-entry-cap, --optional-byte-cap, --optional-io, --optional-invalid.

  • Test from this branch, scan from main: --optional-invalid fails with capture directory contains an unexpected entry on both architectures; the other four modes pass.
  • Test and scan from this branch: 5/5 pass on both architectures.
  • Test from main, scan from this branch: 5/5 pass on both architectures (the foreign entry is still rejected).

Not run: the CTest targets on Linux or Windows (full build).

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 (#6259 is merged)
  • Unblocks: none
  • GPUs tested: n/a (the capture code and its test do not use a GPU)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4915298917 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7728). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T03:16:41Z. --- ### What Follow-up to #6259. On macOS, Finder writes a `.DS_Store` file into any folder it shows, so opening the compute capture directory in Finder made the next new capture fail with `capture directory contains an unexpected entry`. With `WriteOptional` that error is not swallowed, so it reaches the caller like any other invalid directory. The author of #6259 confirmed it and asked for a separate PR (https://github.com/boykopovar/AnyPS5/pull/6259#issuecomment-6200985478). The scan shared by `Write` and `WriteOptional` now skips an entry only when it is a regular file named exactly `.DS_Store`. Skipped entries do not count toward the 128-entry or 256 MiB bounds. Everything else is unchanged: other files (including other dot-files), a symbolic link named `.DS_Store` and a directory named `.DS_Store` are still rejected, so `--optional-invalid` keeps failing on a foreign entry as before. The `--optional-invalid` case now writes a `.DS_Store` into a fresh capture directory, checks that `Write` and `WriteOptional` both add a record and leave the file alone, then adds the existing `foreign` file and checks that `Write` (with its diagnostic) and `WriteOptional` still reject the directory. ### Tested macOS 27.2 on an Apple M2 Max, Xcode 27.0 (Apple clang 21.0.0, libc++). Base: `main` fd423f9b2 (this head a51bb03cc merges cleanly onto it). libSceAgcDriver does not build on macOS yet, so I built `tests/ComputePipelineCapture.cpp` standalone with `Execution/src/ComputePipelineCapture.cpp` (`-std=c++20 -O2`, Vulkan SDK 1.4.363 headers), for `-arch arm64` and `-arch x86_64` (run under Rosetta). Every mode: default, `--optional-entry-cap`, `--optional-byte-cap`, `--optional-io`, `--optional-invalid`. - Test from this branch, scan from `main`: `--optional-invalid` fails with `capture directory contains an unexpected entry` on both architectures; the other four modes pass. - Test and scan from this branch: 5/5 pass on both architectures. - Test from `main`, scan from this branch: 5/5 pass on both architectures (the `foreign` entry is still rejected). Not run: the CTest targets on Linux or Windows (full build). ### 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](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 (#6259 is merged) - [x] Unblocks: none - [x] GPUs tested: n/a (the capture code and its test do not use a GPU) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 22:26:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T22:26:28Z.


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.

Pull request Shared files not compared
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/ComputePipelineCapture.cpp
core/libs/prx/libSceAgcDriver/tests/ComputePipelineCapture.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278734518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7728#issuecomment-6278734518). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T22:26:28Z. --- <!-- pr-overlap --> 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. | Pull request | Shared files not compared | |---|---| | [PR 8004](https://www.github.com/boykopovar/AnyPS5/pull/8004) | `core/libs/prx/libSceAgcDriver/Execution/src/ComputePipelineCapture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/ComputePipelineCapture.cpp` |
adriadam10 commented 2026-10-20 01:15:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T01:15:54Z.


Checked the scan change: only a regular file named exactly .DS_Store is skipped and it does not count toward the 128-entry or 256 MiB bounds; symlinks, directories and other files are still rejected. The new test fails without the change (strict Write would reject the file) and still rejects foreign; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281023213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7728#issuecomment-6281023213). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T01:15:54Z. --- Checked the scan change: only a regular file named exactly `.DS_Store` is skipped and it does not count toward the 128-entry or 256 MiB bounds; symlinks, directories and other files are still rejected. The new test fails without the change (strict `Write` would reject the file) and still rejects `foreign`; merged.
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!7728
No description provided.