diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-14 14:06:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-14 14:06:06 +0900 |
| commit | ba0a7f913b4b2a83d0c8862d657bdc867730a962 (patch) | |
| tree | 3ebc50ea1e3f1da11c3129a31ecf5f0356a6c239 /crates/shirabe/src/package/archiver/archivable_files_finder.rs | |
| parent | db7f5bd91c9d43d2d0b66824ed60571f1c478422 (diff) | |
| download | php-shirabe-ba0a7f913b4b2a83d0c8862d657bdc867730a962.tar.gz php-shirabe-ba0a7f913b4b2a83d0c8862d657bdc867730a962.tar.zst php-shirabe-ba0a7f913b4b2a83d0c8862d657bdc867730a962.zip | |
fix(archiver): resolve infinite recursion in exclude filter dispatch
The Phase B port invented an ArchivableFilesFilter trait whose filter
impls called self.filter, recursing forever; the name also collided
with the real ArchivableFilesFilter FilterIterator class. Composer has
no such interface: the finder holds GitExcludeFilter/ComposerExcludeFilter
(both extending BaseExcludeFilter) and calls $filter->filter().
Drop the invented trait, type the filters as Box<dyn BaseExcludeFilter>,
and implement BaseExcludeFilter on the concrete filters (accessors
delegating to inner). Remove the unused generic default methods from the
trait so it is dyn-compatible; they remain as inherent methods on
BaseExcludeFilterBase, which is where every caller already reaches them.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/archiver/archivable_files_finder.rs')
| -rw-r--r-- | crates/shirabe/src/package/archiver/archivable_files_finder.rs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/crates/shirabe/src/package/archiver/archivable_files_finder.rs b/crates/shirabe/src/package/archiver/archivable_files_finder.rs index c6a2d39..cb1c3e5 100644 --- a/crates/shirabe/src/package/archiver/archivable_files_finder.rs +++ b/crates/shirabe/src/package/archiver/archivable_files_finder.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php +use crate::package::archiver::BaseExcludeFilter; use crate::package::archiver::ComposerExcludeFilter; use crate::package::archiver::GitExcludeFilter; use crate::util::Filesystem; @@ -35,7 +36,7 @@ impl ArchivableFilesFinder { } let sources = fs.normalize_path(&sources_real_path.unwrap()); - let filters: Vec<Box<dyn ArchivableFilesFilter>> = if ignore_filters { + let filters: Vec<Box<dyn BaseExcludeFilter>> = if ignore_filters { vec![] } else { vec