From 6b99236c36b8f2549ab87334f718310f597ddcba Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 8 Oct 2026 19:55:51 +0800 Subject: [PATCH] fix(apple): disclose untraversed cache dependencies in trace results --- src/domain/apple/dylibResolution.test.ts | 3 +++ src/domain/apple/dylibResolution.ts | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/domain/apple/dylibResolution.test.ts b/src/domain/apple/dylibResolution.test.ts index 93916825b..e69073bac 100644 --- a/src/domain/apple/dylibResolution.test.ts +++ b/src/domain/apple/dylibResolution.test.ts @@ -584,6 +584,9 @@ describe("shared cache resolution", () => { ]); expect(trace.images.map(({ path }) => path)).toEqual([MAIN]); expect(trace.coverage.status).toBe("complete"); + expect(trace.limitations).toContainEqual( + expect.stringContaining("transitive dependencies were not traversed"), + ); expect(trace.limitations).toContainEqual( expect.stringContaining( "looked up only in the supplied dyld shared cache", diff --git a/src/domain/apple/dylibResolution.ts b/src/domain/apple/dylibResolution.ts index dc47979fd..78f7872e2 100644 --- a/src/domain/apple/dylibResolution.ts +++ b/src/domain/apple/dylibResolution.ts @@ -418,6 +418,15 @@ export const traceDylibLoading = async ( limitations: [ ...DYLIB_RESOLUTION_LIMITATIONS, ...sharedCacheLimitations(request.sharedCache, unserved), + ...(edges.some( + (edge) => + edge.command !== "LC_LAZY_LOAD_DYLIB" && + edge.candidates.some(({ outcome }) => outcome === "shared-cache"), + ) + ? [ + "Cache-backed images are leaf references: their load commands and transitive dependencies were not traversed. Complete coverage describes the selected roots and in-root images, not a complete process-wide dependency graph. Use inspect_dyld_shared_cache with selected images to inspect cached load commands.", + ] + : []), ...(environmentRoots.length === 0 ? [] : [