From 074bc78cc8749faa31729096b65f2ef51b10abeb Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 01:10:21 -0400 Subject: [PATCH 1/5] android: update sdk, ndk to 29, 21 --- lib/systems/examples.nix | 4 ++-- pkgs/development/androidndk-pkgs/default.nix | 7 ++++--- .../mobile/androidenv/compose-android-packages.nix | 2 +- pkgs/development/mobile/androidenv/ndk-bundle/default.nix | 6 ++++-- pkgs/top-level/all-packages.nix | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index ca562d2e456..40e2b8fcefb 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -46,7 +46,7 @@ rec { armv7a-android-prebuilt = { config = "armv7a-unknown-linux-androideabi"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.armv7a-android; useAndroidPrebuilt = true; @@ -54,7 +54,7 @@ rec { aarch64-android-prebuilt = { config = "aarch64-unknown-linux-android"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.aarch64-multiplatform; useAndroidPrebuilt = true; diff --git a/pkgs/development/androidndk-pkgs/default.nix b/pkgs/development/androidndk-pkgs/default.nix index 7bb779d1d13..ce5a868f4ec 100644 --- a/pkgs/development/androidndk-pkgs/default.nix +++ b/pkgs/development/androidndk-pkgs/default.nix @@ -2,9 +2,9 @@ }: { - "18b" = + "21" = let - ndkVersion = "18.1.5063045"; + ndkVersion = "21.0.6113669"; buildAndroidComposition = buildPackages.buildPackages.androidenv.composeAndroidPackages { includeNDK = true; @@ -28,6 +28,7 @@ # these two really are the same. buildAndroidndk = buildAndroidComposition.ndk-bundle; androidndk = androidComposition.ndk-bundle; - targetAndroidndkPkgs = targetPackages.androidndkPkgs_18b; + targetAndroidndkPkgs = targetPackages.androidndkPkgs_21; }; + } diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index f98547011bd..1786aebae83 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -14,7 +14,7 @@ , lldbVersions ? [ ] , cmakeVersions ? [ ] , includeNDK ? false -, ndkVersion ? "18.1.5063045" +, ndkVersion ? "21.0.6113669" , useGoogleAPIs ? false , useGoogleTVAddOns ? false , includeExtras ? [] diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index b81fab1ed76..6bdb7181590 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -7,12 +7,14 @@ deployAndroidPackage { inherit package os; buildInputs = [ autoPatchelfHook makeWrapper pkgs.python2 ] ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 pkgs.zlib pkgs.libcxx.out ]; - patchInstructions = lib.optionalString (os == "linux") '' + patchInstructions = lib.optionalString (os == "linux") ('' patchShebangs . + '' + lib.optionalString (builtins.compareVersions (lib.getVersion package) "21" > 0) '' patch -p1 \ --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch} wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" + '' + '' # TODO: allow this stuff rm -rf docs tests @@ -46,6 +48,6 @@ deployAndroidPackage { do ln -sf ../libexec/android-sdk/ndk-bundle/$i $out/bin/$i done - ''; + ''); noAuditTmpdir = true; # Audit script gets invoked by the build/ component in the path for the make standalone script } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 933a7544fb7..df2ca9f9d07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1155,6 +1155,7 @@ in androidndkPkgs = androidndkPkgs_18b; androidndkPkgs_18b = (callPackage ../development/androidndk-pkgs {})."18b"; + androidndkPkgs_21 = (callPackage ../development/androidndk-pkgs {})."21"; androidsdk_9_0 = androidenv.androidPkgs_9_0.androidsdk; From 0be29459d689b1b8adf79a3d74085ba9006c9cf4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 12 Aug 2020 15:56:04 -0500 Subject: [PATCH 2/5] ghc: set Stage1Only = YES on iOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want stage1Only here even if system == system, since we can’t run the native arch simulator binaries locally. --- pkgs/development/compilers/ghc/8.10.1.nix | 2 +- pkgs/development/compilers/ghc/8.6.5.nix | 2 +- pkgs/development/compilers/ghc/8.8.2.nix | 2 +- pkgs/development/compilers/ghc/8.8.3.nix | 2 +- pkgs/development/compilers/ghc/8.8.4.nix | 2 +- pkgs/development/compilers/ghc/head.nix | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index 727fc91451e..c0bcdaa6bee 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -63,7 +63,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index 06266556cf3..863fc74c037 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -60,7 +60,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index 305226b3407..af5c5433f1b 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -60,7 +60,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index aa4c378f200..f6b0a8efdf2 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -63,7 +63,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 60c0f2cdd9d..6efbef45bac 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -63,7 +63,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 4b9ff94963d..5d8b250d41d 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -66,7 +66,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO From 4cbca0893af3b4bdac508894fb6d9b10040a5179 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 00:19:41 -0500 Subject: [PATCH 3/5] androidenv: remove duplicate addons.nix entries --- .../mobile/androidenv/generated/addons.nix | 128 ------------------ 1 file changed, 128 deletions(-) diff --git a/pkgs/development/mobile/androidenv/generated/addons.nix b/pkgs/development/mobile/androidenv/generated/addons.nix index 23a55595cce..231e5b8ea22 100644 --- a/pkgs/development/mobile/androidenv/generated/addons.nix +++ b/pkgs/development/mobile/androidenv/generated/addons.nix @@ -672,70 +672,6 @@ }; - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; - revision = "1"; - displayName = "Solver for ConstraintLayout 1.0.0-alpha8"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha8.zip"; - sha1 = "cd13d16a8f0198c1d6040ec8b1d0d4e5bb7feb6a"; - }; - - }; - }; - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; @@ -896,70 +832,6 @@ }; - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8"; - revision = "1"; - displayName = "ConstraintLayout for Android 1.0.0-alpha8"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha8.zip"; - sha1 = "7912ba03b04831f918f523648f118c4ee4da7604"; - }; - - }; - }; - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = { name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8"; path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8"; From ff33855bf0a724ea8c2502b176fd90c9d856b378 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 10:54:43 -0500 Subject: [PATCH 4/5] android: readd 18b ndk This is referenced in all-packages.nix, so might as well leave it heref or now. --- pkgs/development/androidndk-pkgs/default.nix | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkgs/development/androidndk-pkgs/default.nix b/pkgs/development/androidndk-pkgs/default.nix index ce5a868f4ec..10819d49ed3 100644 --- a/pkgs/development/androidndk-pkgs/default.nix +++ b/pkgs/development/androidndk-pkgs/default.nix @@ -2,6 +2,35 @@ }: { + "18b" = + let + ndkVersion = "18.1.5063045"; + + buildAndroidComposition = buildPackages.buildPackages.androidenv.composeAndroidPackages { + includeNDK = true; + inherit ndkVersion; + }; + + androidComposition = androidenv.composeAndroidPackages { + includeNDK = true; + inherit ndkVersion; + }; + in + import ./androidndk-pkgs.nix { + inherit (buildPackages) + makeWrapper; + inherit (pkgs) + stdenv + runCommand wrapBintoolsWith wrapCCWith; + # buildPackages.foo rather than buildPackages.buildPackages.foo would work, + # but for splicing messing up on infinite recursion for the variants we + # *dont't* use. Using this workaround, but also making a test to ensure + # these two really are the same. + buildAndroidndk = buildAndroidComposition.ndk-bundle; + androidndk = androidComposition.ndk-bundle; + targetAndroidndkPkgs = targetPackages.androidndkPkgs_18b; + }; + "21" = let ndkVersion = "21.0.6113669"; From c5617381bcfe0549c5848f07bcfb64cd40aa0204 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 11:01:27 -0500 Subject: [PATCH 5/5] ghc: document Stage1Only setting --- pkgs/development/compilers/ghc/8.10.1.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.6.5.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.2.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.3.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.4.nix | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index c0bcdaa6bee..6325e2187c0 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index 863fc74c037..a5d2bb5c88d 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -59,7 +59,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index af5c5433f1b..bd1f09709dc 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -59,7 +59,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index f6b0a8efdf2..1f1a23ee2c2 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 6efbef45bac..448995f66ba 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO