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

buildPython*: overrideStdenvCompat: abstract warning

parent 9a0b5612
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -53,13 +53,19 @@ let
      f':
      lib.mirrorFunctionArgs f (
        args:
        if !(lib.isFunction args) && (args ? stdenv) then
        let
          getName = x: x.pname or (lib.getName (x.name or "<unnamed>"));
          applyMsgStdenvArg =
            name:
            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:
              ${name}: 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" ]))
            '';
        in
        if !(lib.isFunction args) && (args ? stdenv) then
          applyMsgStdenvArg (getName args) (
            f'.override { inherit (args) stdenv; } (removeAttrs args [ "stdenv" ])
          )
        else
          f args
      )