From 19cd58a6ca6153a62139128e93876d5e6e703b62 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 13 Aug 2023 14:09:58 +0100 Subject: [PATCH] flutter37: fix skyNotice hash for version 1a65d409c7a1438a34d21b60bf30a6fd5db59314 Using fetchurl like this means that, if you build the `flutter` derivation first, you will get a file named "LICENSE" in your store with the correct hash. `flutter37` will then build because this file is already in your store, even though the LICENSE to which _it_ refers is different. This is dangerous in this case - but an intentional design decision in the way fetchurl works to allow artifacts which are the same to be fetched from arbitrary sources, or even pre-populated into the store. To avoid this, explicitly tag the fetchurl with a name and the commit hash we're fetching from. This means we _must_ fetch these separately for each flutter version and avoids the problem of accidentally reusing artifacts for a different build. --- .../compilers/flutter/engine-artifacts/default.nix | 4 ++++ .../development/compilers/flutter/engine-artifacts/hashes.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/flutter/engine-artifacts/default.nix b/pkgs/development/compilers/flutter/engine-artifacts/default.nix index 41201bdb94e5..603b1456018d 100644 --- a/pkgs/development/compilers/flutter/engine-artifacts/default.nix +++ b/pkgs/development/compilers/flutter/engine-artifacts/default.nix @@ -19,10 +19,14 @@ let version = engineVersion; dontUnpack = true; src = fetchurl { + pname = "flutter-sky_engine-LICENSE"; + version = engineVersion; url = "https://raw.githubusercontent.com/flutter/engine/${engineVersion}/sky/packages/sky_engine/LICENSE"; sha256 = hashes.skyNotice; }; flutterNotice = fetchurl { + pname = "flutter-LICENSE"; + version = engineVersion; url = "https://raw.githubusercontent.com/flutter/flutter/${flutterVersion}/LICENSE"; sha256 = hashes.flutterNotice; }; diff --git a/pkgs/development/compilers/flutter/engine-artifacts/hashes.nix b/pkgs/development/compilers/flutter/engine-artifacts/hashes.nix index f51e43b2474f..1c8a5dc4059f 100644 --- a/pkgs/development/compilers/flutter/engine-artifacts/hashes.nix +++ b/pkgs/development/compilers/flutter/engine-artifacts/hashes.nix @@ -1,6 +1,6 @@ { "1a65d409c7a1438a34d21b60bf30a6fd5db59314" = { - skyNotice = "sha256-n9B26rLlfUqdR6s+2+PNK4H/fN95UE0T7/Vic19W6yo="; + skyNotice = "sha256-+EitMZAAvJ1mIlfm5ZTfY+pk8tfyu33XM7P8qOdj+J8="; flutterNotice = "sha256-pZjblLYpD/vhC17PkRBXtqlDNRxyf92p5fKJHWhwCiA="; android-arm = { "artifacts.zip" = "sha256-KDMiI6SQoZHfFV5LJJZ7VOGyEKC4UxzRc777j4BbXgM=";