Merge staging-next into staging

This commit is contained in:
nixpkgs-ci[bot]
2026-01-20 12:08:50 +00:00
committed by GitHub
80 changed files with 674 additions and 479 deletions

View File

@@ -420,6 +420,7 @@ lib.extendMkDerivation {
optional-dependencies
;
updateScript = nix-update-script { };
${if attrs ? stdenv then "__stdenvPythonCompat" else null} = attrs.stdenv;
}
// attrs.passthru or { };

View File

@@ -53,15 +53,28 @@ let
f':
lib.mirrorFunctionArgs f (
args:
if !(lib.isFunction args) && (args ? stdenv) then
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
${
args.name or args.pname or "<unnamed>"
}: Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
buildPythonPackage.override { stdenv = customStdenv; } { }
'' (f'.override { inherit (args) stdenv; } (removeAttrs args [ "stdenv" ]))
let
result = f args;
getName = x: x.pname or (lib.getName (x.name or "<unnamed>"));
applyMsgStdenvArg =
name:
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
${name}: Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
buildPythonPackage.override { stdenv = customStdenv; } { }
'';
in
if lib.isFunction args && result ? __stdenvPythonCompat then
# Less reliable, as constructing with the wrong `stdenv` might lead to evaluation errors in the package definition.
f'.override { stdenv = applyMsgStdenvArg (getName result) result.__stdenvPythonCompat; } (
finalAttrs: removeAttrs (args finalAttrs) [ "stdenv" ]
)
else if (!lib.isFunction args) && (args ? stdenv) then
# More reliable, but only works when args is not `(finalAttrs: { })`
f'.override { stdenv = applyMsgStdenvArg (getName args) args.stdenv; } (
removeAttrs args [ "stdenv" ]
)
else
f args
result
)
// {
# Preserve the effect of overrideStdenvCompat when calling `buildPython*.override`.