From 540fb7a27074eec677266b218e8bbe9a385cbfa5 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 24 Jan 2023 20:43:54 +0100 Subject: [PATCH 1/2] 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; From 9c87860827088ab5bcde8718bde99c40a4c533b6 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Wed, 14 Dec 2022 00:49:55 +0100 Subject: [PATCH 2/2] kubo-migrator: add migration from 12 to 13 https://github.com/ipfs/fs-repo-migrations/releases/tag/fs-repo-12-to-13%2Fv1.0.0 This will be used to upgrade the Kubo repo when updating to Kubo 0.18. --- .../networking/kubo-migrator/all-migrations.nix | 4 +++- pkgs/applications/networking/kubo-migrator/unwrapped.nix | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/kubo-migrator/all-migrations.nix b/pkgs/applications/networking/kubo-migrator/all-migrations.nix index 95b3386ed1f1..08a9967de4a0 100644 --- a/pkgs/applications/networking/kubo-migrator/all-migrations.nix +++ b/pkgs/applications/networking/kubo-migrator/all-migrations.nix @@ -36,8 +36,9 @@ let }; # Concatenation of the latest repo version and the version of that migration - version = "12.1.0.2"; + version = "13.1.0.0"; + fs-repo-12-to-13 = fs-repo-common "fs-repo-12-to-13" "1.0.0"; fs-repo-11-to-12 = fs-repo-common "fs-repo-11-to-12" "1.0.2"; fs-repo-10-to-11 = fs-repo-common "fs-repo-10-to-11" "1.0.1"; fs-repo-9-to-10 = fs-repo-common "fs-repo-9-to-10" "1.0.1"; @@ -52,6 +53,7 @@ let fs-repo-0-to-1 = fs-repo-common "fs-repo-0-to-1" "1.0.1"; all-migrations = [ + fs-repo-12-to-13 fs-repo-11-to-12 fs-repo-10-to-11 fs-repo-9-to-10 diff --git a/pkgs/applications/networking/kubo-migrator/unwrapped.nix b/pkgs/applications/networking/kubo-migrator/unwrapped.nix index a99ab2b2cbb6..dcf206d5c8aa 100644 --- a/pkgs/applications/networking/kubo-migrator/unwrapped.nix +++ b/pkgs/applications/networking/kubo-migrator/unwrapped.nix @@ -15,13 +15,13 @@ buildGoModule rec { # The fs-repo-migrations code itself is the same between # the two versions but the migration code, which is built # into separate binaries, is not. - rev = "fs-repo-11-to-12/v1.0.2"; - sha256 = "sha256-CG4utwH+/+Igw+SP3imhl39wijlB53UGtkJG5Mwh+Ik="; + rev = "fs-repo-12-to-13/v1.0.0"; + hash = "sha256-QQone7E2Be+jVfnrwqQ1Ny4jo6mSDHhaY3ErkNdn2f8="; }; sourceRoot = "source/fs-repo-migrations"; - vendorSha256 = "sha256-/DqkBBtR/nU8gk3TFqNKY5zQU6BFMc3N8Ti+38mi/jk="; + vendorHash = "sha256-/DqkBBtR/nU8gk3TFqNKY5zQU6BFMc3N8Ti+38mi/jk="; doCheck = false;