{"record":{"id":"a0842010cf68a81a","repo":"rust-lang/cargo","slug":"ignoring-build-fingerprint-content-without","errorCode":null,"errorMessage":"ignoring `build.fingerprint = \"content\"` without `-Zchecksum-freshness`","messagePattern":"ignoring `build\\.fingerprint = \"content\"` without `-Zchecksum-freshness`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/compiler/mod.rs","lineNumber":210,"sourceCode":"        return Ok(());\n    }\n\n    let lock = if build_runner.bcx.gctx.cli_unstable().fine_grain_locking {\n        Some(build_runner.lock_manager.lock_shared(build_runner, unit)?)\n    } else {\n        None\n    };\n\n    match build_runner\n        .bcx\n        .gctx\n        .build_config()?\n        .fingerprint\n        .unwrap_or_default()\n    {\n        FingerprintMethod::Content => {\n            if !build_runner.bcx.gctx.cli_unstable().checksum_freshness {\n                build_runner.bcx.gctx.shell().warn(\n                    r#\"ignoring `build.fingerprint = \"content\"` without `-Zchecksum-freshness`\"#,\n                )?;\n            }\n        }\n        FingerprintMethod::Mtime => {}\n    }\n\n    // If we are in `--compile-time-deps` and the given unit is not a compile time\n    // dependency, skip compiling the unit and jumps to dependencies, which still\n    // have chances to be compile time dependencies\n    if !unit.skip_non_compile_time_dep {\n        // Build up the work to be done to compile this unit, enqueuing it once\n        // we've got everything constructed.\n        fingerprint::prepare_init(build_runner, unit)?;\n\n        let job = if unit.mode.is_run_custom_build() {\n            custom_build::prepare(build_runner, unit)?\n        } else if unit.mode.is_doc_test() {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/rust-lang/cargo/blob/42eee92bc9aa4449f4e25d84e4ceb1cf8e0f87f9/src/compiler/mod.rs#L192-L228","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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).","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.","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.","Verify with `rustc +nightly -vV` / `cargo +nightly --version` that you are actually on nightly, since -Z flags are rejected or ignored on stable."],"exampleFix":"# before (Cargo.toml)\n[build]\nfingerprint = \"content\"\n\n# invoked as:\ncargo build\n\n# after — either enable the flag:\ncargo +nightly build -Zchecksum-freshness\n\n# or drop the setting:\n# (remove the [build] fingerprint line entirely)","handlingStrategy":"validation","validationCode":"// Before building, check the manifest and toolchain agree:\nuse std::process::Command;\n\nfn fingerprint_requires_flag(cargo_toml: &str) -> bool {\n    cargo_toml.contains(\"fingerprint\") && cargo_toml.contains(\"content\")\n}\n\nfn is_nightly() -> bool {\n    let out = Command::new(\"rustc\").arg(\"-vV\").output().unwrap();\n    String::from_utf8_lossy(&out.stdout).contains(\"-nightly\")\n}\n\n// guard: if fingerprint_requires_flag(&manifest) { assert!(is_nightly()); }\n// and pass -Zchecksum-freshness in the cargo invocation.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep unstable-feature settings in Cargo.toml synchronized with the -Z flags passed in CI/scripts and document the nightly requirement in the README.","Centralize cargo invocations in a justfile/Makefile/CI template so flags like -Zchecksum-freshness are never omitted.","Add a CI check that fails when the manifest uses gated settings but the toolchain is stable, turning the silent downgrade into a hard error.","When upgrading toolchains, grep the manifest and .cargo/config.toml for `[build]` settings gated behind unstable flags."],"tags":["cargo","unstable-feature","build-config","fingerprint","nightly-only"],"backgroundTag":"unstable-feature-flag-required","analyzedSha":"42eee92bc9aa4449f4e25d84e4ceb1cf8e0f87f9","analyzedAt":"2026-08-27T12:34:59.105Z","contentChangedAt":"2026-08-27T12:34:59.105Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}