From 1bdff917553098af6788022cbc9c3da0e47cdd59 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Mon, 18 Nov 2024 23:10:36 -0800 Subject: [PATCH] flutter: revert remove usages of aliases {build,host,target}Platform PR #350299 broke Flutter's update script with how it handled getting the platform. Furthermore, the problem was made worse in the last update to Flutter which had to work around that problem. We'll just revert it for now and do a proper fix once we can figure out how to satify setting the different platforms without causing any more problems. --- .../compilers/flutter/engine/package.nix | 12 +++++++++++- .../compilers/flutter/engine/source.nix | 19 ++++++++++--------- .../compilers/flutter/engine/tools.nix | 6 ++++-- .../flutter/update/get-engine-hashes.nix.in | 9 +++------ .../compilers/flutter/versions/3_24/data.json | 4 ++-- .../compilers/flutter/versions/3_26/data.json | 4 ++-- .../compilers/flutter/versions/3_27/data.json | 4 ++-- 7 files changed, 34 insertions(+), 24 deletions(-) diff --git a/pkgs/development/compilers/flutter/engine/package.nix b/pkgs/development/compilers/flutter/engine/package.nix index b4ac8c9828d9..5c0e732f524f 100644 --- a/pkgs/development/compilers/flutter/engine/package.nix +++ b/pkgs/development/compilers/flutter/engine/package.nix @@ -6,7 +6,12 @@ darwin, clang, llvm, - tools ? callPackage ./tools.nix { }, + tools ? callPackage ./tools.nix { + inherit (stdenv) + hostPlatform + buildPlatform + ; + }, stdenv, stdenvNoCC, dart, @@ -63,6 +68,11 @@ let hashes url ; + inherit (stdenv) + hostPlatform + buildPlatform + targetPlatform + ; }; swiftshader = fetchgit { diff --git a/pkgs/development/compilers/flutter/engine/source.nix b/pkgs/development/compilers/flutter/engine/source.nix index 8d38362464a2..f20c171799eb 100644 --- a/pkgs/development/compilers/flutter/engine/source.nix +++ b/pkgs/development/compilers/flutter/engine/source.nix @@ -1,5 +1,4 @@ { - stdenv, lib, callPackage, fetchgit, @@ -15,16 +14,18 @@ version, hashes, url, + hostPlatform, + targetPlatform, + buildPlatform, }@pkgs: let - target-constants = callPackage ./constants.nix { platform = stdenv.targetPlatform; }; - build-constants = callPackage ./constants.nix { platform = stdenv.buildPlatform; }; - tools = pkgs.tools or (callPackage ./tools.nix { }); + target-constants = callPackage ./constants.nix { platform = targetPlatform; }; + build-constants = callPackage ./constants.nix { platform = buildPlatform; }; + tools = pkgs.tools or (callPackage ./tools.nix { inherit hostPlatform buildPlatform; }); boolOption = value: if value then "True" else "False"; in -runCommand - "flutter-engine-source-${version}-${stdenv.buildPlatform.system}-${stdenv.targetPlatform.system}" +runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPlatform.system}" { pname = "flutter-engine-source"; inherit version; @@ -52,7 +53,7 @@ runCommand "custom_vars": { "download_fuchsia_deps": False, "download_android_deps": False, - "download_linux_deps": ${boolOption stdenv.targetPlatform.isLinux}, + "download_linux_deps": ${boolOption targetPlatform.isLinux}, "setup_githooks": False, "download_esbuild": False, "download_dart_sdk": False, @@ -82,8 +83,8 @@ runCommand outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = - (hashes."${stdenv.buildPlatform.system}" or { })."${stdenv.targetPlatform.system}" - or (throw "Hash not set for ${stdenv.targetPlatform.system} on ${stdenv.buildPlatform.system}"); + (hashes."${buildPlatform.system}" or { })."${targetPlatform.system}" + or (throw "Hash not set for ${targetPlatform.system} on ${buildPlatform.system}"); } '' source ${../../../../build-support/fetchgit/deterministic-git} diff --git a/pkgs/development/compilers/flutter/engine/tools.nix b/pkgs/development/compilers/flutter/engine/tools.nix index 5fa068480515..4baf34b201f7 100644 --- a/pkgs/development/compilers/flutter/engine/tools.nix +++ b/pkgs/development/compilers/flutter/engine/tools.nix @@ -1,5 +1,7 @@ { stdenv, + buildPlatform, + hostPlatform, callPackage, fetchgit, fetchurl, @@ -29,8 +31,8 @@ }, }: let - constants = callPackage ./constants.nix { platform = stdenv.buildPlatform; }; - host-constants = callPackage ./constants.nix { platform = stdenv.hostPlatform; }; + constants = callPackage ./constants.nix { platform = buildPlatform; }; + host-constants = callPackage ./constants.nix { platform = hostPlatform; }; stdenv-constants = callPackage ./constants.nix { platform = stdenv.hostPlatform; }; in { diff --git a/pkgs/development/compilers/flutter/update/get-engine-hashes.nix.in b/pkgs/development/compilers/flutter/update/get-engine-hashes.nix.in index 5af7d7fc7719..ee529055aa57 100644 --- a/pkgs/development/compilers/flutter/update/get-engine-hashes.nix.in +++ b/pkgs/development/compilers/flutter/update/get-engine-hashes.nix.in @@ -17,12 +17,9 @@ let ++ (map (targetPlatform: callPackage "${nixpkgsRoot}/pkgs/development/compilers/flutter/engine/source.nix" { - stdenv = stdenv.override { - targetPlatform = lib.systems.elaborate targetPlatform; - hostPlatform = lib.systems.elaborate buildPlatform; - buildPlatform = lib.systems.elaborate buildPlatform; - }; - + targetPlatform = lib.systems.elaborate targetPlatform; + hostPlatform = lib.systems.elaborate buildPlatform; + buildPlatform = lib.systems.elaborate buildPlatform; flutterVersion = version; version = engineVersion; url = "https://github.com/flutter/engine.git@${engineVersion}"; diff --git a/pkgs/development/compilers/flutter/versions/3_24/data.json b/pkgs/development/compilers/flutter/versions/3_24/data.json index 114e3e88686e..021ec288e0e3 100644 --- a/pkgs/development/compilers/flutter/versions/3_24/data.json +++ b/pkgs/development/compilers/flutter/versions/3_24/data.json @@ -10,8 +10,8 @@ "x86_64-linux": "sha256-/jkMlcE0AZFWgTtUaUk8e/RxD31mObG91C6nfLzXdYU=" }, "x86_64-linux": { - "aarch64-linux": "sha256-/jkMlcE0AZFWgTtUaUk8e/RxD31mObG91C6nfLzXdYU=", - "x86_64-linux": "sha256-/jkMlcE0AZFWgTtUaUk8e/RxD31mObG91C6nfLzXdYU=" + "aarch64-linux": "sha256-aQK3uD8n/V1ZH5+RbCNVZ1Fxx0Z33y5IEG4B0MVKh58=", + "x86_64-linux": "sha256-aQK3uD8n/V1ZH5+RbCNVZ1Fxx0Z33y5IEG4B0MVKh58=" } }, "dartVersion": "3.5.4", diff --git a/pkgs/development/compilers/flutter/versions/3_26/data.json b/pkgs/development/compilers/flutter/versions/3_26/data.json index 8dc7dd1cce41..13613d19c2ff 100644 --- a/pkgs/development/compilers/flutter/versions/3_26/data.json +++ b/pkgs/development/compilers/flutter/versions/3_26/data.json @@ -10,8 +10,8 @@ "x86_64-linux": "sha256-cDXCGikGuPWxMZZ0HWcnbS7Dt22no9wwbh4wei7w8Bw=" }, "x86_64-linux": { - "aarch64-linux": "sha256-cDXCGikGuPWxMZZ0HWcnbS7Dt22no9wwbh4wei7w8Bw=", - "x86_64-linux": "sha256-cDXCGikGuPWxMZZ0HWcnbS7Dt22no9wwbh4wei7w8Bw=" + "aarch64-linux": "sha256-deuArmKBZvkjjt986wAAwGArKYMW01QvbgqzQ9FLBS8=", + "x86_64-linux": "sha256-deuArmKBZvkjjt986wAAwGArKYMW01QvbgqzQ9FLBS8=" } }, "dartVersion": "3.6.0-216.1.beta", diff --git a/pkgs/development/compilers/flutter/versions/3_27/data.json b/pkgs/development/compilers/flutter/versions/3_27/data.json index 04e89fdfdc05..67aa504685be 100644 --- a/pkgs/development/compilers/flutter/versions/3_27/data.json +++ b/pkgs/development/compilers/flutter/versions/3_27/data.json @@ -10,8 +10,8 @@ "x86_64-linux": "sha256-xEUUengFzRbQhFB7jxTBd8eTMWUhyBTTKyT/ObuyD/o=" }, "x86_64-linux": { - "aarch64-linux": "sha256-xEUUengFzRbQhFB7jxTBd8eTMWUhyBTTKyT/ObuyD/o=", - "x86_64-linux": "sha256-xEUUengFzRbQhFB7jxTBd8eTMWUhyBTTKyT/ObuyD/o=" + "aarch64-linux": "sha256-YFmK7eSt9lK/iEMPC5jxp5Vf2pnDjUDyPVoHzgxc8mA=", + "x86_64-linux": "sha256-YFmK7eSt9lK/iEMPC5jxp5Vf2pnDjUDyPVoHzgxc8mA=" } }, "dartVersion": "3.6.0-334.3.beta",