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

pyport.h from python2.7 sometimes clashes with c++ functions on OS X #22147

Closed
kiwifb opened this issue Jan 7, 2017 · 12 comments
Closed

pyport.h from python2.7 sometimes clashes with c++ functions on OS X #22147

kiwifb opened this issue Jan 7, 2017 · 12 comments

Comments

@kiwifb
Copy link
Member

kiwifb commented Jan 7, 2017

The recent upgrade to pynac-0.7.3 brought a flurry of compiling problem on OS X with the following kind of message

  CXX      libpynac_la-sum.lo
In file included from /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-7.5.rc2/local/include/c++/5.4.0/bits/basic_ios.h:37:0,
                 from /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-7.5.rc2/local/include/c++/5.4.0/ios:44,
                 from /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-7.5.rc2/local/include/c++/5.4.0/ostream:38,
                 from /Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-7.5.rc2/local/include/c++/5.4.0/iostream:39,
                 from class_info.h:31,
                 from registrar.h:30,
                 from basic.h:40,
                 from numeric.h:49,
                 from inifcns.h:26,
                 from sum.cpp:13:
/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-7.5.rc2/local/include/c++/5.4.0/bits/locale_facets.h:247:53: error: macro "toupper" passed 2 arguments, but takes just 1
       toupper(char_type *__lo, const char_type* __hi) const

This is caused by definition of macros for toupper and other functions in pyport.h specifically on OS X. This is unsafe with C++ and the issue has been known in MacPort for years: https://trac.macports.org/ticket/44288.

We should adopt their patch for python.

Component: packages: standard

Branch/Commit: u/fbissey/pyport @ 502aff0

Reviewer: François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/22147

@kiwifb kiwifb added this to the sage-7.5 milestone Jan 7, 2017
@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

Author: François Bissey

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

Branch: u/fbissey/pyport

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

comment:1

Python3 should be checked over as well.


New commits:

502aff0Adopt macport patch for pyport interference with C++ on OS X trac #22147

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

Commit: 502aff0

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

comment:2

I note that the upstream python issue http://bugs.python.org/issue10910 is marked closed while there was never really a good solution in my opinion.
Anyone can do something about this issue? Can it be re-opened, or do we need a new one.

@jdemeyer
Copy link

jdemeyer commented Jan 7, 2017

comment:3

The Python issue was fixed in Python 2.7.13, so could it be that #22037 also fixes the problem?

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

comment:4

Replying to @jdemeyer:

The Python issue was fixed in Python 2.7.13, so could it be that #22037 also fixes the problem?

Depends what's in pyport.h, I cannot see any commit being linked to issue 10910. I can have a look at #22037 which would then be a preferred option to this ticket, but I am running out of time.

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

comment:5

I just checked the python 2.7.13 tarball and the fix is in. So yes #22037 will fix the issue.

@kiwifb
Copy link
Member Author

kiwifb commented Jan 7, 2017

comment:6

I won't be able to deal with this since I'll be off for a week. I am ok for this ticket to be marked duplicate and #22037 to be marked blocker instead. I see it is needing review so I am guessing it is good to go.

@jdemeyer
Copy link

jdemeyer commented Jan 7, 2017

Reviewer: François Bissey

@jdemeyer
Copy link

jdemeyer commented Jan 7, 2017

Changed author from François Bissey to none

@jdemeyer jdemeyer removed this from the sage-7.5 milestone Jan 7, 2017
@vbraun
Copy link
Member

vbraun commented Jan 7, 2017

comment:8

Still don't understand why it works on the OSX buildbot, oh well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants