From 35adadf42c625c5ee5ed6d611c9bdec10413ae59 Mon Sep 17 00:00:00 2001 From: Sheng Yu Date: Wed, 12 Jul 2023 10:56:09 -0400 Subject: [PATCH] build: do not create metafiles when using reactive (#1151) The reactive framework uses an incompatible variant that creates its own files. The format defined by charmcraft cannot be used. Fix: https://github.com/canonical/charmcraft/issues/1150 --- charmcraft/commands/build.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/charmcraft/commands/build.py b/charmcraft/commands/build.py index 2c3c19790..4a5984d14 100644 --- a/charmcraft/commands/build.py +++ b/charmcraft/commands/build.py @@ -176,9 +176,12 @@ def build_charm(self, bases_config: BasesConfiguration) -> str: with charmcraft.instrum.Timer("Lifecycle run"): lifecycle.run(Step.PRIME) - create_actions_yaml(lifecycle.prime_dir, self.config) - create_config_yaml(lifecycle.prime_dir, self.config) - create_metadata_yaml(lifecycle.prime_dir, self.config) + # skip creation yaml files if using reactive, reactive will create them + # in a incompatible way + if self._parts.get("charm", {}).get("plugin", None) != "reactive": + create_actions_yaml(lifecycle.prime_dir, self.config) + create_config_yaml(lifecycle.prime_dir, self.config) + create_metadata_yaml(lifecycle.prime_dir, self.config) # run linters and show the results linting_results = charmcraft.linters.analyze(self.config, lifecycle.prime_dir)