{"record":{"id":"7a2399b1008baa0d","repo":"gitbutlerapp/gitbutler","slug":"dot-graphviz-must-be-installed-on-the-system","errorCode":null,"errorMessage":"'dot' (graphviz) must be installed on the system","messagePattern":"'dot' \\(graphviz\\) must be installed on the system","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but-graph/src/debug.rs","lineNumber":372,"sourceCode":"    #[tracing::instrument(skip(self))]\n    pub fn open_as_svg(&self) {\n        use std::{io::Write, process::Stdio, sync::atomic::AtomicUsize};\n\n        static SUFFIX: AtomicUsize = AtomicUsize::new(0);\n        let suffix = SUFFIX.fetch_add(1, std::sync::atomic::Ordering::SeqCst);\n        let svg_name = format!(\"debug-graph-{suffix:02}.svg\");\n        let svg_path = std::env::var_os(\"CARGO_MANIFEST_DIR\")\n            .map(std::path::PathBuf::from)\n            .unwrap_or_default()\n            .join(svg_name);\n        let mut dot = std::process::Command::new(\"dot\")\n            .args([\"-Tsvg\", \"-o\"])\n            .arg(&svg_path)\n            .stdin(Stdio::piped())\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped())\n            .spawn()\n            .expect(\"'dot' (graphviz) must be installed on the system\");\n        dot.stdin\n            .as_mut()\n            .unwrap()\n            .write_all(self.dot_graph_pruned().as_bytes())\n            .ok();\n        let mut out = dot.wait_with_output().unwrap();\n        out.stdout.extend(out.stderr);\n        assert!(\n            out.status.success(),\n            \"dot failed: {out}\",\n            out = out.stdout.as_bstr()\n        );\n\n        assert!(\n            std::process::Command::new(\"open\")\n                .arg(&svg_path)\n                .status()\n                .unwrap()","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-graph/src/debug.rs#L354-L390","documentation":"A panic (expect) in but-graph's debug visualization: spawning the external `dot` executable (Graphviz) failed, so the SVG debug-graph file cannot be produced. This code runs from tests/debug helpers that render the commit graph, and it assumes Graphviz is installed on PATH.","triggerScenarios":"Running but-graph debug/snapshot tests or debug output that calls the SVG writer on a machine without the graphviz package; PATH not including the directory containing `dot` in the test environment/CI.","commonSituations":"Fresh dev machines or minimal CI containers missing graphviz; nix/homebrew environments where graphviz is not in the shell's PATH for the test process; Windows without Graphviz installed.","solutions":["Install Graphviz (e.g. `brew install graphviz`, `apt install graphviz`, or the Windows installer).","Ensure `dot --version` works in the same environment the tests run in (CI PATH often differs from your shell).","Skip the SVG-producing debug path when visualization is not needed, if the API offers a toggle."],"exampleFix":"# before: CI fails with \"'dot' (graphviz) must be installed on the system\"\n# after: add to CI setup\napt-get update && apt-get install -y graphviz\ndot -V","handlingStrategy":"validation","validationCode":"# fail fast with a clear message instead of a panic mid-test\ncommand -v dot >/dev/null 2>&1 || { echo \"graphviz (dot) not installed\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add graphviz to dev-container/CI images alongside the Rust toolchain.","Verify `dot -V` inside the exact environment tests run in (PATH differs across shells/CI steps)."],"tags":["rust","graphviz","debug-tooling","missing-dependency","ci"],"backgroundTag":"missing-system-dependency","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}