buildGoModule: remove compatibility layer for directly specified CGO_ENABLED

This commit is contained in:
Yueh-Shun Li
2025-09-11 00:39:52 +08:00
parent 55bcf33502
commit 3c9b0f85a4
2 changed files with 4 additions and 16 deletions

View File

@@ -38,6 +38,9 @@
- `python3Packages.bjoern` has been removed, as the upstream is unmaintained and it depends on a 14-year-old version of http-parser with numerous vulnerabilities.
- `buildGoModule` removes the compatibility layer of `CGO_ENABLED` not specified via `env`.
Specifying `CGO_ENABLED` directly now results in an error.
- `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.

View File

@@ -10,9 +10,6 @@ lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;
excludeDrvArgNames = [
"overrideModAttrs"
# Compatibility layer to the directly-specified CGO_ENABLED.
# TODO(@ShamrockLee): Remove after Nixpkgs 25.05 branch-off
"CGO_ENABLED"
];
extendDrvArgs =
finalAttrs:
@@ -226,19 +223,7 @@ lib.extendMkDerivation {
GO111MODULE = "on";
GOTOOLCHAIN = "local";
CGO_ENABLED =
args.env.CGO_ENABLED or (
if args ? CGO_ENABLED then
# Compatibility layer to the CGO_ENABLED attribute not specified as env.CGO_ENABLED
# TODO(@ShamrockLee): Remove and convert to
# CGO_ENABLED = args.env.CGO_ENABLED or go.CGO_ENABLED
# after the Nixpkgs 25.05 branch-off.
lib.warn
"${finalAttrs.finalPackage.meta.position}: buildGoModule: specify CGO_ENABLED with env.CGO_ENABLED instead."
args.CGO_ENABLED
else
go.CGO_ENABLED
);
CGO_ENABLED = args.env.CGO_ENABLED or go.CGO_ENABLED;
};
GOFLAGS =