-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add CMake's option for bindings #5318
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
Conversation
AWS CodeBuild CI Report
|
sfc-gh-mpilman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencies with bindings (especially python) is sadly quite complex...
Apart from the comments I left, I am also not sure whether the output at the end will be correct (not sure whether it was before either, so I won't insist on this getting fixed in this PR). For example: If the C bindings are not build but go bindings is enabled, the output will tell a user that the go bindings will be built (even though there's a dependency).
So I think the logic has to be:
- Python not found -> don't build any bindings
- C bindings are disabled -> don't build any bindings
- If Python is found and the C bindings are enabled, all other bindings can be disabled/enabled individually (if their dependencies are found).
Also, I would prefer if cmake wouldn't change the option. Instead, cmake should use the option to initialize some other variable, but optimally an option would be only read-only.
CMakeLists.txt
Outdated
| if(WITH_PYTHON) | ||
| add_subdirectory(bindings) | ||
| endif() | ||
| add_subdirectory(bindings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All bindings depend on python. We use a python script to generate some assembly code that is required for the C bindings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tips 👍
cmake/FDBComponents.cmake
Outdated
| else() | ||
| #message(FATAL_ERROR "Could not found a suitable python interpreter") | ||
| option(BUILD_PYTHON_BINDING "build python binding" ON) | ||
| if(NOT BUILD_PYTHON_BINDING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple things in the build system (at least the C bindings and the documentation) depend on python. So I think you need to run find_package(Python COMPONENTS Interpreter) even if you don't want to build the python bindings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tips 👍
bd75251 to
3692d99
Compare
|
I should have taken all your comments into consideration, PTAL 😄 |
AWS CodeBuild CI Report
|
AWS CodeBuild CI Report
|
AWS CodeBuild CI Report
|
AWS CodeBuild CI Report
|
AWS CodeBuild CI Report
|
sfc-gh-mpilman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but breaks the documentation build
cmake/FDBComponents.cmake
Outdated
| option(BUILD_DOCUMENTATION "build documentation" ON) | ||
| if (BUILD_DOCUMENTATION AND WITH_PYTHON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use ${Python3_EXECUTABLE} in documentation/CMakeLists.txt. Removing the call to find_package(Python3) will make this then fail (so the documentation doesn't build anymore.
The easiest solution would be to reintroduce that call, though that is not pretty. Alternatively you could do the following:
- Replace
${Python3_EXECUTABLE} - Only set
WITH_PYTHONtoONifPython_VERSION_MAJORis 3 or:
| option(BUILD_DOCUMENTATION "build documentation" ON) | |
| if (BUILD_DOCUMENTATION AND WITH_PYTHON) | |
| option(BUILD_DOCUMENTATION "build documentation" ON) | |
| if (BUILD_DOCUMENTATION AND WITH_PYTHON AND Python_VERSION_MAJOR EQUAL 3) |
|
Should be better now, thanks! I tried downloading the log archives from the build, but they were empty, do you know why? |
AWS CodeBuild CI Report
|
The build logs are only available for a very short amount of time (the "available for 7 days" message is not accurate). They usually get deleted within hours -- but sometimes even within minutes. But the Linux build succeeded, macOS CI is not ready yet and the result can be ignored. |
Thanks for your help @sfc-gh-mpilman 👍 Do you have any policy/rules regarding cherry-pick for release-7.0 ? |
Typically cherry-picks have to either be strict bug fixes or changes that are required for a business reason (very loosely defined as "we need this change in order to fix an imminent problem with a production system"). Cherry-picks also are not allowed to cause any behavior-change and need to go through more testing and they require two review-approvals. I think this change is ok to back port to 7.0. But the following will be needed:
|
Thanks for all the information. I cherry-picked my commit against
I will dig in both of them. |
|
The official docker image is based on CentOS 7 which comes with a very old version of gcc. You either have to use devtoolset or clang (clang is probably better, as compilation times are much lower). A relatively recent version of clang is installed in the official docker image |
Thanks, GH action is working properly thanks to your Thanks again for all your help @sfc-gh-mpilman ! |
This PR is related to #5218.
The goal of this PR is to add CMake's options to choose which bindings you want to build at compile time.
It introduces one CMake option(defaulting to
ON) per binding:Code-Reviewer Section
The general guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branchormasterif this is the youngest branch)