symmetryinvestments / autowrap

Wrap existing D code for use in Python, Excel, C#
BSD 3-Clause "New" or "Revised" License
80 stars 16 forks source link

Cannot build with ldc and python39 #306

Closed yilabs closed 1 year ago

yilabs commented 2 years ago
$ ../ldc2/bin/dub build

mirror 0.3.1: building configuration "library"...
autowrap:reflection 0.6.4+commit.28.gde4f98d: building configuration "library"...
autowrap:pynih 0.6.4+commit.28.gde4f98d: building configuration "default"...
pynih/source/python/raw.d(147,34): Error: Function type does not match previously declared function with the same mangled name: `stat64`
pynih/source/python/raw.d(147,34):        Previous IR type: i32 (i8*, %python.raw.stat64*)
pynih/source/python/raw.d(147,34):        New IR type:      i32 (i8*, %python.raw.stat*)

So I change raw.d:147 to

    pragma(mangle, "stat") int stat_(const(char)*, stat*) @nogc nothrow;

The build continues, and reported error in tests:

tests/ut/pynih/python/conv.d(24,2): Error: template instance `Types!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, float, double)` template `Types` is not defined
tests/ut/pynih/python/conv.d(35,2): Error: template instance `Types!(int[], double[])` template `Types` is not defined
tests/ut/pynih/python/conv.d(56,2): Error: undefined identifier `Values`, did you mean template `values(T : Value[Key], Value, Key)(T aa)`?
tests/ut/pynih/python/conv.d(65,2): Error: undefined identifier `Values`, did you mean template `values(T : Value[Key], Value, Key)(T aa)`?

(update never mind the link error is fixed by: Since they are tests, I commented out them, and the link failed:

$ export PYD_LIBPYTHON=python3.9

but I think this var should be really be set by the build upon read configuration in python/dub.sdl