From 3275f1af7dd221f49a9c186e34ceb5a6549fe25a Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Fri, 6 Sep 2024 12:26:47 -0700 Subject: [PATCH] docs: rust: Improve wording about adding Cargo.lock to src Improved the wording about adding the Cargo.lock file to src. It was not clear when this operation was necessary. --- doc/languages-frameworks/rust.section.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 15f16879a5b4..4286778c3f4f 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -162,9 +162,10 @@ rustPlatform.buildRustPackage { } ``` -Note that setting `cargoLock.lockFile` or `cargoLock.lockFileContents` -doesn't add a `Cargo.lock` to your `src`, and a `Cargo.lock` is still -required to build a rust package. A simple fix is to use: +If the upstream source repository lacks a `Cargo.lock` file, you must add one +to `src`, as it is essential for building a Rust package. Setting +`cargoLock.lockFile` or `cargoLock.lockFileContents` will not automatically add +a `Cargo.lock` file to `src`. A straightforward solution is to use: ```nix {