Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a0c2484d0e65
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 68b25d3b9df6
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 7, 2020

  1. rustPlatform: fix bug with ambiguous diff tool

    If a user provides `nativeBuildInputs = [ llvmPackages.bintools ]` or any other
    package containing a `${prefix}/bin/diff`, the builder could use it instead
    of the standard unix `diff`, causing a build failure.
    
    This updates the call to specify an abspath to `diff` and avoid reliance on `PATH`.
    
    Resolves #87081
    bhipple committed May 7, 2020
    Copy the full SHA
    7f84557 View commit details
  2. Copy the full SHA
    68b25d3 View commit details
Showing with 16 additions and 2 deletions.
  1. +16 −2 pkgs/build-support/rust/default.nix
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"
@@ -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 // {
@@ -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.