nix-community / nixpkgs-wayland

Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS. [maintainers=@colemickens, @Artturin]
502 stars 45 forks source link

eww: lockfile mismatch #461

Closed colemickens closed 2 weeks ago

colemickens commented 3 weeks ago
       last 10 log lines:
       > ERROR: cargoHash or cargoSha256 is out of date
       >
       > Cargo.lock is not the same in /build/cargo-vendor-dir
       >
       > To fix the issue:
       > 1. Set cargoHash/cargoSha256 to an empty string: `cargoHash = "";`
       > 2. Build the derivation and wait for it to fail with a hash mismatch
       > 3. Copy the "got: sha256-..." value back into the cargoHash field
       >    You should have: cargoHash = "sha256-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=";
       >
       For full logs, run 'nix log /nix/store/c4qwaabdg5x4zy4c0vr8d30pyaxlc7pg-eww-+4d55e9a.drv'.

but we don't set/override it in metadata.nix.

Artturin commented 3 weeks ago

Just adding the line and trying to build to get the hash should be enough to make it get automatically updated in the future

EDIT: nevermind I forgot we don't do that anymore lol, I'll check it out.

Artturin commented 3 weeks ago

cargoPatches breaks it https://github.com/NixOS/nixpkgs/blob/17d91fd24647329cf7ce01ee4a4c6601e32304f9/pkgs/by-name/ew/eww/package.nix#L30 , was added 5 days ago.

eww> Validating consistency between /build/source/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
eww> 1679c1679
eww> <  "time 0.3.36",
eww> ---
eww> >  "time 0.3.34",
eww> 2896c2896
eww> < version = "0.3.36"
eww> ---
eww> > version = "0.3.34"
eww> 2898c2898
eww> < checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
eww> ---
eww> > checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
eww> 2917c2917
eww> < version = "0.2.18"
eww> ---
eww> > version = "0.2.17"
eww> 2919c2919
eww> < checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
eww> ---
eww> > checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
eww> ERROR: cargoHash or cargoSha256 is out of date

the patch

diff --git a/Cargo.lock b/Cargo.lock
index 5d94bd4..acd2c8d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1676,7 +1676,7 @@ dependencies = [
  "libm",
  "log",
  "regex",
- "time 0.3.34",
+ "time 0.3.36",
  "urlencoding",
 ]

@@ -2893,9 +2893,9 @@ dependencies = [

 [[package]]
 name = "time"
-version = "0.3.34"
+version = "0.3.36"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
 dependencies = [
  "deranged",
  "itoa",
@@ -2914,9 +2914,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"

 [[package]]
 name = "time-macros"
-version = "0.2.17"
+version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
 dependencies = [
  "num-conv",
  "time-core",

because cargoPatches are added to cargoDeps and patches https://github.com/NixOS/nixpkgs/blob/3a431a31cb9b5d99a6e33a96a3cad7ad5aaab1c2/pkgs/build-support/rust/build-rust-package/default.nix#L74

I think we need to add patch support to https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/import-cargo-lock.nix and inherit the cargoPatches here https://github.com/nix-community/nixpkgs-wayland/blob/master/templates/template.nix#L90

Artturin commented 2 weeks ago

Worked around here but real fix in https://github.com/NixOS/nixpkgs/pull/337538