Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#51032 closed defect (wontfix)

python27: modules built with the default python27 fail when used with python27 +ucs4

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: m74z00219@…
Port: python27

Description

That's the error:

Traceback (most recent call last):
  File "/opt/local/bin/itstool", line 25, in <module>
    import libxml2
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/libxml2.py", line 1, in <module>
    import libxml2mod
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/libxml2mod.so, 2): Symbol not found: _PyUnicodeUCS2_AsUTF8String
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/libxml2mod.so
  Expected in: flat namespace
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/libxml2mod.so

I have installed:

  itstool @2.0.2_2 (active)
  py27-libxml2 @2.9.2_0 (active)
  python27 @2.7.11_2+ucs4 (active)

Attachments (1)

main.log (35.2 KB) - added by ballapete (Peter "Pete" Dyballa) 9 years ago.
main.log

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: devans@… openmaintainer@… removed
Owner: changed from macports-tickets@… to devans@…
Summary: gtk-doc-1.25 fails to build on Mac OS X 10.6.8, Snow Leopard, because of Python27 problemsgtk-doc @1.25 fails to build with python27 +ucs4

As I recall, using python27's +ucs4 variant is the problem. My recollection is that the use of that variant is not recommended.

comment:2 in reply to:  1 Changed 9 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ryandesign@…:

As I recall, using python27's +ucs4 variant is the problem. My recollection is that the use of that variant is not recommended.

Some other package, that I don't remember, is needing exactly that variant…

comment:3 Changed 9 years ago by dbevans (David B. Evans)

The problem here is not with gtk-doc but with py27-xml2 which is being loaded by itstool during the build process. py27-xml2 is usually installed via binary archive which is built on the buildbots using python27 built with the default variants (not with +ucs4). As Ryan has said, the recommended solution is to avoid using python27 +ucs4 which does not provide the same symbols as the default version. If you insist on using python27 +ucs4 then you may need to rebuild py27-xml2 (and possibly others) locally using the -s option to build from source using your python version rather than loading the prebuilt binary archive.

sudo port -ns upgrade --force py27-xml2

I haven't tried doing this so no guarantees. Best to stick with the default version if at all possible.

comment:4 Changed 9 years ago by m74z00219@…

Cc: m74z00219@… added

Cc Me!

comment:5 Changed 8 years ago by todofixthis (Phoenix)

Upgrading py27-libxml2 using the method recommended in https://trac.macports.org/ticket/51032#comment:3 allowed me to build gtk-doc successfully.

` sudo port -ns upgrade --force py27-libxml2 `

Best to upgrade to Python 3.3 if at all possible (https://www.python.org/dev/peps/pep-0393/).

Last edited 8 years ago by todofixthis (Phoenix) (previous) (diff)

comment:6 in reply to:  5 Changed 8 years ago by dbevans (David B. Evans)

Port: python27 added; gtk-doc removed
Resolution: wontfix
Status: newclosed
Summary: gtk-doc @1.25 fails to build with python27 +ucs4python27: modules built with the default python27 fail when used with python27 +ucs4

Replying to phoenix.zerin@…:

Upgrading py27-libxml2 using the method recommended in https://trac.macports.org/ticket/51032#comment:3 allowed me to build gtk-doc successfully.

` sudo port -ns upgrade --force py27-libxml2 `

Best to upgrade to Python 3.3 if at all possible (https://www.python.org/dev/peps/pep-0393/).

In general, if use of the full Unicode code set is important for you, using a recent python3 where it is handled natively is, indeed, your best bet. We are currently discontinuing support for Python 3.3 so Python 3.4+ is recommended.

The problem here is not an issue with a particular port but with mixing binary modules built against python27 (binary archive of py27-xml2) with python27 +ucs4. Rebuilding these modules against python27 +ucs4 as recommended above can help but this is not guaranteed to work in all cases. Doing this properly would mean rebuilding all python modules from source (using port -s) against python2.7 +ucs but again this is believed to have led to other problems in the past.

I'm looking at upgrading itstool to use python3 if possible.

See https://trac.macports.org/ticket/51141#comment:3 for additional discussion of the +ucs4 issue.

comment:7 Changed 8 years ago by dbevans (David B. Evans)

Follow up:

itstool does not currently support python3 but there's work going on upstream to remedy the situation. See itstool PR #3.

Note: See TracTickets for help on using tickets.