blue-yonder / turbodbc

Turbodbc is a Python module to access relational databases via the Open Database Connectivity (ODBC) interface. The module complies with the Python Database API Specification 2.0.
http://turbodbc.readthedocs.io/en/latest
MIT License
616 stars 86 forks source link

Install/build error on MacOS 13.0.1 in Python 3.8.15 with pyarrow-10.0.1 but pyarrow-9.0.0 works #370

Closed jmao-denver closed 1 year ago

jmao-denver commented 1 year ago

Got pages of the same error.

In file included from src/turbodbc_arrow/arrow_result_set.cpp:6:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/api.h:22:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array.h:37:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array/array_base.h:26:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array/data.h:28:
/Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/type.h:1745:36: error: 'get<arrow::FieldPath, arrow::FieldPath, std::string, std::vector<arrow::FieldRef>>' is unavailable: introduced in macOS 10.13
    if (IsFieldPath()) return std::get<FieldPath>(impl_).indices().size() > 1;
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:1544:22: note: 'get<arrow::FieldPath, arrow::FieldPath, std::string, std::vector<arrow::FieldRef>>' has been explicitly marked unavailable here
constexpr const _Tp& get(const variant<_Types...>& __v) {
                     ^
In file included from src/turbodbc_arrow/arrow_result_set.cpp:6:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/api.h:22:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array.h:37:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array/array_base.h:26:
In file included from /Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/array/data.h:28:
/Users/jianfengmao/Playground/venv3.8/lib/python3.8/site-packages/pyarrow/include/arrow/type.h:1750:34: error: 'get<arrow::FieldPath, arrow::FieldPath, std::string, std::vector<arrow::FieldRef>>' is unavailable: introduced in macOS 10.13
    return IsFieldPath() ? &std::get<FieldPath>(impl_) : NULLPTR;
                                 ^
david-engelmann commented 1 year ago

Are you using c++17 and High Sierra or greater?

david-engelmann commented 1 year ago

Similar issues in the feedstock repo

h-vetinari commented 1 year ago

This can be fixed in conda-forge (because we ship our own, current libcxx), but regular users will have to update their MacOS SDK.

h-vetinari commented 1 year ago

Ah wait, I just see this happens on MacOS 13, which is way newer than 10.13. Presumably extra_compile_args.append("-mmacosx-version-min=10.9") needs to be bumped?

jmao-denver commented 1 year ago

To answer @david-engelmann, yes, the compiler flag is actually already set to use c++17 and my clang is version 14.0.0.

david-engelmann commented 1 year ago

Ah wait, I just see this happens on MacOS 13, which is way newer than 10.13. Presumably extra_compile_args.append("-mmacosx-version-min=10.9") needs to be bumped?

This seems to be the issue

david-engelmann commented 1 year ago

@jmao-denver adjusting the compile args in setup.py to -mmacosx-version-min=13.0 should help, I'm not on a mac so I'm not able to confirm

devinrsmith commented 1 year ago

MacOS 13.0 is very new; I think trying to set a more conservative version would be appropriate.

jmao-denver commented 1 year ago

@david-engelmann With -mmacosx-version-min=11.0, I am able to build and test successfully on MacOS 13, and I agree with @devinrsmith on being conservative with minimum version support.

david-engelmann commented 1 year ago

@jmao-denver @devinrsmith 11.0 is perfect, if we wanted to try to build with it set 10.13 that would be the most conservative. Originally, I just said try with 13 to confirm that's the issue. I believe @h-vetinari addressed in conda stock

hkad98 commented 1 year ago

Hi, @no23reason opened a pull request bumping mmacosx-version-min to 11.0, fixing the error above. Could someone have a look at that, please?

cc: @xhochy

jmao-denver commented 1 year ago

@david-engelmann Any idea whether this fix will be included in v4.5.7 and if yes, when v4.5.7 might be coming out?

david-engelmann commented 1 year ago

@jmao-denver It seems like there are two open prs that need to be merged in to fix everything, @xhochy is the best person to ask this. There is a issue with macos sim links with brew installing that had paused my work on adding in multiple os testing