From 5b0a3115c8ee42494ae0580b50702e090a017446 Mon Sep 17 00:00:00 2001 From: Robin Stumm Date: Wed, 22 Sep 2021 12:51:05 +0200 Subject: [PATCH] doc: rust: rephrase paragraph about `cargoLock.lockFileContents` mentioning that `Cargo.lock` cannot be patched in the `patchPhase` --- doc/languages-frameworks/rust.section.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index cb14a7726e42..b2f045b11b32 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -131,10 +131,10 @@ rustPlatform.buildRustPackage { This will retrieve the dependencies using fixed-output derivations from the specified lockfile. -Alternatively, `cargoLock.lockFileContents` can be set to a string of -the contents of a `Cargo.lock` file, for example if you need to -preprocess or generate the file as part of your build: - +One caveat is that `Cargo.lock` cannot be patched in the `patchPhase` +because it runs after the dependencies have already been fetched. If +you need to patch or generate the lockfile you can alternatively set +`cargoLock.lockFileContents` to a string of its contents: ```nix rustPlatform.buildRustPackage {