-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build problem (no docker) C extension: conan delegating pybind11 build to cmake which conflicts with pyenv. #749
Comments
To be more specific: I believe the issue occurs since, for other reasons related to other projects, I installed some python3.6 version via pyenv. The cmake at the bottom of the cmake -> conan -> cmake invocation chain now attempts to use 3.6. As python3.6 is an executable but some empty stub that does nothing unless activated, it likely tries to do something like python3.6 --version and fails. It is a shame that it seems impossible to control the PYTHON_EXECUTABLE or whatever that is at the bottom of the cmake -> conan -> cmake invocation chain to constrain it to use the activated pyenv python executable. I removed all pyenv 3.6 versions, and it builds fine. But it should be able to build with 3.6 versions hanging around if they are not activated, which is not the case. |
To me this behavior looks like PyEnv/pybind11 incompatibility pybind/pybind11#2154. Anyway I agree that it is a bug and should be fixed. @gl-yziquel which CMake version do you use? |
I tried quite a lot of versions. 3.19.8, 3.26.6 and git HEAD. Don't remember which one, but all failed. |
Confirm, I can reproduce it on a clean system (CMake version 3.25.1 which is fresh enough). Steps to reproduce:
Build fails with the following log:
|
This is indeed the precise error messge that occurs when python 3.6 lies around. |
@gl-yziquel I migrated build to the Conan 2 (see #756) because I thought it will help making build more transparent. But it seems it is still not clear how to pass |
Looks like it is fixed after #756. Cannot reproduce it anymore. |
Hi.
I don't quite know how to trace it down much, so I'll say it as it is, and welcome some interaction in order to zoom in better on the problem.
I'm trying to build hyperon metta without docker. (I really do not like docker when used as a build system).
The C extension must be built with the "cmake" followed by "make" commands. This, in turn, seems to delegate to conan. Which tries to build pybind11. For that build of pybind11, conan delegates to cmake. Which, in turn, attempts to detect python.
There is a somewhat well-known cmake / pyenv incompatibility, which I'm told is solved by either passing the
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
setting to the cmake invocation, or altering it directly in the CMakeCache.txt file.However, as much as I'd like to, I cannot alter that easily (or at least I do not know how) as this cmake build is not the top cmake build but a cmake build of pybind11 delegated along a chain like cmake -> conan -> cmake.
This makes it very hard to build Hyperon MeTTa in some custom environment from source. Which is what I need to do. And a blocker in my adoption of MeTTa (as I keep coming back month over month over such build issues, without finding the time to fix it completely among all the multitasking I'm undertaking).
The text was updated successfully, but these errors were encountered: