-
Notifications
You must be signed in to change notification settings - Fork 365
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
recipe id using sub project's latest commit id #3135
Comments
Hi @xiaoliangwu Thanks for your question. You can see some application of the |
But , how to set the recipe_id when I get the commit_id I means, is there a method like:
|
There is not such class Pkg(ConanFile):
revision_mode = "scm" That will take the git commit as the recipe revision, instead of the |
revision_mode="scm" will always get the latest commit_id from git repo root. for example , I have 2 sub project A and B. I hope A's recipe revision is the latest commit id in A sub folder and B's recipe revision is the latest commit id in B sub folder. current I cannot differentiate them. let me explain the motivation: I have a monorepo project , like
each have it's own conanfile.py for A, B and app . and app depend on A and B. when user push a commit , it could update A or B or app. my idea is we always run "conan create app --build=missing": in app's conanfile.py:
so if user update a files in B , the B commit_id will be updated (thus B recipe revision get updated accordingly , but A recipe revision not get changed ) and get rebuild. in this way, we streamline the dependencies and auto rebuild the modules when any module's source updated. |
Thanks for the explanation @xiaoliangwu It is correct, the I think the main issue is that you are trying to have both opposite approaches at the same time, the "monorepo" and the "package management". These approaches are very opposite:
Conan has some features, like the So the question could be: what is the underlying pain that you are trying to solve with Conan? If you want to go with the "package management" approach you should gradually (one at a time) split the mono repo in separate repos, and enable the decoupled development. If you are using a mono-repo approach, then you might not need a package manager in the first place? |
I am investigating in conan-io/conan#13562 some possible changes that could allow the |
The pain point is: in developer's sandbox , Make can save the compile time if the .o or .a exist by checking the timestamp. but in CICD which using a clean workspace, everything need to be compiled and it takes a long time, so I think Conan can help to skip modules by checking the source revision and speed up the build TAT in CI pipeline. thanks for the PR for scm_subfolder approach , that could be helpful . for a more pragmatic approach, maybe we can add something like "recipe_revision()" to let user decide the revision. however, this is just my 2cents |
I love that you are trying Conan for this, but maybe if the only pain is build time, have you considered using a build cache (ccache, scache)? If you still want to stick with Conan for this for other reasons, I think that the
This would not be necessary, the recipes already have the |
I like the "exports_sources" approach, perfect! BTW, what is conafile_project.py? is it a special recipe file superior to conanfile.py? |
No, sorry for the confusion A |
conan-io/conan#13562 implemented Closing this issue, please create a new one if you have any further question. Thanks for the feedback! |
Hi
if we have multi subproject under same git repo, how to use the latest commit id under each subproject to be the revision_id of each subproject? ( assuming we use revision_mode="scm" )
thanks
The text was updated successfully, but these errors were encountered: