buildGoModule: be nicer when overrideAttrs clears passthru
Before an overlay in the form of: package.overrideAttrs (old: { passthru = {}; }) would fail evaluation like: error: attribute 'overrideModAttrs' missing at /nix/store/afwc3m1sm49qq57xjv2hmd7iy4x0j33h-source/pkgs/build-support/go/module.nix:179:20: 178| outputHashAlgo = if finalAttrs.vendorHash == "" then "sha256" else null; 179| }).overrideAttrs finalAttrs.passthru.overrideModAttrs; | ^ 180| Now instead we take the fallback default.
This commit is contained in:
parent
9d4badae3e
commit
bc12ef1bf0
@ -176,7 +176,8 @@ in
|
||||
# Handle empty vendorHash; avoid
|
||||
# error: empty hash requires explicit hash algorithm
|
||||
outputHashAlgo = if finalAttrs.vendorHash == "" then "sha256" else null;
|
||||
}).overrideAttrs finalAttrs.passthru.overrideModAttrs;
|
||||
# in case an overlay clears passthru by accident, don't fail evaluation
|
||||
}).overrideAttrs (finalAttrs.passthru.overrideModAttrs or overrideModAttrs);
|
||||
|
||||
nativeBuildInputs = [ go ] ++ nativeBuildInputs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user