astrid-runtime/astrid · error

Required Cargo configuration include

Error message

Required Cargo configuration include {} does not exist

What it means

Fired by resolve_cargo_config_include when a non-optional include's file does not exist (or canonicalization fails otherwise). Optional includes that are missing are silently skipped; required ones fail closed.

Solutions

  1. Create the missing config file at the referenced path
  2. Fix the include path or remove the directive
  3. Mark it `optional = true` if its absence is acceptable
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/rust/config.rs:300 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/2e8ff42a6ba5859d. Report an issue: GitHub.

Appendix: source

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

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(|| {
                format!(
                    "Failed to resolve Cargo configuration include {}",
                    candidate.display()
                )
            });
        },
    };
    Ok(Some(resolved))
}

fn matching_target_rustflags(
    selected_target: Option<&str>,

View on GitHub (pinned to affd8760f4)