diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/rust.section.md | 18 | ||||
-rw-r--r-- | doc/stdenv/stdenv.xml | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index cec3373cbee..f56bc5285b9 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -75,6 +75,24 @@ pkgs.rustPlatform.buildRustPackage { } ``` +### Building a crate with an absent or out-of-date Cargo.lock file + +`buildRustPackage` needs a `Cargo.lock` file to get all dependencies in the +source code in a reproducible way. If it is missing or out-of-date one can use +the `cargoPatches` attribute to update or add it. + +``` +{ lib, rustPlatform, fetchFromGitHub }: + +rustPlatform.buildRustPackage rec { + (...) + cargoPatches = [ + # a patch file to add/update Cargo.lock in the source code + ./add-Cargo.lock.patch + ]; +} +``` + ## Compiling Rust crates using Nix instead of Cargo ### Simple operation diff --git a/doc/stdenv/stdenv.xml b/doc/stdenv/stdenv.xml index a4174f4f7ed..ee93f39318b 100644 --- a/doc/stdenv/stdenv.xml +++ b/doc/stdenv/stdenv.xml @@ -2083,6 +2083,16 @@ postInstall = '' </varlistentry> <varlistentry> <term> + validatePkgConfig + </term> + <listitem> + <para> + The <literal>validatePkgConfig</literal> hook validates all pkg-config (<filename>.pc</filename>) files in a package. This helps catching some common errors in pkg-config files, such as undefined variables. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> cmake </term> <listitem> |