I’m trying to package terraform-godaddy to use in one of my projects.
However the build either fails locally or on the CI pipeline, each
expecting a different hash for modSha256
. When running locally, it
tries to build but complains with:
hash mismatch in fixed-output derivation '/nix/store/jgbfkhlsz6bmq724p5cqqcgfyc7l6sdv-terraform-godaddy-1.6.4-go-modules':
wanted: sha256:0p81wqw2n8vraxk20xwg717582ijwq2k7v5j3n13y4cd5bxd8hhz
got: sha256:10n2dy7q9kk1ly58sw965n6qa8l0nffh8vyd1vslx0gdlyj25xxs
cannot build derivation '/nix/store/y5961vv6y9c0ps2sbd8xfnpqvk0q7qhq-terraform-godaddy-1.6.4.drv': 1 dependencies couldn't be built
If I change the hash to the one it got the build passes locally, but
fails on the CI with the inverse:
hash mismatch in fixed-output derivation '/nix/store/q8y0mzjl78hfhazjgq2sc84i7dp9wnh0-terraform-godaddy-1.6.4-go-modules':
wanted: sha256:10n2dy7q9kk1ly58sw965n6qa8l0nffh8vyd1vslx0gdlyj25xxs
got: sha256:0p81wqw2n8vraxk20xwg717582ijwq2k7v5j3n13y4cd5bxd8hhz
cannot build derivation '/nix/store/w4ghinrmpq524k3617ikfc8i42aa0dbb-terraform-godaddy-1.6.4.drv': 1 dependencies couldn't be built
The offending derivation is:
terraform-godaddy = pkgs.buildGoModule rec {
name = "terraform-godaddy-${version}";
version = "1.6.4";
src = pkgs.fetchFromGitHub {
owner = "n3integration";
repo = "terraform-godaddy";
rev = "v${version}";
sha256 = "00blqsan74s53dk9ab4hxi1kzxi46k57dr65dmbiradfa3yz3852";
};
modSha256 = "0p81wqw2n8vraxk20xwg717582ijwq2k7v5j3n13y4cd5bxd8hhz";
postInstall =
"mv $out/bin/terraform-godaddy $out/bin/terraform-provider-godaddy";
};
Why is it changing? Where this difference might be coming from?
I tried looking at the Go modules section of the manual, but there
was nothing special regarding Go that would differ from any normal
derivation.
I couldn’t find anything online too. The full log of the local and CI
builds is also available.