fix(artifacts): match lipo arm64e variant names to their FAT slices

Newer lipo names arm64e ABI variants `arm64e.<variant>`: `arm64e.v1` for
pointer-auth ABI version 1 on freshly built universal binaries, and
`arm64e.x1` on recent macOS system binaries such as /bin/ls. The
structural FAT parser names the same slice `arm64e`, so the exact name
comparison failed and inspect_artifact reported a valid, unmodified
universal binary as an integrity mismatch ("Artifact is invalid or has
changed").

Accept `arm64e.<variant>` for an `arm64e` FAT slice. Offset, size, CPU
type, subtype (including the pointer-auth version bits when lipo prints
them) and alignment are still compared field by field. The slice keeps
lipo's name in its logical path.

Fixes #1168

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 02:37:03 +00:00
co-authored by Claude Opus 5.5
parent b34bdcdb28
commit 0b32577a90
2 changed files with 79 additions and 1 deletions
+10 -1
View File
@@ -255,7 +255,7 @@ const lipoMatchesSlice = (
reported.cpu_subtype_code !== null;
return (
(hasPhysicalIdentity || structurallyUnique) &&
reported.name === observed.architecture &&
lipoNameMatches(reported.name, observed.architecture) &&
(reported.file_offset === null ||
reported.file_offset === observed.slice_offset) &&
(reported.size === null || reported.size === observed.slice_size) &&
@@ -269,6 +269,15 @@ const lipoMatchesSlice = (
);
};
/**
* Newer lipo names an arm64e ABI variant `arm64e.<variant>` (for example
* `arm64e.v1` for pointer-auth ABI version 1). The FAT table names that slice
* `arm64e`; its physical identity is still compared field by field.
*/
const lipoNameMatches = (reported: string, observed: string): boolean =>
reported === observed ||
(observed === "arm64e" && /^arm64e\.[A-Za-z0-9_]+$/u.test(reported));
const parseSliceKeyInteger = (value: string | undefined): number | null => {
if (value === undefined || !/^\d+$/u.test(value)) return null;
const parsed = Number(value);