rust-lang/cargo · warning

ignoring `build.fingerprint = "content"` without `-Zchecksum

Error message

ignoring `build.fingerprint = "content"` without `-Zchecksum-freshness`

What it means

This is a warning emitted during compilation when the manifest sets `build.fingerprint = "content"` but the `-Zchecksum-freshness` unstable feature flag is not enabled. The content-based fingerprinting mode is gated behind nightly/unstable flags, so without the flag the setting is ignored and mtime-based freshness checking is used instead. It signals a configuration/unstable-feature mismatch rather than a build failure.

Source

Thrown at src/compiler/mod.rs:210

        return Ok(());
    }

    let lock = if build_runner.bcx.gctx.cli_unstable().fine_grain_locking {
        Some(build_runner.lock_manager.lock_shared(build_runner, unit)?)
    } else {
        None
    };

    match build_runner
        .bcx
        .gctx
        .build_config()?
        .fingerprint
        .unwrap_or_default()
    {
        FingerprintMethod::Content => {
            if !build_runner.bcx.gctx.cli_unstable().checksum_freshness {
                build_runner.bcx.gctx.shell().warn(
                    r#"ignoring `build.fingerprint = "content"` without `-Zchecksum-freshness`"#,
                )?;
            }
        }
        FingerprintMethod::Mtime => {}
    }

    // If we are in `--compile-time-deps` and the given unit is not a compile time
    // dependency, skip compiling the unit and jumps to dependencies, which still
    // have chances to be compile time dependencies
    if !unit.skip_non_compile_time_dep {
        // Build up the work to be done to compile this unit, enqueuing it once
        // we've got everything constructed.
        fingerprint::prepare_init(build_runner, unit)?;

        let job = if unit.mode.is_run_custom_build() {
            custom_build::prepare(build_runner, unit)?
        } else if unit.mode.is_doc_test() {

View on GitHub (pinned to 42eee92bc9)

Solutions

  1. Enable the unstable flag: use a nightly toolchain and pass `-Zchecksum-freshness` (e.g. `cargo +nightly build -Zchecksum-freshness` or add it to RUSTFLAGS/config).
  2. If you don't need content-based freshness checking, remove `fingerprint = "content"` from the `[build]` section so the default mtime behavior applies without a warning.
  3. If the flag must be used routinely, pin it in `.cargo/config.toml` under the appropriate unstable configuration or in CI so all invocations include it.
  4. Verify with `rustc +nightly -vV` / `cargo +nightly --version` that you are actually on nightly, since -Z flags are rejected or ignored on stable.

Example fix

# before (Cargo.toml)
[build]
fingerprint = "content"

# invoked as:
cargo build

# after — either enable the flag:
cargo +nightly build -Zchecksum-freshness

# or drop the setting:
# (remove the [build] fingerprint line entirely)
Defensive patterns

Strategy: validation

Validate before calling

// Before building, check the manifest and toolchain agree:
use std::process::Command;

fn fingerprint_requires_flag(cargo_toml: &str) -> bool {
    cargo_toml.contains("fingerprint") && cargo_toml.contains("content")
}

fn is_nightly() -> bool {
    let out = Command::new("rustc").arg("-vV").output().unwrap();
    String::from_utf8_lossy(&out.stdout).contains("-nightly")
}

// guard: if fingerprint_requires_flag(&manifest) { assert!(is_nightly()); }
// and pass -Zchecksum-freshness in the cargo invocation.

Prevention

When it happens

Trigger: Setting `[build] fingerprint = "content"` in Cargo.toml (or the equivalent config) and then compiling with a toolchain that does not have `-Zchecksum-freshness` enabled (e.g. stable Cargo, or nightly without RUSTFLAGS="-Zchecksum-freshness" / the flag not passed via the CLI). The warning is emitted from the compile path whenever `build_runner.bcx.gctx.cli_unstable().checksum_freshness` is false and the resolved FingerprintMethod is Content.

Common situations: Copying a Cargo.toml from a project or CI pipeline that relies on content-based fingerprinting into an environment running stable Rust; upgrading/downgrading toolchains so the previously-enabled unstable flag is no longer passed; enabling the setting in .cargo/config.toml for the wrong profile; teammates on stable hitting the warning after one contributor added the setting.

Related errors


AI-assisted analysis of rust-lang/cargo@42eee92bc9 (2026-08-27). Data as JSON: /api/errors/a0842010cf68a81a. Report an issue: GitHub.