zepheira / amara

Amara 2.0. Amara XML toolkit is an open-source collection of Python tools for XML processing, not just tools that happen to be written in Python, but tools built from the ground up to use Python idioms and take advantage of the many advantages of Python over other programming languages.
http://wiki.xml3k.org/Amara2
Apache License 2.0
23 stars 9 forks source link

python 3 or pypy support #23

Open tingletech opened 5 years ago

tingletech commented 5 years ago

I need to migrate to either pypy or python 3 after Jan 2020. Any ideas for a good migration path for a python2 project that uses akara and needs to be migrated?

tingletech commented 5 years ago

specifically, with pypy -- there seems to be a problem here -- at least on Mac OS

lib/src/expat/lib/internal.h
 77 #if SIZEOF_INT >= 4
 78 typedef unsigned int ICHAR32;
 79 #elif SIZEOF_LONG >= 4
 80 typedef unsigned long ICHAR32;
 81 #else
 82 #error No suitable type found for 32-bit storage!
 83 #endif
cc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -g -DHAVE_EXPAT_CONFIG_H -DExpat_BUILDING_MODULE -Ilib/src -Ilib/src/expat -I/Users/tingle/code/amara/pypy/include -c lib/src/expat/lib/xmlparse.c -o build/temp.macosx-10.14-x86_64-2.7/lib/src/expat/lib/xmlparse.o
lib/src/expat/lib/xmlparse.c:89:2: error: memmove does not exist on this platform, nor is a substitute available
#error memmove does not exist on this platform, nor is a substitute available
 ^
In file included from lib/src/expat/lib/xmlparse.c:93:
lib/src/expat/lib/internal.h:82:2: error: No suitable type found for 32-bit storage!
#error No suitable type found for 32-bit storage!
 ^
In file included from lib/src/expat/lib/xmlparse.c:94:
lib/src/expat/lib/xmltok.h:176:32: error: unknown type name 'ICHAR32'
                               ICHAR32 **toP,
                               ^
lib/src/expat/lib/xmltok.h:177:38: error: unknown type name 'ICHAR32'
                               const ICHAR32 *toLim);
                                     ^
lib/src/expat/lib/xmltok.h:294:45: error: unknown type name 'ICHAR32'
int FASTCALL XmlUtf32Encode(int charNumber, ICHAR32 *buf);
                                            ^
5 errors generated.
error: command 'cc' failed with exit status 1
uogbuji commented 5 years ago

Oh goodness! I'm a bit stumped on how to help. I haven't even looked at the Amara 2 codebase for probably five years. It's been all Amara 3 for me, which I know doesn't help because that isn't compatible with Akara (I've also left off Akara in favor of combining custom aiohttp server code with Amara 3).

Looking at those gcc errors I wonder whether updating the embedded expat to 2.2.8 would do the trick (i.e. putting that in lib/src/expat/lib/). That would also have the advantage of patching the recent security bugs in expat.

tingletech commented 5 years ago

I tried that— but it was missing a util.c

Get Outlook for iOShttps://aka.ms/o0ukef


From: Uche notifications@github.com Sent: Friday, September 20, 2019 5:48:00 PM To: zepheira/amara amara@noreply.github.com Cc: Brian Tingle Brian.Tingle@ucop.edu; Author author@noreply.github.com Subject: Re: [zepheira/amara] python 3 or pypy support (#23)

Oh goodness! I'm a bit stumped on how to help. I haven't even looked at the Amara 2 codebase for probably five years. It's been all Amara 3 for me, which I know doesn't help because that isn't compatible with Akara (I've also left off Akara in favor of combining custom aiohttp server code with Amara 3).

Looking at those gcc errors I wonder whether updating the embedded expat to 2.2.8 would do the trick (i.e. putting that in lib/src/expat/lib/). That would also have the advantage of patching the recent security bugs in expat.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/zepheira/amara/issues/23?email_source=notifications&email_token=AABXQLVL6QTSHUWMZRJKAVTQKVVMBA5CNFSM4IYFW4M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7IG42I#issuecomment-533753449, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AABXQLXKOASCL5TLHTT7IALQKVVMBANCNFSM4IYFW4MQ.

tingletech commented 5 years ago

FWIW, it looks like the expat there has been modified as part of the domlette work