astrid-runtime/astrid · error

Cargo include path cannot be empty

Error message

Cargo include path cannot be empty

What it means

Validation helper guard in resolve_cargo_config_include: the include path string is empty. An empty path has no meaningful parent-relative resolution and would silently match nothing or the wrong directory, so it is rejected before path resolution. Fires from any string/array/table include form whose path value is "".

Solutions

  1. Provide a real relative path in the include directive
  2. Remove the empty include entry
  3. Fix the config file in the named location
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/rust/config.rs:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/030fc7fb9e67d68a. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-build/src/rust/config.rs:288

                    path.display()
                )
            })?,
        };
        return Ok(vec![resolve_cargo_config_include(path, include, optional)?]);
    }
    bail!(
        "Cargo include must be a string, array, or table in {}",
        path.display()
    )
}

fn resolve_cargo_config_include(
    including_file: &Path,
    include: &str,
    optional: bool,
) -> Result<Option<PathBuf>> {
    if include.is_empty() {
        bail!("Cargo include path cannot be empty");
    }
    let parent = including_file
        .parent()
        .context("Cargo configuration file has no parent directory")?;
    let candidate = parent.join(include);
    let resolved = match candidate.canonicalize() {
        Ok(path) => path,
        Err(error) if error.kind() == std::io::ErrorKind::NotFound && optional => {
            return Ok(None);
        },
        Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
            bail!(
                "Required Cargo configuration include {} does not exist",
                candidate.display()
            );
        },
        Err(error) => {
            return Err(error).with_context(|| {

View on GitHub (pinned to affd8760f4)