fix(native): keep the resolved bundle plist and permission failures
- Carry the Info.plist that declared the program file on the target as bundleInfoPlist, so inspect_plist defaults to it even when the program file is a symlink into another bundle directory. - Accept a readable Info.plist symlink, as reading the plist directly did. - Treat only a missing path as an absent layout or wrapper; a permission denial now reaches the resolver's permission-denied classification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
aeebba391e
commit
418a5562f6
@@ -713,14 +713,6 @@ const requireRegularPlist = async (
|
||||
}
|
||||
};
|
||||
|
||||
const isFile = async (path: string): Promise<boolean> => {
|
||||
try {
|
||||
return (await stat(path)).isFile();
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const resolvePlistPath = async (
|
||||
target: BinaryTarget,
|
||||
requested: string | undefined,
|
||||
@@ -732,17 +724,9 @@ const resolvePlistPath = async (
|
||||
const sourceMetadata = await stat(source);
|
||||
const root = sourceMetadata.isDirectory() ? source : dirname(target.path);
|
||||
if (requested !== undefined) return ok(resolve(root, requested));
|
||||
const macOS = resolve(root, "Contents/Info.plist");
|
||||
// iOS-style bundles, including the one inside an iOS-on-Mac wrapper, keep
|
||||
// Info.plist beside the program file the target resolved to.
|
||||
const beside = resolve(dirname(target.path), "Info.plist");
|
||||
return ok(
|
||||
sourceMetadata.isDirectory() &&
|
||||
!(await isFile(macOS)) &&
|
||||
(await isFile(beside))
|
||||
? beside
|
||||
: macOS,
|
||||
);
|
||||
// A bundle target records the Info.plist its program file was declared
|
||||
// in: Contents/Info.plist, or the root plist of an iOS-style bundle.
|
||||
return ok(target.bundleInfoPlist ?? resolve(root, "Contents/Info.plist"));
|
||||
} catch (cause: unknown) {
|
||||
return err(
|
||||
new ProviderAdapterError(IDENTITY.id, "inspect_plist", { cause }),
|
||||
|
||||
Reference in New Issue
Block a user