-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
simplify building zenoh-cpp in vscode #201
Comments
Currently zenoh-cpp works the same way as majority of other C++ cmake projects: i.e. it is user responsibility to install all the dependencies.
|
That's being said, I totally agree that scripts ergonomics could be improved and likely a private readme should be added. |
Because I'm using it and many people around using it, this is enough reason I believe :-)
This is different situation, we don't add boost / protobuf as submodules. If we add them as submodules, then yes, I'll be in favor to include them in the same way.
Yes, this is specific mode intended for
When it's activated, the very visible message on cmake configuration stage appears, it's not silent. It can be easily turned on/off by explicitlly setting corresponding cmake cache variable.
It all can and should be covered by ci tests for both build variants. Including original cmake file ( |
There will be equally clear error if zenoh-c/pico are not installed.
Given the shortcoming of this approach, I believe this only justifies you having a customized build environment with whatever scripts/vscode settings you need to make dev process more convenient.
Most of the time quick updates involve also modifying zenoh-c/pico, meaning that they will likely be installed locally for testing - in this context fetching predefined versions from git will have little value.
How often do people read cmake messages when everything sort of works ?
In this case it will need to be documented as well as the consequences of getting a broken install when using it, likely in bold if this is to be on by default, and if this is not on by default - you would still need to do the same amount of work (i.e. specify these cmake variable instead of CMAKE_INSTALL_PREFIX) |
A devcontainer with preinstalled dependencies might be better. Would you be interested in that instead? This is easier to recommend to users. |
While dockers with pre-installed dependencies may seem easier, however, they actually make projects brittle and error prone when users become to dependent on them. It's better for users to learn about dependency management and install prerequisites themselves. |
As an educator, I fully agree with that statement. But containers is a great tool for learning dependencies. A well written Containerfile is an executable specification how to setup the project. Local setups, on the other hand, have more hidden states that can bite users more in the long run. Is this sentiment prevalent among Zenoh developers? Let's discuss more. |
This issue was created more as a discussion, on how to simplify (or whether it is needed at all) building of Zenoh-cpp for developers and not for users. I believe for users the optimal solution would be to provide support for getting zenoh-cpp with all the necessary dependencies from one of the package managers like Conan, vcpkg, apt or brew. |
For the version zenoh-c v0.10.1, I needed to install a specific Rust toolchain ( A full containerization strategy often requires two container images (
For your information, I needed such a separation for our containerized Zenoh experiments here. So I am interested in some container technology for Zenoh. |
In the world of traditional watchmaking, any functionality that does not contribute to displaying time is called a 'complication'. An inspired bit of naming in my opinion. Docker, VSCode, Protobuf are all complications in the context of Zenoh, unrelated to what Zenoh is actually supposed to be for. Leave it to the user to deal with these. They are the ones who need to know how to set up their IDEs, Docker containers, 3rd party dependencies, etc in ways that work for their projects. |
Describe the release item
When zenoh-cpp project is opened in vscode with cmake extension installed, lots of cryptic errors appears. This happens because cmake extension tries to run configuration step on CMakeLists.txt and fails because zenoh-c and zenoh-pico libraries are not installed as packages.
Currently to start development zenoh-cpp with zenoh-c/zenoh-pico as packages the following steps should be performed:
scripts/build_from_git.sh ~/some_dir
. It's not clear without thorough reading of the readme: why this script?, what destination directory to choose?CMAKE_INSTALL_PREFIX
to the~/some_dir
Only after these steps the build with cmake extension in vscode works.
The proposal is to restore direct include of
zenoh-c
andzenoh-pico
when project is opened in vscode (this can be detected by checking TERM_PROGRAM=="vscode" and CMAKE_CURRENT_BINARY_DIR == "${CMAKE_CURRENT_SOURCE_DIR}/build")In this case the project can be built immediately after opening in vscode, without extra steps.
This requires also support from zenoh-c and zenoh-pico side for "add_subdirectory" command. This was done before but need to be updated now. This is useful to support different ways to use our library in customers cmake project. E.g. the
FetchContent
cmake command works throughadd_subdirectory
and it would be nice to support it.The text was updated successfully, but these errors were encountered: