{"record":{"id":"60c34f62813fa469","repo":"BigPizzaV3/CodexPlusPlus","slug":"macos-app-bundles-are-only-supported-on-macos","errorCode":null,"errorMessage":"macOS app bundles are only supported on macOS","messagePattern":"macOS app bundles are only supported on macOS","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/install/macos.rs","lineNumber":100,"sourceCode":"    write_bundle(&build_app_bundle(options, true))?;\n    Ok(())\n}\n\n#[cfg(target_os = \"macos\")]\npub fn uninstall_app_bundles(options: &InstallOptions) -> anyhow::Result<()> {\n    let install_root = install_root_or_default(options);\n    for name in [SILENT_NAME, MANAGER_NAME] {\n        let app = install_root.join(format!(\"{name}.app\"));\n        if app.exists() {\n            fs::remove_dir_all(app)?;\n        }\n    }\n    Ok(())\n}\n\n#[cfg(not(target_os = \"macos\"))]\npub fn install_app_bundles(_options: &InstallOptions) -> anyhow::Result<()> {\n    anyhow::bail!(\"macOS app bundles are only supported on macOS\")\n}\n\n#[cfg(not(target_os = \"macos\"))]\npub fn uninstall_app_bundles(_options: &InstallOptions) -> anyhow::Result<()> {\n    anyhow::bail!(\"macOS app bundles are only supported on macOS\")\n}\n\n#[cfg(target_os = \"macos\")]\nfn write_bundle(bundle: &MacosAppBundle) -> anyhow::Result<()> {\n    let contents = bundle.app_path.join(\"Contents\");\n    let macos = contents.join(\"MacOS\");\n    let resources = contents.join(\"Resources\");\n    fs::create_dir_all(&macos)?;\n    fs::create_dir_all(&resources)?;\n    fs::write(contents.join(\"Info.plist\"), &bundle.info_plist)?;\n    if let (Some(source), Some(target_name)) = (&bundle.binary_source, &bundle.binary_target_name) {\n        validate_binary_source(source)?;\n        let target = macos.join(target_name);","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/install/macos.rs#L82-L118","documentation":"install_app_bundles creates macOS .app bundles. On non-macOS builds the crate compiles a stub version (#[cfg(not(target_os = \"macos\"))]) that unconditionally fails, because .app bundles and their Info.plist/launch-script layout only exist on macOS. This is a compile-time platform gate, not a runtime misconfiguration.","triggerScenarios":"Calling install_app_bundles from any non-macOS target (Linux, Windows) — the cfg stub is what gets compiled and it always bails.","commonSituations":"Running the installer on a Linux CI box; cross-platform code paths calling macOS bundle installation without an OS check; developers testing installer logic locally on Windows/Linux.","solutions":["Only call install_app_bundles when cfg!(target_os = \"macos\")","Use the platform-appropriate install path for the current OS (e.g. Linux desktop entries / Windows shortcuts)","Skip bundle installation with a graceful message on non-macOS hosts"],"exampleFix":"// before\ninstall_app_bundles(&options)?; // crashes on Linux\n// after\nif cfg!(target_os = \"macos\") {\n    install_app_bundles(&options)?;\n} else {\n    println!(\"app bundles are macOS-only; skipped\");\n}","handlingStrategy":"fallback","validationCode":"let supported = cfg!(target_os = \"macos\");","typeGuard":"fn supports_app_bundles() -> bool { cfg!(target_os = \"macos\") }","tryCatchPattern":"match install_app_bundles(&opts) { Err(e) if e.to_string().contains(\"only supported on macOS\") => skip_bundle_install(), Err(e) => return Err(e), Ok(()) => {} }","preventionTips":["Gate platform-specific installers behind target_os checks","Document platform requirements in the install API","Provide per-OS install implementations and dispatch at startup"],"tags":["platform","macos","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}