From 131a32a5afdb72063704a8407332f747af619319 Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Sat, 15 Feb 2020 01:06:59 -0500 Subject: [PATCH] rust: update docs on legacyCargoFetcher; remove unnecessary defaults As mentioned in #79975, the default on `legacyCargoFetcher` if left unspecified is now `false`. --- doc/languages-frameworks/rust.section.md | 17 +++-------------- pkgs/applications/audio/spotify-tui/default.nix | 4 +--- pkgs/applications/audio/spotifyd/default.nix | 2 -- pkgs/applications/editors/hexdino/default.nix | 1 - .../git-and-tools/git-workspace/default.nix | 2 -- .../tools/documentation/mdsh/default.nix | 1 - pkgs/tools/misc/broot/default.nix | 1 - pkgs/tools/misc/wagyu/default.nix | 1 - .../package-management/cargo-tree/default.nix | 3 +-- .../tools/package-management/nix-du/default.nix | 3 ++- pkgs/tools/security/fido2luks/default.nix | 1 - pkgs/tools/system/tre-command/default.nix | 1 - 12 files changed, 7 insertions(+), 30 deletions(-) diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 6f0ec7c05144..099872fba13d 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -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 diff --git a/pkgs/applications/audio/spotify-tui/default.nix b/pkgs/applications/audio/spotify-tui/default.nix index a6af8c5208e5..db54055def40 100644 --- a/pkgs/applications/audio/spotify-tui/default.nix +++ b/pkgs/applications/audio/spotify-tui/default.nix @@ -11,13 +11,11 @@ rustPlatform.buildRustPackage rec { sha256 = "06xqj83m4hz00p8796m0df7lv9875p8zc1v6l9yqbiak1h95lq7h"; }; - legacyCargoFetcher = false; - cargoSha256 = "1pc4n6lm1w0660ivm0kxzicpckvb351y62dpv0cxa7ckd3raa5pr"; nativeBuildInputs = [ pkgconfig ] ++ stdenv.lib.optionals stdenv.isLinux [ python3 ]; buildInputs = [ openssl ] - ++ stdenv.lib.optional stdenv.isLinux libxcb + ++ stdenv.lib.optional stdenv.isLinux libxcb ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Security ]; meta = with stdenv.lib; { diff --git a/pkgs/applications/audio/spotifyd/default.nix b/pkgs/applications/audio/spotifyd/default.nix index e61a2879d474..263fe986df31 100644 --- a/pkgs/applications/audio/spotifyd/default.nix +++ b/pkgs/applications/audio/spotifyd/default.nix @@ -15,8 +15,6 @@ rustPlatform.buildRustPackage rec { sha256 = "08i0zm7kgprixqjpgaxk7xid1njgj6lmi896jf9fsjqzdzlblqk8"; }; - legacyCargoFetcher = false; - cargoSha256 = "0200apqbx769ggjnjr0m72g61ikhml2xak5n1il2pvfx1yf5nw0n"; cargoBuildFlags = [ diff --git a/pkgs/applications/editors/hexdino/default.nix b/pkgs/applications/editors/hexdino/default.nix index 91f048320a72..48cd58570f8a 100644 --- a/pkgs/applications/editors/hexdino/default.nix +++ b/pkgs/applications/editors/hexdino/default.nix @@ -12,7 +12,6 @@ rustPlatform.buildRustPackage { }; cargoSha256 = "06ghcd4j751mdkzwb88nqwk8la4zdb137y0iqrkpykkfx0as43x3"; - legacyCargoFetcher = false; buildInputs = [ ncurses ]; diff --git a/pkgs/applications/version-management/git-and-tools/git-workspace/default.nix b/pkgs/applications/version-management/git-and-tools/git-workspace/default.nix index 61e3e1e3eef0..b93163e239ad 100644 --- a/pkgs/applications/version-management/git-and-tools/git-workspace/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-workspace/default.nix @@ -17,8 +17,6 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1z4cb7rcb7ldj16xxynrjh4hg872rj39rbbp0vy15kdp3ifyi466"; - legacyCargoFetcher = false; - buildInputs = with stdenv; lib.optional isDarwin Security; meta = with stdenv.lib; { diff --git a/pkgs/development/tools/documentation/mdsh/default.nix b/pkgs/development/tools/documentation/mdsh/default.nix index ddce5bc29a43..714ea15cd61e 100644 --- a/pkgs/development/tools/documentation/mdsh/default.nix +++ b/pkgs/development/tools/documentation/mdsh/default.nix @@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec { }; cargoSha256 = "1fxajh1n0qvcdas6w7dy3g92wilhfldy90pyk3779mrnh57fa6n5"; - legacyCargoFetcher = false; meta = with stdenv.lib; { description = "Markdown shell pre-processor"; diff --git a/pkgs/tools/misc/broot/default.nix b/pkgs/tools/misc/broot/default.nix index df26423c6331..572bee3d2621 100644 --- a/pkgs/tools/misc/broot/default.nix +++ b/pkgs/tools/misc/broot/default.nix @@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec { }; cargoSha256 = "0zrwpmsrzwnjml0964zky8w222zmlargha3z0n6hf8cfshx23s4k"; - legacyCargoFetcher = false; nativeBuildInputs = [ installShellFiles ]; diff --git a/pkgs/tools/misc/wagyu/default.nix b/pkgs/tools/misc/wagyu/default.nix index 53e098495226..f21db2c4b4fc 100644 --- a/pkgs/tools/misc/wagyu/default.nix +++ b/pkgs/tools/misc/wagyu/default.nix @@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec { }; cargoSha256 = "16d1b3pamkg29nq80n6cbzc4zl9z3cgfvdxjkr2z4xrnzmkn1ysi"; - legacyCargoFetcher = false; meta = with lib; { description = "Rust library for generating cryptocurrency wallets"; diff --git a/pkgs/tools/package-management/cargo-tree/default.nix b/pkgs/tools/package-management/cargo-tree/default.nix index 4e5fa69aec90..2e0207e01ed3 100644 --- a/pkgs/tools/package-management/cargo-tree/default.nix +++ b/pkgs/tools/package-management/cargo-tree/default.nix @@ -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 ]; diff --git a/pkgs/tools/package-management/nix-du/default.nix b/pkgs/tools/package-management/nix-du/default.nix index 908f31b93abe..6ee7dee33f67 100644 --- a/pkgs/tools/package-management/nix-du/default.nix +++ b/pkgs/tools/package-management/nix-du/default.nix @@ -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 ]; diff --git a/pkgs/tools/security/fido2luks/default.nix b/pkgs/tools/security/fido2luks/default.nix index ea911e467340..729a3f7297cb 100644 --- a/pkgs/tools/security/fido2luks/default.nix +++ b/pkgs/tools/security/fido2luks/default.nix @@ -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"; diff --git a/pkgs/tools/system/tre-command/default.nix b/pkgs/tools/system/tre-command/default.nix index b8925dcfa42e..0cbe87ccd377 100644 --- a/pkgs/tools/system/tre-command/default.nix +++ b/pkgs/tools/system/tre-command/default.nix @@ -12,7 +12,6 @@ rustPlatform.buildRustPackage rec { }; cargoSha256 = "1m3ccp5ncafkifg8sxyxczsg3ja1gvq8wmgni68bgzm2lwxh2qgw"; - legacyCargoFetcher = false; meta = with stdenv.lib; { description = "Tree command, improved";