NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.63k stars 13.78k forks source link

Build failure: buildGoModule with Go >= 1.22, with proxyVendor, changed vendorHash since 1.21 #300640

Closed nevivurn closed 5 months ago

nevivurn commented 6 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix build 'github:NixOS/nixpkgs?rev=afcd1c5328406c6cc32dfdc7c826032156520300#kustomize.goModules' --rebuild
  2. Build fails with hash mismatch.

Build log

$ nix build 'github:NixOS/nixpkgs?rev=afcd1c5328406c6cc32dfdc7c826032156520300#kustomize.goModules' --rebuild -L
kustomize> Running phase: unpackPhase
kustomize> unpacking source archive /nix/store/vmxagj10i0k6xfpaafahjnqflqclnzwd-source
kustomize> source root is source
kustomize> Running phase: patchPhase
kustomize> Running phase: updateAutotoolsGnuConfigScriptsPhase
kustomize> Running phase: configurePhase
kustomize> Running phase: buildPhase
kustomize> buildPhase completed in 1 minutes 13 seconds
kustomize> Running phase: installPhase
error: hash mismatch in fixed-output derivation '/nix/store/x3rlwii98ald3aj5z2qv36427wfsrmbk-kustomize-5.3.0-go-modules.drv':
         specified: sha256-6+8cwRH37lkQvnHBUlSqyNrZMfDpKbeUNJS4YMflBq0=
            got:    sha256-inCBDIVdvkEdDJEwX7vdoWANk+f01VxhBGPKxrjR6Ao=

Additional context

Example truncated diff between cached and built kustomize.goModules:

diff -r result/github.com/golang/protobuf/@v/v1.5.3.info result-new/github.com/golang/protobuf/@v/v1.5.3.info
1c1
< {"Version":"v1.5.3","Time":"2021-09-16T00:37:10Z","Origin":{"VCS":"git","URL":"https://github.com/golang/protobuf","Ref":"refs/tags/v1.5.3","Hash":"5d5e8c018a13017f9d5b8bf4fad64aaa42a87308"}}
\ No newline at end of file
---
> {"Version":"v1.5.3","Time":"2021-09-16T00:37:10Z","Origin":{"VCS":"git","URL":"https://github.com/golang/protobuf","Hash":"5d5e8c018a13017f9d5b8bf4fad64aaa42a87308","Ref":"refs/tags/v1.5.3"}}
\ No newline at end of file
List of affected packages: - aerc - age-plugin-tpm - alps-2022-10 - argocd-autopilot - bepass - boringssl-unstable-2024-02 - butler - coreth - dae - deck - deckmaster - dolt - go-migrate - goose - grype - hydron - icebreaker-unstable-2023-08 - juicity - kustomize - kustomize - phlare - pufferpanel - ratt-unstable-2023-02 - skate - snippetexpander - snippetexpandergui - sqlcmd - teleport - threatest - wails - wtf

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.10, NixOS, 23.11 (Tapir), 23.11.20240328.219951b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/63wn3078wdbrrax7vbcamzffaabmsvdl-source`

Add a :+1: reaction to issues you find important.

bjornfor commented 6 months ago

Ping @NixOS/golang.