deploy() method to copy files to userspace. Add output to show executionconanfile.txt [requires]mkdir dependencies && cd dependenciesconan install ..Log does not show deploy() method log
The deploy() method must be called, and the files should be copied to userspace.
The script exits after packaging, and does not reach deploy()
deploy() is only called in the specific case of conan install foo/1.0. It is not called when a package is part of the transitive [requires], only for a top-level reference
https://docs.conan.io/en/latest/reference/conanfile/methods.html#deploy
The deploy() method is designed to work on a package that is installed directly from its reference, as:
$ conan install pkg/0.1@user/channel
...
pkg/0.1@user/testing deploy(): Copied 1 '.dll' files: mylib.dll
pkg/0.1@user/testing deploy(): Copied 1 '.exe' files: myexe.exeAll other packages and dependencies, even transitive dependencies of “pkg/0.1@user/testing” will not be deployed, it is the responsibility of the installed package to deploy what it needs from its dependencies.
Thanks @puetzk ! Confirmed.
Can anyone please explain what the rationale for this is? Why doesn't conan install follow the same behavior as conan install X?
I was hoping to use the consumer conanfile as a single-source-of-truth for project deps, as well as consolidate fetching/building those deps. Is this possible with the aforementioned flow? Am I misunderstanding the how/why of the conanfile?
Thanks again!
Can anyone please explain what the rationale for this is? Why doesn't conan install follow the same behavior as conan install X?
deploy() and imports() are operations that copy things from the cache to the user folder. When typing conan install <path> there is no package in the cache, it is already local in your folder, so can't be deployed.
We will be changing the cli for Conan 2.0, and probably the commands will be different for <path> and <reference>.
Most helpful comment
deploy()is only called in the specific case ofconan install foo/1.0. It is not called when a package is part of the transitive[requires], only for a top-level referencehttps://docs.conan.io/en/latest/reference/conanfile/methods.html#deploy