Skip to content

Commit

Permalink
Merge pull request #87155 from bhipple/fix/rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed May 7, 2020
2 parents a0c2484 + 7f84557 commit 68b25d3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkgs/build-support/rust/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{ stdenv, cacert, git, rust, cargo, rustc, fetchCargoTarball, buildPackages, windows }:
{ stdenv
, buildPackages
, cacert
, cargo
, diffutils
, fetchCargoTarball
, git
, rust
, rustc
, windows
}:

{ name ? "${args.pname}-${args.version}"
, cargoSha256 ? "unset"
Expand Down Expand Up @@ -58,6 +68,10 @@ let
cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
releaseDir = "target/${rustTarget}/${buildType}";

# Specify the stdenv's `diff` by abspath to ensure that the user's build
# inputs do not cause us to find the wrong `diff`.
diff = "${diffutils}/bin/diff";

in

stdenv.mkDerivation (args // {
Expand Down Expand Up @@ -110,7 +124,7 @@ stdenv.mkDerivation (args // {
srcLockfile=$NIX_BUILD_TOP/$sourceRoot/Cargo.lock
echo "Validating consistency between $srcLockfile and $cargoDepsLockfile"
if ! diff $srcLockfile $cargoDepsLockfile; then
if ! ${diff} $srcLockfile $cargoDepsLockfile; then
# If the diff failed, first double-check that the file exists, so we can
# give a friendlier error msg.
Expand Down

0 comments on commit 68b25d3

Please sign in to comment.