Skip to content

setup.py doesn't fail if compiler is missing #1018

@int19h

Description

@int19h

Build log:

PS C:\git\debugpy> py -3.10-64 setup.py bdist
C:\Python\3.10-64\python.exe
Compiling extension modules (set SKIP_CYTHON_BUILD=1 to omit)
running build_ext
building '_pydevd_bundle.pydevd_cython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
running bdist
running bdist_dumb
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\debugpy
...

Note that it failed to build the pydevd extension modules, but still proceeded to package debugpy. If you don't pay close attention to the output, you might not even notice that said extension modules are missing.

The problem is that modules are built in a subprocess of setup.py, and we don't check the exit code of said subprocess:

debugpy/setup.py

Lines 36 to 45 in 8b5eeee

def cython_build():
print("Compiling extension modules (set SKIP_CYTHON_BUILD=1 to omit)")
subprocess.call(
[
sys.executable,
os.path.join(PYDEVD_ROOT, "setup_pydevd_cython.py"),
"build_ext",
"-i",
]
)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions