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