diff options
Diffstat (limited to 'nixpkgs/doc/languages-frameworks/rust.section.md')
-rw-r--r-- | nixpkgs/doc/languages-frameworks/rust.section.md | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/nixpkgs/doc/languages-frameworks/rust.section.md b/nixpkgs/doc/languages-frameworks/rust.section.md index ec418c563359..0e1d59e1a952 100644 --- a/nixpkgs/doc/languages-frameworks/rust.section.md +++ b/nixpkgs/doc/languages-frameworks/rust.section.md @@ -43,7 +43,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/BurntSushi/ripgrep"; license = licenses.unlicense; maintainers = [ maintainers.tailhook ]; - platforms = platforms.all; }; } ``` @@ -51,7 +50,7 @@ rustPlatform.buildRustPackage rec { `buildRustPackage` requires a `cargoSha256` attribute which is computed over all crate sources of this package. Currently it is obtained by inserting a fake checksum into the expression and building the package once. The correct -checksum can be then take from the failed build. +checksum can then be taken from the failed build. Per the instructions in the [Cargo Book](https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html) best practices guide, Rust applications should always commit the `Cargo.lock` @@ -79,7 +78,7 @@ pkgs.rustPlatform.buildRustPackage { When using `buildRustPackage`, the `checkPhase` is enabled by default and runs `cargo test` on the package to build. To make sure that we don't compile the -sources twice and to actually test the artifacts that will be used at runtime, +sources twice and to actually test the artifacts that will be used at runtime, the tests will be ran in the `release` mode by default. However, in some cases the test-suite of a package doesn't work properly in the @@ -120,6 +119,18 @@ The above are just guidelines, and exceptions may be granted on a case-by-case b However, please check if it's possible to disable a problematic subset of the test suite and leave a comment explaining your reasoning. +#### Setting `test-threads` + +`buildRustPackage` will use parallel test threads by default, +sometimes it may be necessary to disable this so the tests run consecutively. + +```nix +rustPlatform.buildRustPackage { + /* ... */ + cargoParallelTestThreads = false; +} +``` + ### Building a package in `debug` mode By default, `buildRustPackage` will use `release` mode for builds. If a package |