fix(apple): exclude AppleDouble sidecars from IPA components (#2838)
* fix(apple): exclude AppleDouble sidecars from IPA components IPA projection returned every inventoried component before the AppleDouble sidecar filter applied to directory, ZIP and DMG roots, so ._* and __MACOSX/ metadata appeared as native libraries and frameworks while the result reported that sidecars are excluded. Apply the sidecar exclusion first for every root format; IPA still keeps non-sidecar components outside Payload/. Fixes #2546 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(apple): exercise the __MACOSX exclusion with a non-dotfile name The IPA fixture's __MACOSX entry also started with "._", so the AppleDouble filename rule excluded it and a broken __MACOSX check would go unnoticed. Use a library name that only the __MACOSX rule excludes; the native library assertion now fails if that rule regresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
94072364c7
commit
e13da084e7
@@ -218,8 +218,9 @@ export const appleProjectionId = (projection: unknown): string =>
|
||||
`aap_${digest(projection)}`;
|
||||
|
||||
/**
|
||||
* IPA projection keeps every archive component, as before. Directory, ZIP,
|
||||
* and DMG inventories can hold installers and other siblings, so only
|
||||
* AppleDouble sidecars describe neighbouring files and are never components.
|
||||
* IPA projection keeps every other archive component, as before. Directory,
|
||||
* ZIP, and DMG inventories can hold installers and other siblings, so only
|
||||
* components inside an application root are attributed to it.
|
||||
*/
|
||||
const attributeComponents = (
|
||||
@@ -227,8 +228,8 @@ const attributeComponents = (
|
||||
roots: readonly string[],
|
||||
rootFormat: RootFormat,
|
||||
): { readonly all: Component[]; readonly unattributed: number } => {
|
||||
if (rootFormat === "ipa") return { all: [...inventoried], unattributed: 0 };
|
||||
const visible = inventoried.filter(({ path }) => !isSidecar(path));
|
||||
if (rootFormat === "ipa") return { all: visible, unattributed: 0 };
|
||||
const all = visible.filter(({ path }) =>
|
||||
roots.some((root) => isWithin(path, root)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user