{"record":{"id":"295a9752dd053730","repo":"GraphiteEditor/Graphite","slug":"failed-to-copy-icon-file","errorCode":null,"errorMessage":"failed to copy icon file","messagePattern":"failed to copy icon file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"desktop/bundle/src/mac.rs","lineNumber":60,"sourceCode":"\n\tcreate_app(&app_dir, APP_ID, APP_NAME, app_bin, false);\n\n\tfor helper_type in [None, Some(\"GPU\"), Some(\"Renderer\")] {\n\t\tlet helper_id_suffix = helper_type.map(|t| format!(\".{t}\")).unwrap_or_default();\n\t\tlet helper_id = format!(\"{APP_ID}.helper{helper_id_suffix}\");\n\t\tlet helper_name_suffix = helper_type.map(|t| format!(\" ({t})\")).unwrap_or_default();\n\t\tlet helper_name = format!(\"{APP_NAME} Helper{helper_name_suffix}\");\n\t\tlet helper_app_dir = app_dir.join(FRAMEWORKS_PATH).join(&helper_name).with_extension(\"app\");\n\t\tcreate_app(&helper_app_dir, &helper_id, &helper_name, helper_bin, true);\n\t}\n\n\tcopy_dir(&cef_path().join(CEF_FRAMEWORK), &app_dir.join(FRAMEWORKS_PATH).join(CEF_FRAMEWORK));\n\n\tlet resource_dir = app_dir.join(RESOURCES_PATH);\n\tfs::create_dir_all(&resource_dir).expect(\"failed to create app resource dir\");\n\n\tlet icon_file = workspace_path().join(\"branding/app-icons\").join(ICONS_FILE_NAME);\n\tfs::copy(icon_file, resource_dir.join(ICONS_FILE_NAME)).expect(\"failed to copy icon file\");\n\n\tapp_dir\n}\n\nfn create_app(app_dir: &Path, id: &str, name: &str, bin: &Path, is_helper: bool) {\n\tfs::create_dir_all(app_dir.join(EXEC_PATH)).unwrap();\n\n\tlet app_contents_dir: &Path = &app_dir.join(\"Contents\");\n\tcreate_info_plist(app_contents_dir, id, name, is_helper).unwrap();\n\tfs::copy(bin, app_dir.join(EXEC_PATH).join(name)).unwrap();\n}\n\nfn create_info_plist(dir: &Path, id: &str, exec_name: &str, is_helper: bool) -> Result<(), Box<dyn std::error::Error>> {\n\tlet info = InfoPlist {\n\t\tcf_bundle_name: exec_name.to_string(),\n\t\tcf_bundle_identifier: id.to_string(),\n\t\tcf_bundle_display_name: exec_name.to_string(),\n\t\tcf_bundle_executable: exec_name.to_string(),","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/desktop/bundle/src/mac.rs#L42-L78","documentation":"Panic in the macOS bundler when fs::copy cannot copy the application icon (branding/app-icons/<ICONS_FILE_NAME>, an .icns file) into the freshly created Contents/Resources directory. fs::copy fails when the source icon file does not exist, when the source or destination path is unreadable/unwritable, or when the workspace root was resolved incorrectly so the source path points outside the repo.","triggerScenarios":"The branding icon asset (branding/app-icons/<ICONS_FILE_NAME>) is missing from the checkout or was never generated; workspace_path() resolves to a wrong root because the bundler binary was run from outside the Cargo workspace; Resources became unwritable between creation and copy.","commonSituations":"Fresh clone or shallow checkout that lacks the generated icon artifact; skipping the branding/icon generation step; moving or running the compiled bundler binary from an absolute path that breaks the relative workspace resolution; read-only build directory.","solutions":["Verify branding/app-icons/<ICONS_FILE_NAME> exists in the repo root and regenerate it via the branding workflow if missing","Run the bundler through cargo from the workspace root so workspace_path() resolves correctly","Check read permission on the icon file and write permission on the Resources directory","Delete a stale or corrupted .app output and re-run the bundler"],"exampleFix":"// before\nfs::copy(icon_file, resource_dir.join(ICONS_FILE_NAME)).expect(\"failed to copy icon file\");\n\n// after\nfs::copy(&icon_file, resource_dir.join(ICONS_FILE_NAME)).unwrap_or_else(|e| panic!(\"failed to copy icon file from {}: {e}\", icon_file.display()));","handlingStrategy":"validation","validationCode":"// Before copying, assert the icon source exists and is readable\nlet icon_file = workspace_path().join(\"branding/app-icons\").join(ICONS_FILE_NAME);\nif !icon_file.is_file() {\n\teprintln!(\"missing icon asset: {} (run the branding icon generation step)\", icon_file.display());\n\tstd::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate and commit (or generate in CI before bundling) the branding icon assets","Run the bundler via cargo from the workspace root so workspace_path() resolves to the repo","Include the source path in the error message so a missing asset is obvious"],"tags":["rust","macos","app-bundling","assets","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}