diff options
author | Yurii Rashkovskii <yrashk@gmail.com> | 2018-02-23 11:17:03 +0700 |
---|---|---|
committer | Yurii Rashkovskii <yrashk@gmail.com> | 2018-02-23 11:17:03 +0700 |
commit | e1aecec4cd4c98756839631efa3637fe8124d1cc (patch) | |
tree | d85d784f9bd31333be2aaf1ddda35d5ba0e0e648 /pkgs/build-support | |
parent | 472dd33ea4905d562d9380d42ff09365e4b79a7e (diff) |
build-support/rust: make use of abandoned cargoUpdateHook
Previously, cargoUpdateHook was meaningful as it was used in [`cargo-fetch-deps`](https://github.com/NixOS/nixpkgs/blob/19d3cf81d3436a6600f261579b55b9132a6ca8fb/pkgs/build-support/rust/fetch-cargo-deps#L71). However, this entire file was removed in 5f8cf0048ea089fa73d17512fc4f9f0f0644e225. As far as I can tell, nothing in the code is using it, but it is still being passed around: https://github.com/NixOS/nixpkgs/search?q=cargoUpdateHook&type=Code&utf8=%E2%9C%93 There are, however, legitimate use cases for it. For example, in some software, some dependencies are not locked in Cargo.toml and this causes Cargo to try fetching another version of them. This doesn't work well with vendoring crates. This hook allows to inject patching or whatever necessary workarounds in the crate vendoring process. I suppose that's what it was for in there in the first place. This patch restores this hook and makes it usable again.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/fetchcargo.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/build-support/rust/fetchcargo.nix b/pkgs/build-support/rust/fetchcargo.nix index d03d85c07888d..42a3ac27cb5b3 100644 --- a/pkgs/build-support/rust/fetchcargo.nix +++ b/pkgs/build-support/rust/fetchcargo.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation { export CARGO_HOME=$(mktemp -d cargo-home.XXX) + ${cargoUpdateHook} + cargo vendor cp -ar vendor $out |