dbt-labs/dbt-core · error

failed to spawn `make`

Error message

failed to spawn `make`

What it means

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.

Source

Thrown at crates/dbt-adbc/src/driver.rs:233

        Ok(s) => s.code() == Some(1),
        Err(e) if e.kind() == ErrorKind::NotFound => {
            eprintln!("`make` not found, skipping rebuild");
            false
        }
        Err(e) => {
            return Err(Error::with_message_and_status(
                format!("failed to spawn `make -q`: {e}"),
                Status::Internal,
            ));
        }
    };

    if needs_rebuild {
        let status = Command::new("make")
            .arg("-C")
            .arg(dir)
            .status()
            .expect("failed to spawn `make`");

        if !status.success() {
            return Err(Error::with_message_and_status(
                format!("`make` failed in {}", dir.display()),
                Status::Internal,
            ));
        }
    }
    Ok(())
}

/// Searches for subpath starting at `start` and continuing upward through its parents.
///
/// Always checks start. `max_hops = 0` checks `start` only.
/// does not canonicalize
pub fn find_upward_dir(start: &Path, subpath: &Path, max_hops: usize) -> Option<PathBuf> {
    if subpath.is_absolute() {
        return None;

View on GitHub (pinned to 0267ce9170)

Solutions

  1. 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.
  2. Set DISABLE_AUTO_DRIVER_REBUILD=1 to skip the rebuild path entirely.
  3. 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.
  4. Verify `make` is on PATH (`which make`) in the environment running the build.

Example fix

// before
let status = Command::new("make")
    .arg("-C")
    .arg(dir)
    .status()
    .expect("failed to spawn `make`");
// after
let status = match Command::new("make").arg("-C").arg(dir).status() {
    Ok(s) => s,
    Err(e) if e.kind() == ErrorKind::NotFound => {
        eprintln!("`make` not found, skipping rebuild");
        return Ok(());
    }
    Err(e) => return Err(Error::with_message_and_status(
        format!("failed to spawn `make`: {e}"), Status::Internal)),
};
Defensive patterns

Strategy: fallback

Validate before calling

if which("make").is_err() {
    eprintln!("make unavailable; using CDN driver cache");
    // ensure DISABLE_CDN_DRIVER_CACHE is unset
}

Type guard

fn can_rebuild(dir: &Path) -> bool {
    which("make").is_ok() && dir.is_dir()
}

Try / catch

match Command::new("make").arg("-C").arg(dir).status() {
    Ok(s) if s.success() => {},
    Ok(s) => return Err(make_failed(dir, s)),
    Err(e) if e.kind() == ErrorKind::NotFound => return Ok(()), // skip like the -q probe
    Err(e) => return Err(spawn_failed(e)),
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/f06139e9cb37c94e. Report an issue: GitHub.