Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
int19h opened this issue Aug 16, 2022 · 0 comments
Closed

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

int19h opened this issue Aug 16, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@int19h
Copy link
Contributor

int19h commented Aug 16, 2022

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",
]
)

@int19h int19h added the bug Something isn't working label Aug 16, 2022
@int19h int19h self-assigned this Sep 27, 2022
int19h pushed a commit to int19h/debugpy that referenced this issue Oct 3, 2022
Add setup.py custom command to build pydevd Cython extensions.

Expose environment variable to control build failure mode if extensions fail to compile.
int19h pushed a commit to int19h/debugpy that referenced this issue Oct 4, 2022
Do not build pydevd extensions unless building debugpy.

Expose environment variable to control build failure mode if extensions fail to compile.
int19h pushed a commit to int19h/debugpy that referenced this issue Oct 4, 2022
Do not build pydevd extensions unless building debugpy.

Expose environment variable to control build failure mode if extensions fail to compile.
@int19h int19h closed this as completed in 7c8172e Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant