{"record":{"id":"25d99c8eeeebfea8","repo":"a-b-street/abstreet","slug":"couldn-t-find-the-executable-is-it-built","errorCode":null,"errorMessage":"Couldn't find the {} executable. Is it built?","messagePattern":"Couldn't find the (.+?) executable\\. Is it built\\?","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_gui/src/tools/mod.rs","lineNumber":419,"sourceCode":"        // Apparently std::path on Windows doesn't do any of this correction. We could build up a\n        // PathBuf properly, I guess\n        let path = if cfg!(windows) {\n            format!(\"{}/{}.exe\", dir, cmd).replace(\"/\", \"\\\\\")\n        } else {\n            format!(\"{}/{}\", dir, cmd)\n        };\n        if let Ok(metadata) = fs_err::metadata(&path) {\n            if metadata.is_file() {\n                return path;\n            } else {\n                debug!(\n                    \"found matching path: {}/{} but it's not a file.\",\n                    &path, cmd\n                );\n            }\n        }\n    }\n    panic!(\"Couldn't find the {} executable. Is it built?\", cmd);\n}\n\n/// A button to change maps, with default keybindings\npub fn change_map_btn(ctx: &EventCtx, app: &dyn AppLike) -> Widget {\n    ctx.style()\n        .btn_popup_icon_text(\n            \"system/assets/tools/map.svg\",\n            nice_map_name(app.map().get_name()),\n        )\n        .hotkey(lctrl(Key::L))\n        .build_widget(ctx, \"change map\")\n}\n\n/// A button to return to the title screen\npub fn home_btn(ctx: &EventCtx) -> Widget {\n    ctx.style()\n        .btn_plain\n        .btn()","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_gui/src/tools/mod.rs#L401-L437","documentation":"find_exe locates an external executable that map_gui tools depend on, checking configured paths and the current binary's directory. If the command is found as a matching path but isn't a file, or no matching path is found at all, it panics with \"Couldn't find the {cmd} executable. Is it built?\". The message hints that the repo's own companion binary (e.g. updater, release helper) hasn't been compiled yet.","triggerScenarios":"Invoking a map_gui tool (release/upload/change-detection features) that calls find_exe(cmd) when the companion binary hasn't been built, was built for the wrong target, or sits outside the searched directories.","commonSituations":"Running only `cargo build` for one crate so sibling binaries in the workspace never got compiled; running the app outside target/release so relative lookup paths break; cross-compiling so the expected target-triple directory differs; tools invoked from a packaged binary without bundling the helper executables.","solutions":["Build the missing executable (usually `cargo build --release` for the whole workspace so sibling binaries exist).","Run the app from the directory containing the built binaries, or place the executable on PATH / in the expected search location.","Ensure the built binary matches your platform/target triple (no cross-compile mismatch).","If packaging, bundle the helper executables alongside the main binary."],"exampleFix":"// before\n./target/release/map_gui --release-tool   # updater binary never built\n// after\ncargo build --release --workspace\n./target/release/map_gui --release-tool","handlingStrategy":"validation","validationCode":"let exe = \"updater\";\nassert!(which::which(exe).is_ok() || std::path::Path::new(\"target/release\").join(exe).is_file(),\n        \"{} not built; run cargo build --release --workspace\", exe);","typeGuard":null,"tryCatchPattern":"// Panics uncatchably; probe for the executable before invoking the tool:\nif !std::path::Path::new(\"target/release/updater\").is_file() {\n    eprintln!(\"helper binary missing; skipping tool\");\n    return;\n}","preventionTips":["Build the full workspace (`cargo build --release`) before using release/tooling features.","Run binaries from the target directory so sibling executable lookup works.","In packaged deployments, bundle every helper executable find_exe may look for."],"tags":["panic","executable-not-found","build","tooling"],"backgroundTag":"missing-dependency","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}