Editable mode fails with missing headers
When using Conan in editable mode for multiple packages, header dependencies are not resolved correctly.
Scenario:
- Component A depends on B_h (header-only package).
- B_h and B share the same source code; B is the binary package.
- A’s headers directly include headers from B_h.
- B depends on C, D, E.
- A and B have mutual dependency, hence B_h exists to break the cycle.
Problem:
- conan create A works fine when packages are not in editable mode.
- When A, B, B_h, C, D, E are all in editable mode and conan create A is executed, build fails because headers from C, D, E are missing in include paths.
- A does not directly depend on C, D, E
Expected Behavior Editable mode should behave consistently with non-editable mode: Dependencies (C, D, E) should not be needed when building A.
Actual Behavior Build fails with missing headers from C, D, E when all packages are in editable mode.
Why the editable mode demands more requires when they are not needed?
Have you read the CONTRIBUTING guide?
- [x] I've read the CONTRIBUTING guide
Hi @sid-gif
Thanks for the feedback.
I am afraid that I didnt fully understand the issue, for example:
A and B have mutual dependency, hence B_h exists to break the cycle.
Not sure what it means, or how B_h breaks the cycle.
The best would be to provide a set of very simple recipes that model that dependency graph, that way we could reproduce, there might be different possible causes to this, like issues with the layout() method, but those details might not be captured by this description.
Note that with conan new cmake_lib -d name=pkgname -d version=version -d requires=dep/0.1 you can easily create fully functional simple recipes that could help to create this reproducible example.
A is dependent on B and B is dependent on A. To break the circular dependency, I have created another recipe B_headers which only packages the header files from the component B and does not have any binary. So A requires B_headers which only has the headers and no binary. Still when I do conan create on A in editable mode I get error with missing header files from component C and D. This does not happen when the components are in NON-editable mode. Are the dependencies handled differently in editable mode and non-editable mode?
Still when I do conan create on A in editable mode I get error with missing header files from component C and D.
That is the issue, I still don't fully understand the dependency graph, for example, how A is connected to C and D. In the picture above it is not connected at all, so it seems impossible that it would even see the headers from C and D, neither in editable mode or in non-editable mode.
Are the dependencies handled differently in editable mode and non-editable mode?
In theory the dependencies are managed the same when in editable mode, but the layout is different so an incorrect definition of layout could be causing the issues.
Hi @sid-gif
Following up on this ticket, I still didn't fully understand the setup, please let me know if you have clarifications, or even much better, some code to reproduce. Thanks!
Hi @sid-gif
Any update here?