about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-22 13:47:37 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-22 18:22:22 +0000
commit1b9a13c4689af7e088eb7af5589f8c811282846a (patch)
tree3ed032953008280fb94ef894c869ff3e2a2f7865 /nixpkgs/pkgs/build-support
parent4999a38db7c5de0ea9f514a12ecd4133cce647f3 (diff)
parent1412af4b2cfae71d447164097d960d426e9752c0 (diff)
downloadnixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.gz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.bz2
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.lz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.xz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.zst
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.zip
Merge remote-tracking branch 'channels/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/build-support')
-rw-r--r--nixpkgs/pkgs/build-support/build-bazel-package/default.nix9
-rw-r--r--nixpkgs/pkgs/build-support/docker/default.nix7
-rw-r--r--nixpkgs/pkgs/build-support/fetchurl/mirrors.nix2
-rw-r--r--nixpkgs/pkgs/build-support/rust/default.nix38
4 files changed, 36 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/build-support/build-bazel-package/default.nix b/nixpkgs/pkgs/build-support/build-bazel-package/default.nix
index 32cec42160f8..d4318b715ba3 100644
--- a/nixpkgs/pkgs/build-support/build-bazel-package/default.nix
+++ b/nixpkgs/pkgs/build-support/build-bazel-package/default.nix
@@ -71,6 +71,15 @@ in stdenv.mkDerivation (fBuildAttrs // {
       rm -rf $(find $bazelOut/external -type d -name .svn)
       rm -rf $(find $bazelOut/external -type d -name .hg)
 
+      # Removing top-level symlinks along with their markers.
+      # This is needed because they sometimes point to temporary paths (?).
+      # For example, in Tensorflow-gpu build:
+      # platforms -> NIX_BUILD_TOP/tmp/install/35282f5123611afa742331368e9ae529/_embedded_binaries/platforms
+      find $bazelOut/external -maxdepth 1 -type l | while read symlink; do
+        name="$(basename "$symlink")"
+        rm "$symlink" "$bazelOut/external/@$name.marker"
+      done
+
       # Patching symlinks to remove build directory reference
       find $bazelOut/external -type l | while read symlink; do
         new_target="$(readlink "$symlink" | sed "s,$NIX_BUILD_TOP,NIX_BUILD_TOP,")"
diff --git a/nixpkgs/pkgs/build-support/docker/default.nix b/nixpkgs/pkgs/build-support/docker/default.nix
index ae3d93ff3db3..83e21c8945dc 100644
--- a/nixpkgs/pkgs/build-support/docker/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix
index d09b775d42c8..2138a487f8ef 100644
--- a/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix
+++ b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix
@@ -385,7 +385,7 @@ rec {
   # Steam Runtime mirrors
   steamrt = [
     http://repo.steampowered.com/steamrt/
-    https://abbradar.net/steamrt/
+    https://public.abbradar.moe/steamrt/
   ];
 
   # Python PyPI mirrors
diff --git a/nixpkgs/pkgs/build-support/rust/default.nix b/nixpkgs/pkgs/build-support/rust/default.nix
index 2193a5825dfd..cf8042ba255d 100644
--- a/nixpkgs/pkgs/build-support/rust/default.nix
+++ b/nixpkgs/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 }:
 
 let
   buildRustPackage =
@@ -43,18 +43,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;
 
@@ -74,23 +82,21 @@ let
         substitute $config .cargo/config \
           --subst-var-by vendor "$(pwd)/$cargoDepsCopy"
 
-        unset cargoDepsCopy
-
-        export RUST_LOG=${logLevel}
-      '' + (args.postUnpack or "");
-
-      configurePhase = args.configurePhase or ''
-        runHook preConfigure
-        mkdir -p .cargo
         cat >> .cargo/config <<'EOF'
         [target."${stdenv.buildPlatform.config}"]
         "linker" = "${ccForBuild}"
         ${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
-        [target."${stdenv.hostPlatform.config}"]
+        [target."${rustHostConfig}"]
         "linker" = "${ccForHost}"
         ''}
         EOF
-        cat .cargo/config
+
+        unset cargoDepsCopy
+        export RUST_LOG=${logLevel}
+      '' + (args.postUnpack or "");
+
+      configurePhase = args.configurePhase or ''
+        runHook preConfigure
         runHook postConfigure
       '';
 
@@ -106,7 +112,7 @@ let
           "CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \
           cargo build \
             ${stdenv.lib.optionalString (buildType == "release") "--release"} \
-            --target ${stdenv.hostPlatform.config} \
+            --target ${rustHostConfig} \
             --frozen ${concatStringsSep " " cargoBuildFlags}
         )