buildPerlPackage: remove explicit src argument

This goal of this change is to make nix-update-script work out of the
box with packages built using `buildPerlPackage`.

Explicitly setting `src` in the `stdenv.mkDerivation` call currently
causes `builtins.unsafeGetAttrPos "src" <package>` to point to
`pkgs/development/perl-modules/generic/default.nix` for packages built
using `buildPerlPackage`. If the result of this expression is not
`null`, nix-update will try to update `src` of `<package>` in this
file [1], which will fail for obvious reasons.

A good example of this happening is with the pgformatter package.
Removing the explicit `inherit src` allows
`builtins.unsafeGetAttrPos "src" <package>` to point to the file where
`<package>.src` is actually defined, fixing nix-update runs for
affected packages.

Git history doesn't provide any indication as to why this argument was
introduced in the first place, so I hope it's fine to remove it. The
only difference in evaluation will be for calls to `buildPerlPackage`
without `src`: In these cases, `src` will be unset instead of `null`.

[1] https://github.com/Mic92/nix-update/blob/8227513ecf2f9ca657951fac3a6935410107eb90/nix_update/eval.nix#L99
This commit is contained in:
Tom Hunze
2026-01-19 00:15:38 +01:00
parent 78f6d5afc4
commit 2f2b2bf499
@@ -12,7 +12,6 @@
"out"
"devdoc"
],
src ? null,
# enabling or disabling does nothing for perl packages so set it explicitly
# to false to not change hashes when enableParallelBuildingByDefault is enabled
@@ -64,7 +63,6 @@ lib.throwIf (attrs ? name)
inherit
outputs
src
doCheck
checkTarget
enableParallelBuilding