-
Notifications
You must be signed in to change notification settings - Fork 993
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
[question] Shared code and workspaces #5939
Comments
Shouldn't library A be sending those files through |
@Lawrencemm: Thank you for your suggestion. As far as I understand it, the export sources mechanism is used to provide the source code for compiling and testing the whole package (=code + regression test code + mock code). There are also mocks that are used only package-internally (i.e., not suitable for re-use). Therefore I want package to export an additional subset of these sources (== only the re-usable mocks). If I would rely on the export sources mechanism, each client would need to sift through all sources and select the mocks. |
Yes, for the consumers, you would need anyway to package these mocks, so the issue would remain the same. Building first A is not a possibility? |
Yes, building A would definitely solve it. I've done so when I used lib A as editable. But in the context this would mean a change 'workspace install'. Currently, 'workspace install' calls 'conan install' for all packages of workspace in order of their dependency graph. If we would require dependencies to be built first, then 'workspace install' would need to call 'conan install && conan build' for all packages of workspace. You might skip conan build for root packages. |
Yes, you are right. I tagged the issue and added to the workspace "project", the workspace feature definitely needs to improve. |
Thank you. Workspaces are a good concept and my colleagues and I definitely need them. |
#15992 is centralizing feedback and effort for Conan 2 workspaces, lets close this one and track progress there. |
I have a library A that also exports some headers/cpp (mainly (google) mocks from some interfaces) files as resources for consumers. These public files are installed into resources directory after building. Consumers have to import these files into their cmake binary directory (otherwise, paths tend to get too long for cmake to handle). This worked fine, until I've tried out workspaces with A and a consumer B:
Questions:
I'm a bit reluctant to split A into two packages A and A_mocks because then number of dependencies increase by factor of two and versions can happen to mismatch (e.g., version A gets upgraded, but not the A_mock version in test-suites dependencies). But the sharing process I've described above also seems quite complex and fragile to me. Do you know any 'conanian' way to solve this more elegantly?
The text was updated successfully, but these errors were encountered: