lol

lixVersions: use fetchCargoVendor

Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes. It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.

I've unified the cargoHash and cargoLock parameters into a single
cargoDeps parameter, which is what cargoHash and cargoLock end up
being shorthand for. Taking a cargoHash parameter for a package
builder isn't generally a good idea, because it will produce a
silently broken FOD if we change the hashing scheme, like we're doing
here. For Lix this wouldn't be too bad currently because lix-doc
isn't exposed and so can't be overridden, but I think this is still
cleaner than having two mutually exclusive parameters passed through
multiple layers of functions.

+37 -25
+4 -15
pkgs/tools/package-management/lix/common.nix
··· 1 1 { 2 2 lib, 3 3 fetchFromGitHub, 4 - version, 5 4 suffix ? "", 6 - hash ? null, 7 - src ? fetchFromGitHub { 8 - owner = "lix-project"; 9 - repo = "lix"; 10 - rev = version; 11 - inherit hash; 12 - }, 13 - docCargoHash ? null, 14 - docCargoLock ? null, 5 + version, 6 + src, 7 + docCargoDeps, 15 8 patches ? [ ], 16 9 maintainers ? lib.teams.lix.members, 17 10 }@args: 18 - assert (hash == null) -> (src != null); 19 11 { 20 12 stdenv, 21 13 meson, ··· 60 52 lix-doc ? callPackage ./doc { 61 53 inherit src; 62 54 version = "${version}${suffix}"; 63 - cargoHash = docCargoHash; 64 - cargoLock = docCargoLock; 55 + cargoDeps = docCargoDeps; 65 56 }, 66 57 67 58 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, ··· 76 67 stateDir, 77 68 storeDir, 78 69 }: 79 - assert lib.assertMsg (docCargoHash != null || docCargoLock != null) 80 - "Either `lix-doc`'s cargoHash using `docCargoHash` or `lix-doc`'s `cargoLock.lockFile` using `docCargoLock` must be set!"; 81 70 let 82 71 isLegacyParser = lib.versionOlder version "2.91"; 83 72 in
+31 -6
pkgs/tools/package-management/lix/default.nix
··· 5 5 callPackage, 6 6 fetchFromGitHub, 7 7 fetchpatch, 8 + rustPlatform, 8 9 Security, 9 10 10 11 storeDir ? "/nix/store", ··· 54 55 buildLix = common; 55 56 56 57 lix_2_90 = ( 57 - common { 58 + common rec { 58 59 version = "2.90.0"; 59 - hash = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc="; 60 - docCargoHash = "sha256-vSf9MyD2XzofZlbzsmh6NP69G+LiX72GX4Um9UJp3dc="; 60 + 61 + src = fetchFromGitHub { 62 + owner = "lix-project"; 63 + repo = "lix"; 64 + rev = version; 65 + hash = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc="; 66 + }; 67 + 68 + docCargoDeps = rustPlatform.fetchCargoVendor { 69 + name = "lix-doc-${version}"; 70 + inherit src; 71 + sourceRoot = "${src.name or src}/lix-doc"; 72 + hash = "sha256-VPcrf78gfLlkTRrcbLkPgLOk0o6lsOJBm6HYLvavpNU="; 73 + }; 61 74 } 62 75 ); 63 76 64 77 lix_2_91 = ( 65 - common { 78 + common rec { 66 79 version = "2.91.1"; 67 - hash = "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U="; 68 - docCargoHash = "sha256-F6Ld0HfRvW9r5zn8eMTP6djnV/jvwjYQet4Ghp2T90k="; 80 + 81 + src = fetchFromGitHub { 82 + owner = "lix-project"; 83 + repo = "lix"; 84 + rev = version; 85 + hash = "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U="; 86 + }; 87 + 88 + docCargoDeps = rustPlatform.fetchCargoVendor { 89 + name = "lix-doc-${version}"; 90 + inherit src; 91 + sourceRoot = "${src.name or src}/lix-doc"; 92 + hash = "sha256-U820gvcbQIBaFr2OWPidfFIDXycDFGgXX1NpWDDqENs="; 93 + }; 69 94 } 70 95 ); 71 96
+2 -4
pkgs/tools/package-management/lix/doc/default.nix
··· 2 2 src, 3 3 rustPlatform, 4 4 version, 5 - cargoHash ? null, 6 - cargoLock ? null, 5 + cargoDeps, 7 6 }: 8 7 9 8 rustPlatform.buildRustPackage { ··· 12 11 inherit 13 12 version 14 13 src 15 - cargoHash 16 - cargoLock 14 + cargoDeps 17 15 ; 18 16 }