{"record":{"id":"8561dc3c3d2b8e53","repo":"denoland/deno","slug":"plutil-could-not-read-cfbundleidentifier-from","errorCode":null,"errorMessage":"plutil could not read CFBundleIdentifier from {}: {}","messagePattern":"plutil could not read CFBundleIdentifier from (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":2688,"sourceCode":"  let browser_entitlements = locate_browser_entitlements(app_bundle);\n  codesign_one(app_bundle, identity, browser_entitlements.as_deref(), None)?;\n  Ok(())\n}\n\n/// Read `CFBundleIdentifier` out of `Contents/Info.plist` via `plutil`.\nfn read_bundle_identifier(app_bundle: &Path) -> Result<String, AnyError> {\n  let plist = app_bundle.join(\"Contents/Info.plist\");\n  let output = std::process::Command::new(\"plutil\")\n    .arg(\"-extract\")\n    .arg(\"CFBundleIdentifier\")\n    .arg(\"raw\")\n    .arg(\"-o\")\n    .arg(\"-\")\n    .arg(&plist)\n    .output()\n    .context(\"failed to invoke plutil(1) to read CFBundleIdentifier\")?;\n  if !output.status.success() {\n    bail!(\n      \"plutil could not read CFBundleIdentifier from {}: {}\",\n      plist.display(),\n      String::from_utf8_lossy(&output.stderr).trim(),\n    );\n  }\n  let id = String::from_utf8_lossy(&output.stdout).trim().to_string();\n  if id.is_empty() {\n    bail!(\"CFBundleIdentifier is empty in {}\", plist.display());\n  }\n  Ok(id)\n}\n\n/// Cheap Mach-O sniff: a Mach-O file starts with one of the well-known\n/// magic numbers (32-bit, 64-bit, fat — both endians). Used to skip\n/// non-binaries inside `Contents/MacOS/` (shell launchers, update\n/// sentinels) before passing them to `codesign(1)`, which would reject\n/// them and abort the signing pass.\nfn is_macho_file(path: &Path) -> bool {","sourceCodeStart":2670,"sourceCodeEnd":2706,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L2670-L2706","documentation":"read_bundle_identifier runs `plutil -extract CFBundleIdentifier raw -o - <bundle>/Contents/Info.plist` and bails when plutil exits non-zero, including plutil's stderr in the message. plutil fails this way when the plist is missing, malformed/truncated, or the CFBundleIdentifier key is absent — the .app bundle is not in a readable state.","triggerScenarios":"The app bundle's Contents/Info.plist is corrupt or truncated (interrupted copy, disk-full during staging), the CFBundleIdentifier key was removed, or the directory being processed isn't a real .app bundle. Reached from codesigning and helper-rebinding flows that call read_bundle_identifier.","commonSituations":"A partially downloaded/mirrored laufey.app or a bundle mangled by manual plist edits; aggressive antivirus/backup tools altering files inside the bundle; a previous build step crashed mid-copy.","solutions":["Run `plutil -lint <bundle>/Contents/Info.plist` to see the exact parse error.","Restore a valid Info.plist — re-run the desktop build, or re-download the laufey bundle so staging starts clean.","Confirm the plist actually contains a CFBundleIdentifier key (plutil errors on extracting a missing key)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Before building/signing, verify the plist parses\nplutil -lint \"$APP_BUNDLE/Contents/Info.plist\"\nplutil -extract CFBundleIdentifier raw -o - \"$APP_BUNDLE/Contents/Info.plist\" >/dev/null || echo \"missing CFBundleIdentifier\"","typeGuard":null,"tryCatchPattern":"// In build scripts that call read-plist-equivalent steps\ndeno desktop ... || {\n  echo \"bundle assembly failed — check Info.plist warnings above\";\n  exit 1;\n}","preventionTips":["Treat interrupted desktop builds as poisoned: delete the staged bundle and rebuild rather than reusing it.","Keep Info.plist generation entirely in the toolchain; never hand-edit inside a staged .app.","In CI, checksum-verify downloaded laufey bundles when the tooling exposes hashes."],"tags":["desktop","macos","plist","codesign","bundle"],"backgroundTag":"plist-read-failure","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}