sshock / AFFLIBv3

AFF is an open and extensible file format to store disk images and associated metadata.
Other
77 stars 20 forks source link

Error in pyaff with Python 3 #35

Closed fxcoudert closed 5 years ago

fxcoudert commented 5 years ago

Trying to compile pyaff with Python 3, I am getting the following error:

Making install in pyaff
cd . && python3 setup.py \
        build --build-base /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/pyaff/build \
        build_ext --include-dirs /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/include --library-dirs /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/lib/.libs
running build
running build_ext
building 'pyaff' extension
creating /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/pyaff/build
creating /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/pyaff/build/temp.macosx-10.14-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c pyaff.c -o /private/tmp/afflib-20181011-25275-4oebev/AFFLIBv3-3.7.17/pyaff/build/temp.macosx-10.14-x86_64-3.7/pyaff.o
pyaff.c:2797:65: error: too many arguments to function call, expected 3, have 4
    return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:105:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
               ^~~~~~~~~~

Configuration was the following: ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/afflib/3.7.17_1 --enable-s3 --enable-python PYTHON=python3 --disable-fuse

sshock commented 5 years ago

Does it work if you just remove the , NULL argument there on line 2797 of pyaff.c ?

(I just tried it on my Linux box with Python 3.5.3 and it compiles with or without that).

fxcoudert commented 5 years ago

I see now /* Generated by Cython 0.25.1 */, apparently older Cython versions are incompatible with Python 3.7.

sshock commented 5 years ago

ok, let me see if re-generating it with a newer Cython helps

sshock commented 5 years ago

ok, I updated it in f6fffee; did that help?

fxcoudert commented 5 years ago

@sshock does not remove the error… but then the latest cython version is 0.28.5, it appears

sshock commented 5 years ago

@fxcoudert you can try regenerating it if you like and submit a PR

fxcoudert commented 5 years ago

I am not a user of the software, merely a maintainer for the Homebrew distribution, which ships it. We are migrating our formulas to Python 3. If there is no Python 3(.7) support, we'll probably simply use --disable-python.

sshock commented 5 years ago

ok, I regenerated it using Cython 0.29 in 3d017596d5e8f0683a0cc2d8caac8ee611d0c2d6; does it work for you now?

david-geiger commented 5 years ago

Hi,

I confirm that commit https://github.com/sshock/AFFLIBv3/commit/3d017596d5e8f0683a0cc2d8caac8ee611d0c2d6 fixes build issue with new Python 3.7 and cython 0.29 on mageia Cauldron!

Regards, David

sshock commented 5 years ago

good to know, thanks!