From 540fb7a27074eec677266b218e8bbe9a385cbfa5 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 24 Jan 2023 20:43:54 +0100 Subject: [PATCH] kubo-migrator: fix broken migrations Two old migrations were broken since Go 1.16 was removed from Nixpkgs. Upstream is not interested in fixing the migrations to work with newer Go versions: https://github.com/ipfs/fs-repo-migrations/pull/163#issuecomment-1397311134. --- .../networking/kubo-migrator/all-migrations.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/networking/kubo-migrator/all-migrations.nix b/pkgs/applications/networking/kubo-migrator/all-migrations.nix index a9197c9db5fb..95b3386ed1f1 100644 --- a/pkgs/applications/networking/kubo-migrator/all-migrations.nix +++ b/pkgs/applications/networking/kubo-migrator/all-migrations.nix @@ -15,6 +15,19 @@ let inherit (kubo-migrator-unwrapped) src; sourceRoot = "source/${pname}"; vendorSha256 = null; + # Fix build on Go 1.17 and later: panic: qtls.ClientHelloInfo doesn't match + # See https://github.com/ipfs/fs-repo-migrations/pull/163 + postPatch = lib.optionalString (lib.elem pname [ "fs-repo-10-to-11" "fs-repo-11-to-12" ]) '' + substituteInPlace 'vendor/github.com/marten-seemann/qtls-go1-15/common.go' \ + --replace \ + '"container/list"' \ + '"container/list" + "context"' \ + --replace \ + 'config *Config' \ + 'config *Config + ctx context.Context' + ''; doCheck = false; meta = kubo-migrator-unwrapped.meta // { mainProgram = pname;