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

_cursesmodule compile error in OS X 32-bit-only installer build #58433

Closed
ned-deily opened this issue Mar 7, 2012 · 9 comments
Closed

_cursesmodule compile error in OS X 32-bit-only installer build #58433

ned-deily opened this issue Mar 7, 2012 · 9 comments
Assignees
Labels
build The build process and cross-build OS-mac release-blocker

Comments

@ned-deily
Copy link
Member

BPO 14225
Nosy @birkenfeld, @vstinner, @ned-deily

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/ned-deily'
closed_at = <Date 2012-06-21.07:06:31.693>
created_at = <Date 2012-03-07.22:59:45.385>
labels = ['OS-mac', 'build', 'release-blocker']
title = '_cursesmodule compile error in OS X 32-bit-only installer build'
updated_at = <Date 2012-08-06.13:53:18.452>
user = 'https://github.com/ned-deily'

bugs.python.org fields:

activity = <Date 2012-08-06.13:53:18.452>
actor = 'ned.deily'
assignee = 'ned.deily'
closed = True
closed_date = <Date 2012-06-21.07:06:31.693>
closer = 'ned.deily'
components = ['Build', 'macOS']
creation = <Date 2012-03-07.22:59:45.385>
creator = 'ned.deily'
dependencies = []
files = []
hgrepos = []
issue_num = 14225
keywords = []
message_count = 9.0
messages = ['155130', '163206', '163220', '163261', '163305', '163307', '163313', '163323', '167565']
nosy_count = 4.0
nosy_names = ['georg.brandl', 'vstinner', 'ned.deily', 'python-dev']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue14225'
versions = ['Python 3.3']

@ned-deily
Copy link
Member Author

./Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t'
/Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c: In function 'PyCurses_ConvertToCchar_t':
./Modules/_cursesmodule.c:289: error: 'obj' undeclared (first use in this function)/Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t'

Note to self, this installer build builds its own version of ncurses. It may need adjusting for 3.3.

@ned-deily ned-deily self-assigned this Mar 7, 2012
@ned-deily ned-deily added build The build process and cross-build OS-mac labels Mar 7, 2012
@birkenfeld
Copy link
Member

Is this issue still valid?

@ned-deily
Copy link
Member Author

It was still valid as of 3.3.0a4.

@birkenfeld
Copy link
Member

And will you fix it for beta1, or do you think it can be done later?

BTW, what is the syntax error here? I don't really see it...

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jun 21, 2012

New changeset 2035c5ad4239 by Ned Deily in branch 'default':
Issue bpo-14225: Fix Unicode support for curses (bpo-12567) on OS X:
http://hg.python.org/cpython/rev/2035c5ad4239

@ned-deily
Copy link
Member Author

It turns out that the Unicode support for curses did not build correctly on OS X at all. There were two issues:

  1. On OS X, unlike many systems, does not supply separate libncurses and libncursesw in /usr/lib; same for libpanel/libpanelw. So the tests in setup.py based on the presence of the "w" libs failed, thus disabling the wide-char support in the extension modules even though the OS X libs supported it. The tests in setup.py are now fixed to handle building on OS X with either the system libs or locally-supplied copies.

  2. The 32-bit-only installer has historically built and supplied its own copy of libncursesw so that installer build did find a wide lib. However, the wide code support within ncurses is conditional depending on _XOPEN_SOURCE_EXTENDED which is specifically not defined for OS X (platform=='darwin') builds. That caused the compile errors (things like cchar_t from the ncurses include files were not getting defined). The solution for that is to supply _XOPEN_SOURCE_EXTENDED locally to the _curses* extension module builds.

@vstinner
Copy link
Member

Cool, thanks for the fix!

@ned-deily
Copy link
Member Author

P.S. All is not perfect. I initially missed re-running test_curses with the system ncurses library on OS X where ncurses is at 5.4 or with the 32-bit-installer which builds ncurses 5.5. When I did, test_curses failed as described in bpo-15037. test_curses passes when Python is built with a MacPorts ncurses 5.9. The best solution would be to update the installer builds to build and use the latest ncurses 5.9. That may have to wait until after 3.3.0b1.

@ned-deily
Copy link
Member Author

P.P.S. I've updated the OS X installers as of 3.3.0b2 to build and link with a local copy of ncurses 5.9 rather than older Apple-supplied ones. test_curses now passes.

@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
build The build process and cross-build OS-mac release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants