craft_platforms.charm
¶
Charm-specific module for craft-platforms.
- craft_platforms.charm.get_platforms_charm_build_plan(base, platforms, build_base=None)[source]¶
Generate the build plan for a platforms-based charm.
Platforms-based charms are charms that don’t use the deprecated
bases
field in theircharmcraft.yaml
.Multi-base recipes are supported. A multi-base recipe defines the base within the
platform
field instead of definingbase
andbuild-base
. For each platform, the base is either prefixed to the platform name or prefixed to everybuild-on
andbuild-for` entry. In both cases, the prefixed base is delimited with a colon (``<base>:
).- Parameters:
base (
Optional
[str
]) – The run-time environment for the charm, formatted asdistribution@series
. If thebuild-base
is unset, then thebase
determines the build environment.build_base (
Optional
[str
], default:None
) – The build environment to using when building the charm, formatted asdistribution@series
.platforms (
Optional
[Dict
[Union
[DebianArchitecture
,str
],Optional
[PlatformDict
]]]) – The mapping of platform names toPlatformDicts
. If thebase
andbuild-base
are unset, then the base must be defined in the platforms.
- Raises:
ValueError – If the build plan can’t be created due to invalid base and platform definitions.
- Returns:
Sequence
[BuildInfo
] – A build plan describing the environments where the charm can build and where the charm can run.