Conan: deployment of binaries

Created on 4 Apr 2018  路  8Comments  路  Source: conan-io/conan

Hi,
I have compiled some packages with conan, this will imply some libraries, and a program with some data files.
I know want to deploy these files on the target system .
What is the right way ?
Regards
S.Ancelot

inactive question

All 8 comments

Depends on the target systems, your application/s, etc. There is no "right way" for all use cases.

You can see some overview here: http://docs.conan.io/en/latest/devtools/running_packages.html?highlight=imports

  • One possible way would be to retrieve from conan all the executables, shared libraries and data files, from conan packages to your user folder. This can be done with the imports() feature. It exists both for conanfile.txt (http://docs.conan.io/en/latest/reference/conanfile_txt.html?highlight=imports#imports) and for conanfile.py. Also the deploy() feature from conanfile.py will extend further the functionality of imports: http://docs.conan.io/en/latest/reference/conanfile/methods.html#deploy. Once you have all the deployable artifacts in your user folder you can zip them, create a .deb package with them, maybe just push them directly via scp to some servers...
  • Both the deploy() and imports() feature can use absolute paths (and conditional logic depending on the system, to directly put the final artifacts in system folder and run from there.
  • There is the concept of "repackaging", where you can create a new conan package that gathers all the deployable artifacts, typically remove settings like compiler and build_type, and can be used to deploy artifacts via conan too. This could help: http://docs.conan.io/en/latest/devtools/running_packages.html#runtime-packages-and-re-packaging

Please check if those resources help. Regards!

In Conan v1.15 we added the deploy generator (https://docs.conan.io/en/latest/reference/generators/deploy.html), it is useful to retrieve the contents of all the packages involved in a project to a local directory:

conan install <project-reference> -g deploy [--install-folder=<local-folder>]

After it, a custom script can be run to gather the required files and build the tarbarll/installer/bundle/.... or whatever action is needed to create the final artifact.

@jgsogo Is it possible to consider a generator to deploy only the package, without dependencies?
It'd be nice to have that to pipe it to export-pkg.
Related to #5282

Hi, I think it is too much ad-hoc for a generator, and maybe it is more related to the conan download command adding and extra --to-folder argument (which could be aligned with some ideas about package layouts, local caches,...), don't you think so?

Sounds good to me! My use case was mostly with the missing feature of piping ins and outs of the Conan environment. 馃檪

Sorry, @Minimonium, I think I don't understand what you mean with your last comment. Are we aware of that missing feature? Is there any issue for it?

Thanks.

@jgsogo It's a story about https://github.com/conan-io/conan/issues/5282
I need a CI-local way to bottleneck artifacts on a number of agents and centralize the upload job.

  • I can't simply merge two local caches because of the metadata.
  • I can't use the Dev Flow since it's severely broken for non-testing use-cases.
  • I need to use export-pkg to merge package folders in a supported manner.
  • I don't have a way to pull package folders out of local cache in a granular way to prepare them for transporting between agents.
    All of these mean that there is a missing piece of functionality for piping packages out and into the Conan environment. :slightly_smiling_face:

We can close this question, as the general use case of "deployment of binaries" is already covered by the deploy generator... if you feel like there is a need for a _deploy without dependencies_ I think it is better to open a new one and focus on that topic, otherwise, the metadata issue would be ok with the one you've already linked.

Thanks.

Was this page helpful?
0 / 5 - 0 ratings