about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2022-01-13 13:01:17 +0100
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-02-25 11:12:19 -0800
commit0eb1d070c85fb8bd14858596a6b29ae363a6af90 (patch)
tree793259023fc7608142756b0d5dbb0b503b5f549d /nixos
parent1e7c64aae12a346c862882b39aa39faa84e8936a (diff)
downloadnixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar.gz
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar.bz2
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar.lz
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar.xz
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.tar.zst
nixlib-0eb1d070c85fb8bd14858596a6b29ae363a6af90.zip
ipfs-migrator: 1.7.1 -> 2.0.2
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 https://github.com/ipfs/fs-repo-migrations/blob/3dc218e3006adac25e1cb5e969d7c9d961f15ddd/.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.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/network-filesystems/ipfs.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index b311b91b4a03..17da020bf3e2 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/ipfs.nix
@@ -259,7 +259,7 @@ in
         ipfs --offline config Mounts.IPFS ${cfg.ipfsMountDir}
         ipfs --offline config Mounts.IPNS ${cfg.ipnsMountDir}
       '' + optionalString cfg.autoMigrate ''
-        ${pkgs.ipfs-migrator}/bin/fs-repo-migrations -y
+        ${pkgs.ipfs-migrator}/bin/fs-repo-migrations -to '${cfg.package.repoVersion}' -y
       '' + ''
         ipfs --offline config show \
           | ${pkgs.jq}/bin/jq '. * $extraConfig' --argjson extraConfig ${