Commit e05528c6 authored by Yueh-Shun Li's avatar Yueh-Shun Li
Browse files

buildPython*: warn about deprecated argument stdenv



On Nixpkgs >= 26.05 (or precisely, oldest supported release >= 25.11),
warn about the use of buildPython*'s deprecated argument `stdenv`.

Co-authored-by: default avatarMatt Sturgeon <matt@sturgeon.me.uk>
parent 3a4c3745
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -50,8 +50,10 @@ let
    lib.setFunctionArgs (
      args:
      if !(lib.isFunction args) && (args ? stdenv) then
        # TODO: warn that `args ? stdenv` is deprecated (once in-tree usage is migrated)
        f.override { stdenv = args.stdenv; } args
        lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
          Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
            buildPythonPackage.override { stdenv = customStdenv; } { }
        '' (f.override { stdenv = args.stdenv; } args)
      else
        f args
    ) (removeAttrs (lib.functionArgs f) [ "stdenv" ])