Skip to content

Commit

Permalink
fetchurl: Eliminate pointless cross differences
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Nov 11, 2019
1 parent 3f74a4d commit 38ebb8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkgs/build-support/fetchurl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.
{ lib, buildPackages ? { inherit stdenvNoCC; }, stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.

let

Expand All @@ -10,7 +10,7 @@ let
# resulting store derivations (.drv files) much smaller, which in
# turn makes nix-env/nix-instantiate faster.
mirrorsFile =
stdenvNoCC.mkDerivation ({
buildPackages.stdenvNoCC.mkDerivation ({
name = "mirrors-list";
builder = ./write-mirror-list.sh;
preferLocalBuild = true;
Expand Down
6 changes: 4 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ in
fetchhg = callPackage ../build-support/fetchhg { };

# `fetchurl' downloads a file from the network.
fetchurl = makeOverridable (import ../build-support/fetchurl) {
inherit lib stdenvNoCC;
fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform
then buildPackages.fetchurl # No need to do special overrides twice,
else makeOverridable (import ../build-support/fetchurl) {
inherit lib stdenvNoCC buildPackages;
curl = buildPackages.curl.override (old: rec {
# break dependency cycles
fetchurl = stdenv.fetchurlBoot;
Expand Down

0 comments on commit 38ebb8f

Please sign in to comment.