From fb28ec1537e2d02aaca96325483c849c5c8ade6f Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Tue, 13 Oct 2026 04:31:18 -0700 Subject: [PATCH] test(apple): keep the same-named slice dyld fixture openable on x64 hosts (#2755) Add a plain x86_64 slice to the dyld fixture while retaining both same-named arm64e slices and their independent environment assertions. The original fixture was rejected by real x64 CLI admission before tracing. The contributing PR's complete Linux CI run passes all 30 jobs, including the portable suite. Codex and Greptile reviews completed without findings; no unresolved threads remain. This restores the main test baseline needed for #2635. The change is limited to test data and preserves the original author's contribution. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> --- tests/boundary/cli/dylibResolutionCli.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/boundary/cli/dylibResolutionCli.test.ts b/tests/boundary/cli/dylibResolutionCli.test.ts index f6482a2f3..66fa21ba3 100644 --- a/tests/boundary/cli/dylibResolutionCli.test.ts +++ b/tests/boundary/cli/dylibResolutionCli.test.ts @@ -477,6 +477,7 @@ cliTest( "reports each same-named slice's own embedded dyld environment", async ({ cli }) => { // arm64e and arm64e.x1 slices both report the architecture name arm64e. + // A plain x86_64 slice keeps the bundle openable on x64 hosts. for (const [settings, expected] of [ [[null, "DYLD_PRINT_RPATHS=1"], ["DYLD_PRINT_RPATHS=1"]], [ @@ -486,8 +487,8 @@ cliTest( ] as const) { const app = await fixtureApp(); await writeFiles(app, { - "Contents/MacOS/App": fatImage( - [CPU.arm64e, CPU.arm64eX1].map((cpu, index) => { + "Contents/MacOS/App": fatImage([ + ...[CPU.arm64e, CPU.arm64eX1].map((cpu, index) => { const setting = settings[index]; return { cpu, @@ -500,7 +501,8 @@ cliTest( }), }; }), - ), + { cpu: CPU.x86_64, bytes: machoImage({ cpu: CPU.x86_64 }) }, + ]), }); const result = await cli.run({ arguments: [ @@ -516,7 +518,9 @@ cliTest( const trace = dylibResolutionResultSchema.parse( parseEvidence(result.json).normalized_result, ); - expect(trace.roots).toHaveLength(2); + expect( + trace.roots.filter(({ architecture }) => architecture === "arm64e"), + ).toHaveLength(2); const environments = trace.findings .filter(({ kind }) => kind === "dyld-environment-present") .map(({ explanation }) =>