buildGoModule: warn for passthru.overrideModAttrs lost after overriding

This commit is contained in:
Yueh-Shun Li
2025-08-29 03:10:57 +08:00
parent 3cca2c60f7
commit 8c54246b3d
2 changed files with 13 additions and 1 deletions
+4
View File
@@ -21,7 +21,11 @@
- The `offrss` package was removed due to lack of upstream maintenance since 2012. It's recommended for users to migrate to another RSS reader
- `base16-builder` node package has been removed due to lack of upstream maintenance.
- `buildGoModule` now warns if `<pkg>.passthru.overrideModAttrs` is lost during the overriding of its result packages.
- `gentium` package now provides `Gentium-*.ttf` files, and not `GentiumPlus-*.ttf` files like before. The font identifiers `Gentium Plus*` are available in the `gentium-plus` package, and if you want to use the more recently updated package `gentium` [by sil](https://software.sil.org/gentium/), you should update your configuration files to use the `Gentium` font identifier.
- `space-orbit` package has been removed due to lack of upstream maintenance. Debian upstream stopped tracking it in 2011.
- Derivations setting both `separateDebugInfo` and one of `allowedReferences`, `allowedRequistes`, `disallowedReferences` or `disallowedRequisites` must now set `__structuredAttrs` to `true`. The effect of reference whitelisting or blacklisting will be disabled on the `debug` output created by `separateDebugInfo`.
+9 -1
View File
@@ -202,7 +202,15 @@ lib.extendMkDerivation {
outputHashAlgo = if finalAttrs.vendorHash == "" then "sha256" else null;
# in case an overlay clears passthru by accident, don't fail evaluation
}).overrideAttrs
(finalAttrs.passthru.overrideModAttrs or overrideModAttrs);
(
let
pos = builtins.unsafeGetAttrPos "passthru" finalAttrs;
posString =
if pos == null then "unknown" else "${pos.file}:${toString pos.line}:${toString pos.column}";
in
finalAttrs.passthru.overrideModAttrs
or (lib.warn "buildGoModule: ${finalAttrs.name or finalAttrs.pname}: passthru.overrideModAttrs missing after overrideAttrs. Last overridden at ${posString}." overrideModAttrs)
);
nativeBuildInputs = [ go ] ++ nativeBuildInputs;