rust: update docs on legacyCargoFetcher; remove unnecessary defaults

As mentioned in #79975, the default on `legacyCargoFetcher` if left unspecified
is now `false`.
This commit is contained in:
Benjamin Hipple 2020-02-15 01:06:59 -05:00 committed by Jon
parent ceb30c490c
commit 131a32a5af
12 changed files with 7 additions and 30 deletions

View File

@ -37,7 +37,6 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "17ldqr3asrdcsh4l29m3b5r37r5d0b3npq1lrgjmxb6vlx6a36qh";
legacyCargoFetcher = false;
meta = with stdenv.lib; {
description = "A fast line-oriented regex search tool, similar to ag and ack";
@ -59,19 +58,9 @@ When the `Cargo.lock`, provided by upstream, is not in sync with the
added in `cargoPatches` will also be prepended to the patches in `patches` at
build-time.
Setting `legacyCargoFetcher` to `false` enables the following behavior:
1. The `Cargo.lock` file is copied into the cargo vendor directory.
2. At buildtime, `buildRustPackage` will ensure that the `src` and `cargoSha256`
are consistent. This avoids errors where one but not the other is updated.
3. The builder will compress the vendored cargo src directory into a tar.gz file
for storage after vendoring, and decompress it before the build. This saves
disk space and enables hashed mirrors for Rust dependencies.
Note that this option changes the value of `cargoSha256`, so it is currently
defaulted to `false`. When updating a Rust package, please set it to `true`;
eventually we will default this to true and update the remaining Rust packages,
then delete the option from all individual Rust package expressions.
Unless `legacyCargoFetcher` is set to `true`, the fetcher will also verify that
the `Cargo.lock` file is in sync with the `src` attribute, and will compress the
vendor directory into a tar.gz archive.
### Building a crate for a different target

View File

@ -11,8 +11,6 @@ rustPlatform.buildRustPackage rec {
sha256 = "06xqj83m4hz00p8796m0df7lv9875p8zc1v6l9yqbiak1h95lq7h";
};
legacyCargoFetcher = false;
cargoSha256 = "1pc4n6lm1w0660ivm0kxzicpckvb351y62dpv0cxa7ckd3raa5pr";
nativeBuildInputs = [ pkgconfig ] ++ stdenv.lib.optionals stdenv.isLinux [ python3 ];

View File

@ -15,8 +15,6 @@ rustPlatform.buildRustPackage rec {
sha256 = "08i0zm7kgprixqjpgaxk7xid1njgj6lmi896jf9fsjqzdzlblqk8";
};
legacyCargoFetcher = false;
cargoSha256 = "0200apqbx769ggjnjr0m72g61ikhml2xak5n1il2pvfx1yf5nw0n";
cargoBuildFlags = [

View File

@ -12,7 +12,6 @@ rustPlatform.buildRustPackage {
};
cargoSha256 = "06ghcd4j751mdkzwb88nqwk8la4zdb137y0iqrkpykkfx0as43x3";
legacyCargoFetcher = false;
buildInputs = [ ncurses ];

View File

@ -17,8 +17,6 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "1z4cb7rcb7ldj16xxynrjh4hg872rj39rbbp0vy15kdp3ifyi466";
legacyCargoFetcher = false;
buildInputs = with stdenv; lib.optional isDarwin Security;
meta = with stdenv.lib; {

View File

@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "1fxajh1n0qvcdas6w7dy3g92wilhfldy90pyk3779mrnh57fa6n5";
legacyCargoFetcher = false;
meta = with stdenv.lib; {
description = "Markdown shell pre-processor";

View File

@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "0zrwpmsrzwnjml0964zky8w222zmlargha3z0n6hf8cfshx23s4k";
legacyCargoFetcher = false;
nativeBuildInputs = [ installShellFiles ];

View File

@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "16d1b3pamkg29nq80n6cbzc4zl9z3cgfvdxjkr2z4xrnzmkn1ysi";
legacyCargoFetcher = false;
meta = with lib; {
description = "Rust library for generating cryptocurrency wallets";

View File

@ -1,4 +1,5 @@
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkgconfig, cmake, curl, libiconv, darwin }:
rustPlatform.buildRustPackage rec {
pname = "cargo-tree";
version = "0.29.0";
@ -10,8 +11,6 @@ rustPlatform.buildRustPackage rec {
sha256 = "16k41pj66m2221n1v2szir7x7qwx4i0g3svck2c8cj76h0bqyy15";
};
legacyCargoFetcher = false;
cargoSha256 = "0762gdj4n5mlflhzynnny1h8z792zyxmb4kcn54jj7qzdask4qdy";
nativeBuildInputs = [ pkgconfig cmake ];

View File

@ -1,4 +1,5 @@
{ stdenv, fetchFromGitHub, rustPlatform, nix, boost, graphviz, darwin }:
rustPlatform.buildRustPackage rec {
pname = "nix-du";
version = "0.3.1";
@ -9,8 +10,8 @@ rustPlatform.buildRustPackage rec {
rev = "v${version}";
sha256 = "149d60mid29s5alv5m3d7jrhyzc6cj7b6hpiq399gsdwzgxr00wq";
};
cargoSha256 = "1a6svl89dcdb5fpvs2i32i6agyhl0sx7kkkw70rqr17fyzl5psai";
legacyCargoFetcher = false;
doCheck = true;
checkInputs = [ graphviz ];

View File

@ -20,7 +20,6 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ pkg-config ];
cargoSha256 = "0rp4f6xnwmvf3pv6h0qwsg01jrndf77yn67675ac39kxzmrzfy2f";
legacyCargoFetcher = false;
meta = with stdenv.lib; {
description = "Decrypt your LUKS partition using a FIDO2 compatible authenticator";

View File

@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "1m3ccp5ncafkifg8sxyxczsg3ja1gvq8wmgni68bgzm2lwxh2qgw";
legacyCargoFetcher = false;
meta = with stdenv.lib; {
description = "Tree command, improved";