Hash mismatch issue

Hi!

I receive the following error,

error: hash mismatch in fixed-output derivation '/nix/store/v0kdml4f2cscckzqy7mkyb83qf8wfirc-source.drv':
         specified: sha256-dydOZMOlm8Zt4vFvivf4PNN0WqyONirZ4dD5poZP8Og=
            got:    sha256-jiFWJkPD+iyQmyTYDriMqyRd+ywSyynyKOegRCXokiY=
error: 1 dependencies of derivation '/nix/store/7js3mcqi7sxsyzkicxfbf16axzzi6mzf-acpi-call-1.2.2-6.6.63.drv' failed to build
building '/nix/store/yyzajidrrihbcydhc1x464h619dyjry9-expect5.45.4.tar.gz.drv'...
building '/nix/store/b3hsy6sdcii33lav7amzxdbriv0jgl8v-firefox-128.1.0esr.source.tar.xz.drv'...
building '/nix/store/jh9l9lzc1d1yx0aff3ib96sm0c94dii5-gevent-24.2.1.tar.gz.drv'...
building '/nix/store/1ydv3qqcc7i5iry827mb23phvknxhb7q-ghc-9.2.4-x86_64-deb10-linux.tar.xz.drv'...
building '/nix/store/q6lf1lpj9m9j18swvv2319b52j9cf2hq-ghc-9.6.6-src.tar.xz.drv'...
building '/nix/store/iqqpj5js7ivvpvdbjmd2aasscfrh0w85-ghc-paths-0.1.0.12-r6.cabal.drv'...
building '/nix/store/8jnjklhircis47p14yxsar7rkz861rh7-ghc-paths-0.1.0.12.tar.gz.drv'...
building '/nix/store/v2inskc5n78qyprarszsi76l6i8mykfg-gjs-1.82.1.tar.xz.drv'...
building '/nix/store/2s67v7rgjghr7y46wb24ngz9qm7c536n-gridtables-0.1.0.0-r1.cabal.drv'...
building '/nix/store/xm9z5x94ypd305y6njnk7flkclya3jf7-gridtables-0.1.0.0.tar.gz.drv'...
error: 1 dependencies of derivation '/nix/store/qabyldf67zipnq2amgn8mlkf5w1gpd32-linux-6.6.63-modules.drv' failed to build
building '/nix/store/fld5l3a9257frwzp4n6vpy9j1lm2brac-logging-facade-0.3.1.tar.gz.drv'...
building '/nix/store/0ndh3q6n6pqprvbjilmrvvaq8vnl0946-logict-0.8.1.0-r1.cabal.drv'...
building '/nix/store/ylzfpq04mncc9pqaahgh4p2ayj66c1vy-logict-0.8.1.0.tar.gz.drv'...
building '/nix/store/ijk9qicpkws0acr4slrxh9l563qrdmkp-lpeg-1.0.4.tar.gz.drv'...
building '/nix/store/ray8wkkxn6m9akidmriksy6vf0cg2088-lua-2.3.3.tar.gz.drv'...
building '/nix/store/jm78rdyf84rin0gfa3dq9iwbaphl1i88-lua-arbitrary-1.0.1.1.tar.gz.drv'...
building '/nix/store/i4ap1q2fg2b7sdx2n8i2w9w27z8kmhh8-patchutils-0.3.3.drv' on 'ssh://192.168.1.208'...
error: 1 dependencies of derivation '/nix/store/hknc60g68y13aiv2n7r2mfhjh1d14fdl-nixos-system-sylveon-24.11.710050.62c435d93bf0.drv' failed to build

So, I figured it is the acpi-call 1.2.2 that has the mismatch, but why are both hashes different than on the NixPKGs? :thinking:

Right, I got the answer elsewhere: The specified hash is the same but the hash on NixPKGs has been formatted as base32 for some reason.

So the new upstream hash should just be committed to the acpi-call nixpkg, I think.

As we discussed elsewhere (just to put this in the thread here), you can convert between hash encodings to compare them with this:

❯ nix hash to-sri sha256:1s7h9y3adyfhw7cjldlfmid79lrwz3vqlvziw9nwd6x5qdj4w9vp
sha256-dydOZMOlm8Zt4vFvivf4PNN0WqyONirZ4dD5poZP8Og=

What I’m curious about is why it seems like the hash for an unchanged version of acpi_call has seemingly changed

I’ve found two commits (one the change on a branch, the other the merge commit for the branch) that match the hash in nixpkgs.

Without knowing more, it looks like the tag might have been moved to a later commit

The fetcher will be called as follows:
> fetchFromGitHub {
>   owner = "nix-community";
>   repo = "acpi_call";
>   rev = "9f1c0b5d046bdfdec769809435257647fd475473";
>   sha256 = "sha256:0000000000000000000000000000000000000000000000000000";
> }

sha256-dydOZMOlm8Zt4vFvivf4PNN0WqyONirZ4dD5poZP8Og=

The fetcher will be called as follows:
> fetchFromGitHub {
>   owner = "nix-community";
>   repo = "acpi_call";
>   rev = "4b14040db865034eb4aa215efd212307a9c60167";
>   sha256 = "sha256:0000000000000000000000000000000000000000000000000000";
> }

sha256-dydOZMOlm8Zt4vFvivf4PNN0WqyONirZ4dD5poZP8Og=

The version in nixpkgs was updated to v1.2.2 in August 2021.

The v1.2.2 tag in acpi_call is pointing to a commit from Jan 2022.

The solution for my original issue is to not use acpi_call.

However I understand this doesn’t solve the changed sha256 hash, which is the root issue.

NixOS-hardware removed the acpi_call dependency solved my problem.