Unverified Commit 6d1a6dde authored by Kira Bruneau's avatar Kira Bruneau Committed by GitHub
Browse files

Merge pull request #252070 from kira-bruneau/python3Packages.debugpy

python310Packages.debugpy: disable process test timeouts
parents 10580cdc 46413612
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
, pythonAtLeast
, fetchFromGitHub
, substituteAll
, fetchpatch
, gdb
, django
, flask
@@ -49,6 +50,13 @@ buildPythonPackage rec {
    # To avoid this issue, debugpy should be installed using python.withPackages:
    # python.withPackages (ps: with ps; [ debugpy ])
    ./fix-test-pythonpath.patch

    # Support disabling process timeouts when set to 0
    # See https://github.com/microsoft/debugpy/pull/1286
    (fetchpatch {
      url = "https://github.com/microsoft/debugpy/commit/1569cc8319350afcc5ba8630660f599d514ac3bb.patch";
      hash = "sha256-v4GKLb2M20F1egAGtix9cTkSzBnvSgSSphSQST5p63w=";
    })
  ] ++ lib.optionals stdenv.isLinux [
    # Hard code GDB path (used to attach to process)
    (substituteAll {
@@ -91,11 +99,8 @@ buildPythonPackage rec {
  ];

  preCheck = ''
    # Scale default timeouts by a factor of 4 to avoid flaky builds
    # https://github.com/microsoft/debugpy/pull/1286 if merged would
    # allow us to disable the timeouts altogether
    export DEBUGPY_PROCESS_SPAWN_TIMEOUT=60
    export DEBUGPY_PROCESS_EXIT_TIMEOUT=20
    export DEBUGPY_PROCESS_SPAWN_TIMEOUT=0
    export DEBUGPY_PROCESS_EXIT_TIMEOUT=0
  '' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
    # https://github.com/python/cpython/issues/74570#issuecomment-1093748531
    export no_proxy='*';