← Back to issue list

Reactive charm built with charmcraft 3.x is missing options from the included layers and is broken

View original Github issue

Metadata

Project
charmcraft
Number
#1816
Type
issue
State
open
Author
lgp171188
Labels
Created
Updated
Closed

Current evaluation

Reactive charms built with charmcraft 3.x lose config.yaml options from included layers; 2.x works. Maintainer acknowledged and plans a rewrite of the reactive build logic; reporter confirmed still broken on 3.4.3 and is willing to wait.

Suggested action: keep open

Reason: Maintainer @lengau explicitly acknowledged on 2025-05-22 and plans to 'fully redo this logic' to support new features, and the reporter confirmed the bug persists on 3.4.3 with concrete build links. The issue is triaged, valid, and actively being addressed via a planned rewrite, so it should remain open.

Impact: 60 Quick Win: 18.0 Staleness: 25 Complexity: 70 Confidence: 80 Support Request: 10

Issue body

### Bug Description We, the Launchpad team, have a bunch of reactive charms that are built using Launchpad charm recipes. Since we did not pin the `charmcraft` channel to be used for the builds, they are now built with `charmcraft` 3.x. But the resulting charm files are missing many/all options from the layers included in the charm and are broken. Building the charm with `charmcraft` 2.x does produce a proper charm that has all the options present. ### To Reproduce https://api.charmhub.io/api/v1/charms/download/wf1A4OyHbIxzKmTWna89ZaDrH618Ft6p_517.charm is the `launchpad-appserver` charm built using `charmcraft` 3.x and that is broken. https://api.charmhub.io/api/v1/charms/download/wf1A4OyHbIxzKmTWna89ZaDrH618Ft6p_518.charm is the version that has the exact same charm code but built using `charmcraft` 2.x and it is not broken. ### Environment These charms are built on the Launchpad builders using charm recipes. But the issue is also reproducible with local charm builds on Ubuntu 24.04 with `charmcraft` 3.x, whereas `2.x` works okay. ### charmcraft.yaml ```shell # https://git.launchpad.net/launchpad/tree/charm/launchpad-appserver/charmcraft.yaml type: charm bases: - build-on: - name: ubuntu channel: "20.04" architectures: [amd64] run-on: - name: ubuntu channel: "20.04" architectures: [amd64] parts: charm-wheels: source: https://git.launchpad.net/~ubuntuone-hackers/ols-charm-deps/+git/wheels source-commit: "42c89d9c66dbe137139b047fd54aed49b66d1a5e" source-submodules: [] source-type: git plugin: dump organize: "*": charm-wheels/ prime: - "-charm-wheels" ols-layers: source: https://git.launchpad.net/ols-charm-deps source-commit: "9c59a9804f1f40e2a74be7dac9bf18a655a7864f" source-submodules: [] source-type: git plugin: dump organize: "*": layers/ stage: - layers prime: - "-layers" launchpad-layers: after: - ols-layers source: https://git.launchpad.net/launchpad-layers source-commit: "910dfb76754add5ed032a243c6081ee6a6b11256" source-submodules: [] source-type: git plugin: dump organize: apache-vhost-config: layers/interface/apache-vhost-config launchpad-base: layers/layer/launchpad-base launchpad-db: layers/layer/launchpad-db launchpad-payload: layers/layer/launchpad-payload stage: - layers prime: - "-layers" layer-coordinator: source: https://git.launchpad.net/layer-coordinator source-commit: "fa27fc93e0b08000963e83a6bfe49812d890dfcf" source-submodules: [] source-type: git plugin: dump organize: "*": layers/layer/coordinator/ stage: - layers prime: - "-layers" charm: after: - charm-wheels - launchpad-layers - layer-coordinator source: . plugin: reactive build-snaps: [charm] build-packages: [libpq-dev, python3-dev] build-environment: - CHARM_LAYERS_DIR: $CRAFT_STAGE/layers/layer - CHARM_INTERFACES_DIR: $CRAFT_STAGE/layers/interface - PIP_NO_INDEX: "true" - PIP_FIND_LINKS: $CRAFT_STAGE/charm-wheels reactive-charm-build-arguments: [--binary-wheels-from-source] ``` ### Relevant log output ```shell https://launchpadlibrarian.net/743876575/buildlog_charm_ubuntu_focal_amd64_launchpad-appserver_BUILDING.txt.gz has the build logs for the charmcraft 3.x build. https://launchpadlibrarian.net/743923593/buildlog_charm_ubuntu_focal_amd64_launchpad-appserver_BUILDING.txt.gz has the build logs for the charmcraft 2.x build. If needed, I can collect logs from a local build and share them too. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 60
Quick Win: 18.0
Staleness: 25
Complexity: 70
Confidence: 80
Support Request: 10
keep open Reactive charms built with charmcraft 3.x lose config.yaml options from included layers; 2.x works. Maintainer acknowledged and plans a rewrite of the reactive build logic; reporter confirmed still broken on 3.4.3 and is willing to wait.
qwen/qwen3.6-35b-a3b
Staleness: 50
Complexity: 55
Confidence: 90
Support Request: 5
keep open Reactive charms built with charmcraft 3.x lose layer options due to config.yaml overwriting. Maintainer acknowledged the bug, plans to rework the logic, and is awaiting urgency confirmation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 60
Confidence: 90
Support Request: 5
keep open Reactive charms built with charmcraft 3.x lose config options from layers. Maintainer identified the cause and plans a logic rewrite; reporter is okay with waiting.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 75
Confidence: 90
Support Request: 10
keep open Reactive charms built with charmcraft 3.x lose config.yaml options from included layers. Maintainer acknowledged the regression, requested time to re-examine and potentially rewrite the logic, and is awaiting reporter feedback on urgency.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 75
Confidence: 90
Support Request: 5
keep open charmcraft 3.x overwrites config.yaml in reactive charms, stripping layer options and breaking builds. Maintainer is re-examining the bug after author confirmed it persists in 3.4.3. Author accepts staying on 2.x temporarily but requests a fix.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#1829 (confidence 70%)

    Commit 4a3cbacb 'fix(reactive): don't overwrite actions.yaml for reactive charms (#1829)' addresses the same class of metafile-overwrite bug in the reactive plugin; the reporter referenced this PR when asking about the fix.

  • Likely Fixed By: canonical/charmcraft#2245 (confidence 40%)

    Commit aa28f0dc 'fix(reactive): don't overwrite config.yaml from a reactive charm (#2245)' targets the same config.yaml overwrite, but the reporter states the bug still reproduces on 3.4.3, so the fix is incomplete or regressed.

Related issues

Issue Project State Summary Similarity
#2194 Builds of charm using reactive plugin produces different config option charmcraft closed Closed without resolution. Maintainers acknowledged the charmcraft 3 reactive plugin incorrectly strips deprecated config options, but no fix was implemented.
79%
#1360 Charmcraft 2.4.0 is stricter about reactive part names charmcraft closed Resolved by renaming the top-level reactive part to charm in charmcraft.yaml. Version 2.4.0 enforces this name for proper layer merging. The reporter applied the configuration fix and closed the report as a documented requirement.
75%
#872 charm artifacts from reactive plugin are missing valuable build metadata charmcraft open Reactive charms built via charmcraft's reactive plugin lack the .build.manifest file that charm-tools generates, and manifest.yaml omits charm-tools version. Triaged (Status: Triaged, Type: Bug); internal ticket CHARMCRAFT-654 created 2025-09-17; no code change yet.
73%
#809 Reactive plugin doesn't allow for other `charm` cli arguments. charmcraft closed Closed without resolution. The reactive plugin could not pass custom charm CLI arguments like --layer-index. Despite user requests for reproducible builds and binary wheel support, the feature was abandoned due to inactivity.
72%