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 their charmcraft.yaml.

Multi-base recipes are supported. A multi-base recipe defines the base within the platform field instead of defining base and build-base. For each platform, the base is either prefixed to the platform name or prefixed to every build-on and build-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 as distribution@series. If the build-base is unset, then the base determines the build environment.

  • build_base (Optional[str], default: None) – The build environment to using when building the charm, formatted as distribution@series.

  • platforms (Optional[Dict[Union[DebianArchitecture, str], Optional[PlatformDict]]]) – The mapping of platform names to PlatformDicts. If the base and build-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.