Skip to content

[CI][Python] Use Debug build on our Windows Python CI job #47583

Description

@raulcd

Describe the enhancement requested

When we migrated from AppVeyor to GitHub we set CMAKE_BUILD_TYPE=Release it would be good to use Debug builds.
When trying to naively set set CMAKE_BUILD_TYPE=Debug we got:

| =================================== ERRORS ====================================
| ________________________ ERROR collecting test session ________________________
| C:\Python313\Lib\importlib\__init__.py:88: in import_module
|     return _bootstrap._gcd_import(name[level:], package, level)
|            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| <frozen importlib._bootstrap>:1387: in _gcd_import
|     ???
| <frozen importlib._bootstrap>:1360: in _find_and_load
|     ???
| <frozen importlib._bootstrap>:1310: in _find_and_load_unlocked
|     ???
| <frozen importlib._bootstrap>:488: in _call_with_frames_removed
|     ???
| <frozen importlib._bootstrap>:1387: in _gcd_import
|     ???
| <frozen importlib._bootstrap>:1360: in _find_and_load
|     ???
| <frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
|     ???
| <frozen importlib._bootstrap>:935: in _load_unlocked
|     ???
| <frozen importlib._bootstrap_external>:1026: in exec_module
|     ???
| <frozen importlib._bootstrap>:488: in _call_with_frames_removed
|     ???
| C:\Python313\Lib\site-packages\pyarrow\__init__.py:61: in <module>
|     import pyarrow.lib as _lib
| pyarrow/config.pxi:95: in init pyarrow.lib
|     ???
| pyarrow/config.pxi:75: in pyarrow.lib._build_info
|     ???
| <stringsource>:44: in string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string
|     ???
| E   MemoryError

Relevant stackoverflow:
https://stackoverflow.com/questions/62792200/c-std-string-different-between-debug-and-release-dynamic-library/72481742#72481742

This is because we are building PyArrow on Release mode on Windows no matter the value for PYARROW_BUILD_TYPE because of:

arrow/python/setup.py

Lines 175 to 179 in 6c0c3cd

if sys.platform == 'win32':
# Cannot do debug builds in Windows unless Python itself is a debug
# build
if not hasattr(sys, 'gettotalrefcount'):
self.build_type = 'release'

This started as a conversation on:
#47567 (comment)

Component(s)

Continuous Integration, Python

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions