-
Notifications
You must be signed in to change notification settings - Fork 201
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
When building in docker container, headers are not copied, so indexer can't use them #560
Comments
Thanks @ChristianS99 for the report. @ChristianS99 can you test creating a simple C/C++ project on your machine with latest Eclipse released this week (2023-09) - for clarity, I mean a project created with the wizard like this, then built on your docker image: cc: @jjohnstn any chance you can look once @ChristianS99 reports back, @15knots has already done some analysis in 15knots/cmake4eclipse#187 |
With new eclipse and project without cmake (plain eclipse), the headers are copied and indexer works. After this, in the same workspace, I created a new project with cmake4eclipse, and use the same build image. Then, in the cmake4eclipse project, I changed the build image, where the headers haven't been copied, they are not copied and indexer is broken. So, it seems, that the copying headers step is missing when it is a cmake4eclipse project |
Thanks @ChristianS99 for reporting back. I hope that is sufficient information for @jjohnstn and @15knots to find a solution. I can also help, but not sure where to start on this one. |
linuxtools is the part that copies the headers into the workspace, but only when a build is run. If you just switch the build image, no build is run, no headers get copied. |
In plain CDT, if I switch the build image and click "Apply", I see "Discover compiler builtin settings" followed by "Copying from Docker" in the right part of the status bar. I don't have to build the project. On the other hand, in a project with cmake4eclipse, the copying step isn't run after building. |
It works in plain CDT, because But I think the code in |
Hm, so this won't be fixed, as far as I understand? |
Changing the Anyway, if the container image gets switched anything in the build directory should be considered to be potentially stale. So a clean rebuild is required to make it non-stale. This will also copy the header files. In plain CDT (we call it Managed Build System MBS), the headers get copied back as a side effect of notifying the |
Hello, I have this exact same problem, using cmake4eclipse and docker headers files are not copied. Could you please provide me a workaround? Thank you |
Describe the bug
Using cmake4eclipse project and building inside docker container, Indexer is not working correctly.
I think, the underlying Problem is, that headers aren't copied from inside the container to the workspace, so that the indexer can find them.
CMake compilation DB is select as provider in Preprocesser Include Paths, and it shows pathes like
<workspace>/.metadata/.plugins/org.eclipse.cdt.docker.launcher/HEADERS/unix_var_run_docker_sock/<imagename>/usr/include
Problem is,
<workspace>/.metadata/.plugins/org.eclipse.cdt.docker.launcher/
is empty, no HEADERS dir.To Reproduce
Expected behavior
correct header file opens
Version Information (please complete the following information):
cmake4eclipse version: 4.0.2
Which OS do you use: Linux
Cmake version: 3.27.4
Eclipse Version: 2023-06 (4.28.0)
C/C++ Development Tools: 11.2.0.202306051917
Additional context
when opening the workspace, there is an error message:
See 15knots/cmake4eclipse#187
The text was updated successfully, but these errors were encountered: