Skip to content

osx: don't fail to install on osx < 10.12

Ruslan Kuprieiev requested to merge efiop/pyreflink:master into master

Header sys/clonefile.h has been available since OS X 10.12, so if one tries to pip install reflink on older version of OS X he gets this error:

clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/travis/.pyenv/versions/3.4.3/Python.framework/Versions/3.4/include/python3.4m -c build/temp.macosx-10.11-x86_64-3.4/reflink._backend.c -o build/temp.macosx-10.11-x86_64-3.4/build/temp.macosx-10.11-x86_64-3.4/reflink._backend.o build/temp.macosx-10.11-x86_64-3.4/reflink._backend.c:492:10: fatal error: 'sys/clonefile.h' file not found #include <sys/clonefile.h> /* for clonefile(2) */ ^ 1 error generated. error: command 'clang' failed with exit status 1

To fix that, let's check which version of OS X are we compiling against and if it is too old then just leave a stub instead.

Signed-off-by: Ruslan Kuprieiev ruslan@iterative.ai

Merge request reports