Repository: microsoft/ptvsd

Issue:
New debugger displays warnings about `speeds using cython not found`
@DonJayamanne commented on [Mon Jan 28 2019](https://github.com/Microsoft/vscode-python/issues/4190)

Old version of PTVSD didn't display this warning, new version of PTVDS does.

Here's the old version:
<img width="924" alt="screen shot 2019-01-28 at 4 46 12 pm" src="https://user-images.githubusercontent.com/1948812/51876152-732e9580-231c-11e9-950c-2daf36348496.png">

Here's the output from the new version:
<img width="924" alt="screen shot 2019-01-28 at 4 46 54 pm" src="https://user-images.githubusercontent.com/1948812/51876162-7aee3a00-231c-11e9-926e-edc7c3a7991d.png">


I consider this a P1 as we're displaying warnings that we didn't (removed) in previous versions. This will end up confusing users.




Discussion:
/cc @fabioz 
Updated as P1 in PVSC
Curiously, this warning message is gated on `IS_PYCHARM` in pydevd source. Problem is, there's other stuff affected by this flag, so I'm not sure it's okay for us to just set it to true.
Curious indeed, this message didn't appear in previous version of ptvsd.
Should we remove this? Given that now we have wheels for several platforms. This is a good indicator that the users are not getting the best perf experience here. Previously we had removed this because there was no alternative to sdist package on linux. Also, wheels were limited to py 3.6 only on windows.
> This is a good indicator that the users are not getting the best perf experience here.

I'm getting this on my Mac. I thought we were shipping the `any` wheel.
Until we resolve this properly, lets disable it.
Or, if there's an env variable I can set, then let me know what it is, so I can initialize it in the launcher script.
We are shipping a `any` wheel: https://files.pythonhosted.org/packages/7c/36/6a9ffa370d1ab89e5cde192a9e368aa0088b10f2a0eb5dc813ecb57ef4b8/ptvsd-4.2.2-py3-none-any.whl

This message is coming from a separate location in pydevd. Looks like it is not respecting `pydevd_constants.CYTHON_SUPPORTED = False` that we set in `ptvsd`. For now we can suppress it by adding a check for this variable there. Later @fabioz can provide the right fix for it.
> hat we set in ptvsd. For now we can suppress it by adding a check for this variable there. 

A fix in PTVSD or Python Extension?

In ptvsd

Resolving patch:
diff --git a/src/ptvsd/_vendored/force_pydevd.py b/src/ptvsd/_vendored/force_pydevd.py
--- a/src/ptvsd/_vendored/force_pydevd.py
+++ b/src/ptvsd/_vendored/force_pydevd.py
@@ -18,7 +18,7 @@
 # # due to heavy use of "from" in them.
 with vendored('pydevd'):
     pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
-# Disable this, since we aren't packaging the Cython modules at the moment.
+# TODO: figure out what the appropriate setting is to work for both wheels and sdist.
 pydevd_constants.CYTHON_SUPPORTED = False
 # We limit representation size in our representation provider when needed.
 pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32
diff --git a/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py b/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py
--- a/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py
+++ b/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py
@@ -59,10 +59,11 @@ def delete_old_compiled_extensions():
 
     except ImportError:
         from _pydevd_bundle.pydevd_trace_dispatch_regular import trace_dispatch, global_cache_skips, global_cache_frame_skips, fix_top_level_trace_and_get_trace_func  # @UnusedImport
-        from _pydev_bundle.pydev_monkey import log_error_once
+        #from _pydev_bundle.pydev_monkey import log_error_once
 
-        log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
-            sys.executable, os.path.join(dirname, 'setup_cython.py')))
+        #log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
+        #    sys.executable, os.path.join(dirname, 'setup_cython.py')))
+        pass
 
 else:
     raise RuntimeError('Unexpected value for PYDEVD_USE_CYTHON: %s (accepted: YES, NO)' % (use_cython,))
diff --git a/src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py b/src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py
--- a/src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py
+++ b/src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py
@@ -31,8 +31,9 @@
 
             dirname = os.path.dirname(os.path.dirname(__file__))
             if not IS_PYCHARM:
-                log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
-                    sys.executable, os.path.join(dirname, 'setup_cython.py')))
+                #log_error_once("warning: Debugger speedups using cython not found. Run '\"%s\" \"%s\" build_ext --inplace' to build." % (
+                #    sys.executable, os.path.join(dirname, 'setup_cython.py')))
+                pass
             else:
                 show_frame_eval_warning = True
 


Test patch: