|
2 | 2 |
|
3 | 3 | > **_NOTE:_** For this to work you need CLion 2025.2.2 or greater. |
4 | 4 |
|
5 | | -If you can't or want't to build the development environment on your machine, but still using a modern IDE "natively", you can use dev-containers. With them you can have your IDE frontend working against CLion backend running on a docker container. In order to set it up, execute |
| 5 | +If you can't build, or want to build the development environment on your machine, you can use dev-containers. With them, you can have your IDE frontend working against a CLion backend running on a docker container. To set it up, run the following command: |
6 | 6 |
|
7 | 7 | ```sh |
8 | 8 | docker compose build centos-native-dependency |
9 | 9 | ``` |
10 | | -Once the image is built, open the `presto-native-execution` module on CLion. Then, right click on `.devcontainer\devcontainer.json` and in the contextual menu select `Dev Containers->Create Dev Container and mount sources...->CLion`. Wait for the container to be up and running. |
| 10 | +Once the image is built, open the `presto-native-execution` module on CLion. |
| 11 | + |
| 12 | +Right-click on `.devcontainer\devcontainer.json`, and in the contextual menu select `Dev Containers->Create Dev Container and mount sources...->CLion`. Wait for the container to be up and running before you continue. |
11 | 13 |
|
12 | 14 | The source code is mounted from your machine so any change made into it from the dev-container will also be on your machine. |
13 | 15 |
|
14 | 16 | ## Debug or execute `presto_server` |
15 | 17 |
|
16 | | -Reload CMake project and configure the `presto_server` executable as defined [here](https://github.com/mblanco-denodo/presto/tree/master/presto-native-execution). Compile the project as you need. Then, execute the script ./devcontainer/install-shared-libs.sh inside the container. This will create a directory /runtime-libraries and copy all the shared libraries needed for your compilation runtime in there. Edit the `presto_server` configuration to add the environment variable `LD_LIBRARY_PATH=/runtime-libraries`. This way, you'll have the same environment as distributed prestissimo images. |
| 18 | +Reload CMake project and configure the `presto_server` executable. See [Setup Presto with IntelliJ IDEA and Prestissimo with CLion](https://github.com/prestodb/presto/tree/master/presto-native-execution#setup-presto-with-intellij-idea-and-prestissimo-with-clion). Compile the project as needed. |
| 19 | + |
| 20 | +Then, execute the script `./devcontainer/install-shared-libs.sh` inside the container. This will create a directory `/runtime-libraries` and copy all the shared libraries needed for your compilation runtime in there. |
| 21 | + |
| 22 | +Edit the `presto_server` configuration to add the environment variable `LD_LIBRARY_PATH=/runtime-libraries`. This way, you'll have the same environment as distributed prestissimo images. |
17 | 23 |
|
18 | 24 | ## Known errors |
19 | | - - In some cases an error such as `Computing backend... error. Collection contains no element matching the predicate` can appear. The feature is still in beta. In this case, the container will be created and running, but might have been an issue starting the CLion backend inside the container. To resolve this issue, close CLion, reopen it and in the `Welcome to CLion` window go to `Remote Development (beta)->Dev Containers`. You should see that the container `Presto C++ Dev Container` is up and running, so connect to it. In this case, the backend should start properly and the project should be opened. |
| 25 | + - In some cases an error such as `Computing backend... error. Collection contains no element matching the predicate` can appear. The feature is still in beta. In this case, the container will be created and running, but there might have been an issue starting the CLion backend inside the container. |
| 26 | + |
| 27 | +To resolve this issue, close CLion and reopen it. |
| 28 | + |
| 29 | +In the `Welcome to CLion` window go to `Remote Development (beta)->Dev Containers`. You should see that the container `Presto C++ Dev Container` is up and running, so connect to it. In this case, the backend should start properly and the project should be opened. |
20 | 30 |
|
21 | | - - In some cases you might to manually add the mounted repo to the trusted directories for the dev-container |
| 31 | + - In you can't use git inside the container, you need to manually add the mounted repo to the trusted directories for the dev-container |
22 | 32 | ```sh |
23 | 33 | git config --global --add safe.directory /workspace/presto |
24 | 34 | ``` |
0 commit comments