diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-08-17 09:30:16 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2019-08-17 09:30:16 +0200 |
commit | c68f58d95c0e34d91ff3e4f08464954fd0e9e466 (patch) | |
tree | 11455dc939663bdda36790451315de1cc364614b /pkgs/build-support | |
parent | 8d56f2472e47a3f1f388b69c0ecc24421910d555 (diff) | |
parent | a2bd8da766c7a7ea456afd099b86920dd902cec4 (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/docker/default.nix | 7 | ||||
-rw-r--r-- | pkgs/build-support/rust/default.nix | 22 |
2 files changed, 19 insertions, 10 deletions
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index ae3d93ff3db39..83e21c8945dc5 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -291,9 +291,10 @@ rec { # Files to add to the layer. closure, configJson, - # Docker has a 42-layer maximum, we pick 24 to ensure there is plenty - # of room for extension - maxLayers ? 24 + # Docker has a 125-layer maximum, we pick 100 to ensure there is + # plenty of room for extension. + # https://github.com/moby/moby/blob/b3e9f7b13b0f0c414fa6253e1f17a86b2cff68b5/layer/layer_store.go#L23-L26 + maxLayers ? 100 }: let storePathToLayer = substituteAll diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index bd18f108e4eb9..09802d56d34c5 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -1,4 +1,4 @@ -{ stdenv, cacert, git, cargo, rustc, fetchcargo, buildPackages }: +{ stdenv, cacert, git, cargo, rustc, fetchcargo, buildPackages, windows }: { name ? "${args.pname}-${args.version}" , cargoSha256 ? "unset" @@ -41,18 +41,26 @@ let cargoDepsCopy="$sourceRoot/${cargoVendorDir}" ''; + hostConfig = stdenv.hostPlatform.config; + + rustHostConfig = { + "x86_64-pc-mingw32" = "x86_64-pc-windows-gnu"; + }."${hostConfig}" or hostConfig; + ccForBuild="${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"; cxxForBuild="${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++"; ccForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; - releaseDir = "target/${stdenv.hostPlatform.config}/${buildType}"; -in stdenv.mkDerivation (args // { + releaseDir = "target/${rustHostConfig}/${buildType}"; +in + +stdenv.mkDerivation (args // { inherit cargoDeps; patchRegistryDeps = ./patch-registry-deps; - nativeBuildInputs = [ cargo rustc git cacert ] ++ nativeBuildInputs; - inherit buildInputs; + nativeBuildInputs = nativeBuildInputs ++ [ cacert git cargo rustc ]; + buildInputs = buildInputs ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.pthreads; patches = cargoPatches ++ patches; @@ -76,7 +84,7 @@ in stdenv.mkDerivation (args // { [target."${stdenv.buildPlatform.config}"] "linker" = "${ccForBuild}" ${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' - [target."${stdenv.hostPlatform.config}"] + [target."${rustHostConfig}"] "linker" = "${ccForHost}" ''} EOF @@ -102,7 +110,7 @@ in stdenv.mkDerivation (args // { "CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \ cargo build \ ${stdenv.lib.optionalString (buildType == "release") "--release"} \ - --target ${stdenv.hostPlatform.config} \ + --target ${rustHostConfig} \ --frozen ${concatStringsSep " " cargoBuildFlags} ) |