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

For non-debug builds, the cygwinccompiler.py should define NDEBUG #51431

Closed
stutzbach mannequin opened this issue Oct 21, 2009 · 9 comments
Closed

For non-debug builds, the cygwinccompiler.py should define NDEBUG #51431

stutzbach mannequin opened this issue Oct 21, 2009 · 9 comments
Assignees
Labels
OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@stutzbach
Copy link
Mannequin

stutzbach mannequin commented Oct 21, 2009

BPO 7182
Nosy @tarekziade, @merwok, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tarekziade'
closed_at = <Date 2021-02-03.18:16:17.989>
created_at = <Date 2009-10-21.17:48:59.978>
labels = ['type-bug', 'library', 'OS-windows']
title = 'For non-debug builds, the cygwinccompiler.py should define NDEBUG'
updated_at = <Date 2021-02-03.18:16:17.988>
user = 'https://bugs.python.org/stutzbach'

bugs.python.org fields:

activity = <Date 2021-02-03.18:16:17.988>
actor = 'steve.dower'
assignee = 'tarek'
closed = True
closed_date = <Date 2021-02-03.18:16:17.989>
closer = 'steve.dower'
components = ['Distutils', 'Windows']
creation = <Date 2009-10-21.17:48:59.978>
creator = 'stutzbach'
dependencies = []
files = []
hgrepos = []
issue_num = 7182
keywords = []
message_count = 9.0
messages = ['94315', '94326', '94327', '94372', '112718', '113302', '114538', '222616', '386297']
nosy_count = 5.0
nosy_names = ['tarek', 'stutzbach', 'eric.araujo', 'rpetrov', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue7182'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@stutzbach
Copy link
Mannequin Author

stutzbach mannequin commented Oct 21, 2009

Currently, msvccompiler.py defines NDEBUG for non-debug builds. Unix
builds do as well, via python-config. However, cygwinccompiler.py does not.

@stutzbach stutzbach mannequin assigned tarekziade Oct 21, 2009
@stutzbach stutzbach mannequin added the stdlib Python modules in the Lib dir label Oct 21, 2009
@rpetrov
Copy link
Mannequin

rpetrov mannequin commented Oct 21, 2009

Posix build system read flags from makefile.
Configure script add -DNDEBUG to OPT flag. So why cygwinccompiler.py has
to set this ?
Next cygwinccompiler currently is not used in python build system.

@stutzbach
Copy link
Mannequin Author

stutzbach mannequin commented Oct 21, 2009

Sorry, I should have said the mingw32 compiler, which is contained in
cygwincompiler.py The mingw32 compiler is a free compiler compatible
with MSVC. Since it's used with the Windows version of python, there is
no configure script.

I noticed this when trying to build an extension module with "python
setup.py build -c mingw32", using the Windows (not cygwin) version of
python. The extension module failed to compile because had a line like
this:
assert(my_struct->debug_only_field);

where "debug_only_field" is only declared if Py_DEBUG is set. When
NDEBUG is set, the assert disappears and the compile works as expected.

@rpetrov
Copy link
Mannequin

rpetrov mannequin commented Oct 22, 2009

Ok Daniel.
In this case for debug build _DEBUG has to be defined too - please check
pyconfig.h from MSVC builds.
May be you could use CFLAGS environment variable.

@terryjreedy
Copy link
Member

Roumen, were you suggesting that this is a user rather than build issue, or just suggesting a workaround until fixed?

@rpetrov
Copy link
Mannequin

rpetrov mannequin commented Aug 8, 2010

Hi Terry,
both :
a) suggestion is for CFLAGS as work-around
b) clarification as build use two preprocessor defines :

  • NDEBUG is defined for non-debug builds
  • _DEBUG is defined for debug builds
    (ref msvc{9}compiler.py)

@florentx florentx mannequin added the OS-windows label Aug 10, 2010
@merwok
Copy link
Member

merwok commented Aug 21, 2010

Would this change fix an important bug, or is it a feature request? Behavior changes that don’t fix bugs don’t go into distutils.

@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Jul 9, 2014

I think this is a bug but on the other hand I found msg94327 extremely confusing. Would someone like to clarify the situation.

@BreamoreBoy BreamoreBoy mannequin added the type-bug An unexpected behavior, bug, or error label Jul 9, 2014
@zooba
Copy link
Member

zooba commented Feb 3, 2021

Distutils is now deprecated (see PEP-632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools

@zooba zooba closed this as completed Feb 3, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants