{"record":{"id":"f06139e9cb37c94e","repo":"dbt-labs/dbt-core","slug":"failed-to-spawn-make","errorCode":null,"errorMessage":"failed to spawn `make`","messagePattern":"failed to spawn `make`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adbc/src/driver.rs","lineNumber":233,"sourceCode":"        Ok(s) => s.code() == Some(1),\n        Err(e) if e.kind() == ErrorKind::NotFound => {\n            eprintln!(\"`make` not found, skipping rebuild\");\n            false\n        }\n        Err(e) => {\n            return Err(Error::with_message_and_status(\n                format!(\"failed to spawn `make -q`: {e}\"),\n                Status::Internal,\n            ));\n        }\n    };\n\n    if needs_rebuild {\n        let status = Command::new(\"make\")\n            .arg(\"-C\")\n            .arg(dir)\n            .status()\n            .expect(\"failed to spawn `make`\");\n\n        if !status.success() {\n            return Err(Error::with_message_and_status(\n                format!(\"`make` failed in {}\", dir.display()),\n                Status::Internal,\n            ));\n        }\n    }\n    Ok(())\n}\n\n/// Searches for subpath starting at `start` and continuing upward through its parents.\n///\n/// Always checks start. `max_hops = 0` checks `start` only.\n/// does not canonicalize\npub fn find_upward_dir(start: &Path, subpath: &Path, max_hops: usize) -> Option<PathBuf> {\n    if subpath.is_absolute() {\n        return None;","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adbc/src/driver.rs#L215-L251","documentation":"Panic from `.expect(\"failed to spawn `make`\")` on `Command::new(\"make\").arg(\"-C\").arg(dir).status()` in `rebuild_drivers` (crates/dbt-adbc/src/driver.rs:233). This debug-only path (cfg(debug_assertions)) rebuilds ADBC drivers when DISABLE_CDN_DRIVER_CACHE is set; the panic fires when the `make` process cannot be started at all — typically the binary does not exist, is not executable, or the working dir is invalid. Note the earlier `make -q` probe handles ErrorKind::NotFound gracefully, but the actual rebuild call does not, so a make that disappears (or other spawn errors like permission/PATH issues) panics instead of degrading.","triggerScenarios":"Debug build + DISABLE_CDN_DRIVER_CACHE set + DISABLE_AUTO_DRIVER_REBUILD unset + drivers need rebuild (`make -q` exit code 1), and the second `Command::new(\"make\").status()` returns Err — e.g. make not found on PATH mid-run, EACCES on the binary, or a spawn failure other than the handled NotFound case in the probe (this call has no NotFound handling at all).","commonSituations":"Building in a minimal/CI container without make installed while driver caching is disabled; PATH stripped in the build environment; cross-compiling where make targets a directory that no longer exists; Windows environments where make is unavailable.","solutions":["Install make (apt-get install make / xcode-select --install) or unset DISABLE_CCD... i.e. unset DISABLE_CDN_DRIVER_CACHE so prebuilt CDN drivers are used instead of rebuilding.","Set DISABLE_AUTO_DRIVER_REBUILD=1 to skip the rebuild path entirely.","Handle ErrorKind::NotFound in this second Command call exactly like the `make -q` probe above it, printing 'make not found, skipping rebuild' instead of panicking.","Verify `make` is on PATH (`which make`) in the environment running the build."],"exampleFix":"// before\nlet status = Command::new(\"make\")\n    .arg(\"-C\")\n    .arg(dir)\n    .status()\n    .expect(\"failed to spawn `make`\");\n// after\nlet status = match Command::new(\"make\").arg(\"-C\").arg(dir).status() {\n    Ok(s) => s,\n    Err(e) if e.kind() == ErrorKind::NotFound => {\n        eprintln!(\"`make` not found, skipping rebuild\");\n        return Ok(());\n    }\n    Err(e) => return Err(Error::with_message_and_status(\n        format!(\"failed to spawn `make`: {e}\"), Status::Internal)),\n};","handlingStrategy":"fallback","validationCode":"if which(\"make\").is_err() {\n    eprintln!(\"make unavailable; using CDN driver cache\");\n    // ensure DISABLE_CDN_DRIVER_CACHE is unset\n}","typeGuard":"fn can_rebuild(dir: &Path) -> bool {\n    which(\"make\").is_ok() && dir.is_dir()\n}","tryCatchPattern":"match Command::new(\"make\").arg(\"-C\").arg(dir).status() {\n    Ok(s) if s.success() => {},\n    Ok(s) => return Err(make_failed(dir, s)),\n    Err(e) if e.kind() == ErrorKind::NotFound => return Ok(()), // skip like the -q probe\n    Err(e) => return Err(spawn_failed(e)),\n}","preventionTips":["Do not set DISABLE_CDN_DRIVER_CACHE in environments without make.","Set DISABLE_AUTO_DRIVER_REBUILD=1 in minimal CI images.","Mirror the NotFound handling from the `make -q` probe in the rebuild call.","Keep prebuilt drivers cached so the rebuild path is rarely exercised."],"tags":["rust","build","make","process-spawn","adbc"],"backgroundTag":"command-not-found","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}