mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 17:43:42 +00:00
0eb1d070c8
https://github.com/ipfs/fs-repo-migrations/releases/tag/v2.0.2
This is pretty much a complete rewrite of the ipfs-migrator package.
In version 2.0.0 a major change was made to the way the migrator works. Before, there was one binary that contained every migration. Now every migration has its own binary. If fs-repo-migrations can't find a required binary in the PATH, it will download it off the internet. To prevent that, build every migration individually, symlink them all into one package and then wrap fs-repo-migrations so it finds the package with all the migrations.
The change to the IPFS NixOS module and the IPFS package is needed because without explicitly specifying a repo version to migrate to, fs-repo-migrations will query the internet to find the latest version. This fails in the sandbox, for example when testing the ipfs passthru tests.
While it may seem like the repoVersion and IPFS version are in sync and the code could be simplified, this is not the case. See https://github.com/ipfs/fs-repo-migrations#when-should-i-migrate for a table with the IPFS versions and corresponding repo versions.
Go 1.17 breaks the migrations, so use Go 1.16 instead. This is also the Go version used in their CI, see 3dc218e300/.github/workflows/test.yml (L4)
. See https://github.com/ipfs/fs-repo-migrations/pull/140#issuecomment-982715907 for a previous mention of this issue. The issue manifests itself when doing anything with a migration, for example `fs-repo-11-to-12 --help`:
```
panic: qtls.ClientHelloInfo doesn't match
goroutine 1 [running]:
github.com/marten-seemann/qtls-go1-15.init.0()
github.com/marten-seemann/qtls-go1-15@v0.1.1/unsafe.go:20 +0x132
```
Also add myself as a maintainer for this package.
This fixes the test failure discovered in https://github.com/NixOS/nixpkgs/pull/160914.
See https://github.com/ipfs/fs-repo-migrations/issues/148 to read some of my struggles with updating this package.
36 lines
1009 B
Nix
36 lines
1009 B
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "ipfs-migrator";
|
|
version = "2.0.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ipfs";
|
|
repo = "fs-repo-migrations";
|
|
# Use the latest git tag here, since v2.0.2 does not
|
|
# contain the latest migration fs-repo-11-to-12/v1.0.2
|
|
# 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=";
|
|
};
|
|
|
|
sourceRoot = "source/fs-repo-migrations";
|
|
|
|
vendorSha256 = "sha256-/DqkBBtR/nU8gk3TFqNKY5zQU6BFMc3N8Ti+38mi/jk=";
|
|
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
description = "Migrations for the filesystem repository of ipfs clients";
|
|
homepage = "https://github.com/ipfs/fs-repo-migrations";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ Luflosi elitak ];
|
|
mainProgram = "fs-repo-migrations";
|
|
};
|
|
}
|