← Back to issue list

It looks like PR#1126 may have broken reactive builds; metadata.yaml is overwritten?

View original Github issue

Metadata

Project
charmcraft
Number
#1150
Type
issue
State
closed
Author
ajkavanagh
Labels
—
Created
Updated
Closed

Current evaluation

Reactive builds stopped generating metadata.yaml, config.yaml, and actions.yaml. Fixed by merged PR #1151 at commit 35adadf4 and confirmed in 2.3.0.post17+git35adadf.

Resolution: closed resolved

Reason: PR #1151, commit 35adadf4, disables Charmcraft-generated metafiles for reactive builds so the reactive builder's output is preserved. The reporter confirmed the corrected metadata.yaml, config.yaml, and actions.yaml with version 2.3.0.post17+git35adadf.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description It looks like PR#1126 may have broken charm-build (the reactive builders) `metadata.yaml` creation, as it seems to immediately overwrite it. This is with --channel=latest/edge (2.3.0.post16+gited81be8). At least I think that is what may be going on. I was testing latest/edge for the ability to build on lunar (23.04). The offending line appears to be at https://github.com/canonical/charmcraft/blob/ed81be89193deede1c4266c4c369ed7ce7d6b0be/charmcraft/commands/build.py#L181 The issue is that the built charms' metadata should look like this: ```yaml "name": "mysql-innodb-cluster" "summary": "MySQL InnoDB Cluster" "maintainer": "OpenStack Charmers <openstack-charmers@lists.ubuntu.com>" "description": | MySQL InnoDB Cluster Charm deploys and manages the lifecycle of a MySQL InnoDB Cluster. "tags": - "openstack" - "databases" "series": - "focal" - "jammy" - "lunar" "requires": "certificates": "interface": "tls-certificates" "provides": "shared-db": "interface": "mysql-shared" "db-router": "interface": "mysql-router" "db-monitor": "interface": "mysql-monitor" "scope": "container" "prometheus": "interface": "http" "peers": "coordinator": "interface": "coordinator" "cluster": "interface": "mysql-innodb-cluster" "resources": "mysql-shell": "type": "file" "filename": "mysql-shell.snap" "description": | Snap for mysql-shell "mysqld-exporter": "type": "file" "filename": "mysqld-exporter.snap" "description": | snap for mysqld prometheus exporter "subordinate": !!bool "false" ``` but actually looks like this: ```yaml name: mysql-innodb-cluster summary: MySQL InnoDB Cluster maintainer: OpenStack Charmers <openstack-charmers@lists.ubuntu.com> description: | MySQL InnoDB Cluster Charm deploys and manages the lifecycle of a MySQL InnoDB Cluster. tags: - databases subordinate: false series: - focal - jammy - lunar provides: shared-db: interface: mysql-shared db-router: interface: mysql-router db-monitor: interface: mysql-monitor scope: container prometheus: interface: http ... ``` ### To Reproduce ```bash # fetch any reactive charm source, with a charmcraft.yaml charmcraft pack unzip -p <charm> metadata.yaml ``` ### Environment * Ubuntu 22.04 * charmcraft latest/edge ### charmcraft.yaml ```shell type: charm parts: charm: plugin: reactive reactive-charm-build-arguments: - --binary-wheels-from-source - --verbose build-packages: - tox - git - python3-dev - libffi-dev - libmysqlclient-dev - pkg-config source: src/ build-snaps: - charm/latest/edge build-environment: - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/ - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/ bases: - build-on: - name: ubuntu channel: "20.04" architectures: [amd64] run-on: - name: ubuntu channel: "20.04" architectures: [amd64] - build-on: - name: ubuntu channel: "20.04" architectures: [s390x] run-on: - name: ubuntu channel: "20.04" architectures: [s390x] - build-on: - name: ubuntu channel: "20.04" architectures: [ppc64el] run-on: - name: ubuntu channel: "20.04" architectures: [ppc64el] - build-on: - name: ubuntu channel: "20.04" architectures: [arm64] run-on: - name: ubuntu channel: "20.04" architectures: [arm64] - build-on: - name: ubuntu channel: "22.04" architectures: [amd64] run-on: - name: ubuntu channel: "22.04" architectures: [amd64] - build-on: - name: ubuntu channel: "22.04" architectures: [s390x] run-on: - name: ubuntu channel: "22.04" architectures: [s390x] - build-on: - name: ubuntu channel: "22.04" architectures: [ppc64el] run-on: - name: ubuntu channel: "22.04" architectures: [ppc64el] - build-on: - name: ubuntu channel: "22.04" architectures: [arm64] run-on: - name: ubuntu channel: "22.04" architectures: [arm64] - build-on: - name: ubuntu channel: "23.04" architectures: [amd64] run-on: - name: ubuntu channel: "23.04" architectures: [amd64] - build-on: - name: ubuntu channel: "23.04" architectures: [s390x] run-on: - name: ubuntu channel: "23.04" architectures: [s390x] - build-on: - name: ubuntu channel: "23.04" architectures: [ppc64el] run-on: - name: ubuntu channel: "23.04" architectures: [ppc64el] - build-on: - name: ubuntu channel: "23.04" architectures: [arm64] run-on: - name: ubuntu channel: "23.04" architectures: [arm64] ``` ### Relevant log output ```shell Log file too long, sadly. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Reactive builds stopped generating metadata.yaml, config.yaml, and actions.yaml. Fixed by merged PR #1151 at commit 35adadf4 and confirmed in 2.3.0.post17+git35adadf.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1151 (35adadf4), preserving reactive-generated metadata; the reporter confirmed correct metadata, config, and actions in 2.3.0.post17+git35adadf.
qwen3.6-35b-a3b-mtp-q6 — — PR#1126 broke reactive builds by overwriting metadata.yaml. The issue was fixed by @syu-w and confirmed working in version 2.3.0.post17+git35adadf, restoring correct metadata, config, and actions generation.
qwen/qwen3.6-35b-a3b — — Fixed by @syu-w. PR#1126 incorrectly overwrote metadata.yaml in reactive builds. The author confirmed the fix in version 2.3.0.post17+git35adadf, restoring correct metadata, config, and actions generation for lunar bases.
qwen/qwen3.6-35b-a3b — — Fixed a regression from PR#1126 that incorrectly overwrote metadata.yaml during reactive charm builds. The patch restored correct metadata, config, and actions generation, verified working in version 2.3.0.post17+git35adadf.
qwen3.6-35b-a3b-mtp-q6 — — PR#1126 broke reactive builds by overwriting metadata.yaml. @syu-w implemented a fix, which @ajkavanagh confirmed resolved metadata generation and restored lunar base support in a subsequent build.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#1151 (confidence 100%)

    Merged fix that skips metafile generation for reactive builds.

  • Caused By: canonical/charmcraft#1126 (confidence 95%)

    Introduced generated metafiles that overwrote reactive builder output.

Related issues

No related issues found above the similarity threshold.