Reactive charm built with charmcraft 3.x is missing options from the included layers and is broken
Metadata
Current evaluation
Reactive layer options were lost because Charmcraft 3.x overwrote charm-tools' config.yaml; commit aa28f0dc and PR #2245 now preserve the generated configuration.
Suggested action: close resolved
Reason: The maintainer identified config.yaml being overwritten, and commit aa28f0dc (PR #2245), titled "fix(reactive): don't overwrite config.yaml from a reactive charm", addresses that exact cause. The current package service detects a staged config.yaml for reactive builds and skips Charmcraft's own generation instead of replacing it.
Evaluated by: mr-cal-bot
Impact:
55
Quick Win:
31
Complexity:
38
Confidence:
98
Actionability:
90
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
55
Quick Win:
31
Complexity:
38
Confidence:
98
Actionability:
90
|
close resolved | Reactive layer options were lost because Charmcraft 3.x overwrote charm-tools' config.yaml; commit aa28f0dc and PR #2245 now preserve the generated configuration. | |
| qwen/qwen3.6-35b-a3b |
Impact:
70
Quick Win:
17
Complexity:
60
Confidence:
60
Actionability:
60
|
keep open | Reactive charm built with charmcraft 3.x missing config.yaml options from included layers; maintainer plans to redo the logic | |
| qwen/qwen3.8-27b |
Impact:
60
Quick Win:
18
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. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
charmcraft#2245
(confidence 99%)
Commit aa28f0dc implements the config.yaml preservation fix described by the maintainer.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #809 Reactive plugin doesn't allow for other `charm` cli arguments. | charmcraft | closed | Resolved by merged PR #863 (merge commit a5f200b1): reactive builds can now pass charm build options such as --layer-index via reactive-charm-build-arguments. | |
| #872 charm artifacts from reactive plugin are missing valuable build metadata | charmcraft | open | Reactive charm artifacts omit .build.manifest and charmtool-version; an exact fix is proposed in open PR charmcraft#2502 and remains under review. | |
| #2194 Builds of charm using reactive plugin produces different config option | charmcraft | closed | Fixed by merged PR #2245 (commit aa28f0dc): reactive-generated config.yaml is no longer overwritten, preserving options such as snapd_refresh. |