{"record":{"id":"890fb0e3fcc50677","repo":"tauri-apps/tauri","slug":"failed-to-chmod-script","errorCode":null,"errorMessage":"Failed to chmod script","messagePattern":"Failed to chmod script","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/macos/dmg/mod.rs","lineNumber":99,"sourceCode":"  write(&bundle_script_path, include_str!(\"./bundle_dmg\"))?;\n  write(\n    support_directory_path.join(\"template.applescript\"),\n    include_str!(\"./template.applescript\"),\n  )?;\n  write(\n    support_directory_path.join(\"eula-resources-template.xml\"),\n    include_str!(\"./eula-resources-template.xml\"),\n  )?;\n\n  // chmod script for execution\n  Command::new(\"chmod\")\n    .arg(\"777\")\n    .arg(&bundle_script_path)\n    .current_dir(&output_path)\n    .stdout(Stdio::piped())\n    .stderr(Stdio::piped())\n    .output()\n    .expect(\"Failed to chmod script\");\n\n  let dmg_settings = settings.dmg();\n\n  let app_position = &dmg_settings.app_position;\n  let application_folder_position = &dmg_settings.application_folder_position;\n  let window_size = &dmg_settings.window_size;\n\n  let app_position_x = app_position.x.to_string();\n  let app_position_y = app_position.y.to_string();\n  let application_folder_position_x = application_folder_position.x.to_string();\n  let application_folder_position_y = application_folder_position.y.to_string();\n  let window_size_width = window_size.width.to_string();\n  let window_size_height = window_size.height.to_string();\n\n  let mut bundle_dmg_cmd = Command::new(&bundle_script_path);\n\n  bundle_dmg_cmd.args([\n    \"--volname\",","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs#L81-L117","documentation":"As part of DMG creation on macOS, the bundler writes a bundle script and then runs chmod 777 <script> to make it executable. The expect fires when the chmod child process cannot be spawned or exits unsuccessfully.","triggerScenarios":"tauri build --bundles dmg when chmod is unreachable (PATH scrubbed in CI or a sandbox without coreutils), when bundle_script_path or output_path was deleted between writing and chmodding, or when the filesystem denies the permission change (read-only or locked mount).","commonSituations":"CI images with a minimal PATH; hardened runners/sandboxes that block spawning shell utilities; antivirus or file watchers locking the script; output directory on a read-only volume.","solutions":["Verify chmod resolves in the build environment: command -v chmod (normally /bin/chmod on macOS)","Re-run tauri build --bundles dmg from a clean target directory so the script is freshly written before chmod runs","Ensure target/release/bundle/dmg/ sits on a writable filesystem and is not locked by another process","For hardened runners, disable sandboxing for the bundling step or ensure /usr/bin:/bin is on PATH"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# before DMG bundling, assert the tool exists in the build environment\ncommand -v chmod >/dev/null || { echo 'chmod not on PATH — DMG bundling requires it'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep /usr/bin:/bin on PATH in CI steps that bundle DMGs","Do not clean or lock the bundle output directory while the bundler runs","Run bundling on a writable volume, not a read-only mount"],"tags":["macos","dmg","chmod","permissions","tauri-bundler"],"backgroundTag":"process-execution-failure","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}