buildGoApplication: warn if buildFlagsArray is used

This is a port of 3360a376cb
This commit is contained in:
adisbladis 2022-06-14 19:04:48 +08:00
parent 8aa44afb7e
commit 359449a284

View file

@ -182,8 +182,9 @@ let
, passthru ? { }
, tags ? [ ]
# needed for buildFlags warning
# needed for buildFlags{,Array} warning
, buildFlags ? ""
, buildFlagsArray ? ""
, ...
}@attrs:
@ -221,8 +222,9 @@ let
inherit go modulesStruct localReplaceCommands defaultPackage;
};
package = lib.warnIf (buildFlags != "")
"Use the `ldflags` and/or `tags` attributes instead of `buildFlags`"
package =
lib.warnIf (buildFlags != "" || buildFlagsArray != "")
"Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`"
stdenv.mkDerivation (lib.optionalAttrs (defaultPackage != "")
{
pname = attrs.pname or baseNameOf defaultPackage;