install_conan_packages
Install package dependencies from a Conan recipe file, resolving the full dependency graph and fetching binaries from cache or remotes.
Instructions
Install Conan package dependencies from a recipe file (conanfile.py or conanfile.txt).
This tool uses the `conan install` command to install the dependencies of a Conan recipe.
It provides a complete, structured view of all nodes and relationships in the dependency graph.
If any requirement is not found in the local cache, it will iterate the remotes looking for it.
When the full dependency graph is computed and all dependency recipes have been found, it will look
for binary packages matching the current settings and options. If no binary package is found for
some dependencies, it will error unless the 'build_missing' argument is used to build from source.
Examples:
- install_conan_packages(work_dir="/home/user/project", path="conanfile.txt")
- install_conan_packages(work_dir="~/my_project", path="conanfile.py", remote="conancenter")
- install_conan_packages(work_dir="/home/user/project", path="conanfile.py",
settings_host=["os=Windows", "arch=armv8"])
Args:
path: Path to a folder containing a recipe or to a recipe file (conanfile.txt or conanfile.py).
This path is ALWAYS relative to work_dir. For example, if work_dir is "/home/user/project"
and path is "conanfile.py", it will resolve to "/home/user/project/conanfile.py".
work_dir: Working directory where the command should be executed.
This is the base directory from which all paths are resolved.
Always required. If the user mentions they are in a specific directory, use that.
remote: Optional remote name to search in (searches all remotes if not specified)
search_in_cache: Do not use remote, resolve exclusively in the cache.
build_profile: Profile to the build context.
host_profile: Profile to the host context.
settings_host: Substitute settings from the default host profile (architecture, OS, etc.)
Omit to use the settings of the default host profile.
e.g. ["arch=armv8", "os=Windows", "build_type=Release"]
- "arch=armv8": architecture,
- "os=Windows": operating system,
- "build_type=Release": build type,
- "compiler=gcc": compiler,
- "compiler.version=11": compiler version,
- "compiler.runtime=libstdc++11": compiler runtime,
- "compiler.runtime_version=11": compiler runtime version
options_host: Substitute options from the default host profile (fPIC, shared, etc.)
Omit to use the options of the default host profile.
e.g. ["fPIC=True", "shared=False"]
- "Use "&:fPIC=True" to refer to the current package. "
- "Use "*:fPIC=True" or other pattern if the intent was to apply to dependencies"
- "*:fPIC=True": fPIC for all packages,
- "&:shared=False": shared for the current package,
- "*:with_boost=True": with boost option for all packages,
build_missing: Build missing binary dependencies from source
Returns:
JSON string with dependency graph metadata including installation status for each package.
The "binary" and "recipe" fields on each node indicate the package status:
- Missing: Recipe/binary not found, needs to be built
- Invalid: Package invalid due to recipe restrictions
- Build: Package has been built
- Cache: Recipe/binary exists in local cache
- Skip: Package skipped from installation
- Download: Recipe/binary was downloaded
- null: Binary unknown (e.g., consumer conanfile.txt)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the folder containing the recipe of the project or to a recipe file conanfile.txt/.py | |
| work_dir | Yes | Working directory where the command should be executed. This is the base directory from which all paths are resolved. Always required. | |
| remote | No | Remote name. Omit to search in all remotes. | |
| search_in_cache | No | Do not use remote, resolve exclusively in the cache. | |
| build_profile | No | Profile to the build context. | |
| host_profile | No | Profile to the host context. | |
| settings_host | No | Apply different settings like architecture, operating system, build type, compiler, | |
| options_host | No | Apply options like fPIC, header_only, shared, with_*, without_*, etc. to the host context only. | |
| build_missing | No | Build all the missing binary dependencies when they are not available in the cache or in the remotes for download. |