build: don't create implicit part if parts section specified (CRAFT-633)
Metadata
Current evaluation
PR #596 merged (merge commit 0dacae0a, bcbdd278) by cmatsuoka: charmcraft now skips the implicit `charm`/`bundle` part when an explicit `parts:` section exists (CRAFT-633), fixing #590; tests added.
Resolution: closed resolved
Reason: The pull request itself was merged into main via merge commit 0dacae0a (commit bcbdd278) with one approving review, implementing the CRAFT-633 behaviour so explicit parts replace the implicit charm/bundle part, which closed the reported issue #590 (dump-plugin build failure).
Evaluated by: mr-cal-bot
No scores available.
Issue body
The `charm` part is implicitly created in a charm project if no parts are specified by the user. If the toplevel `parts:` property is declared, the implicit part is not created. Do the same with the `bundle` part in bundle projects.
Fixes #590
**Note to reviewers**: tests for the following cases have been added to the charm and bundle building tests:
* No `parts` section defined
* `parts` section defined and `charm` or `bundle` part declared with additional files in `prime`.
* `parts` section defined without `charm` or `bundle` part declared. In the charm project case this can be used to create generic hooks-based charms.
* `parts` section defined and `charm` or `bundle` part declared with a non `charm` or `bundle` plugin.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | PR #596 merged (merge commit 0dacae0a, bcbdd278) by cmatsuoka: charmcraft now skips the implicit `charm`/`bundle` part when an explicit `parts:` section exists (CRAFT-633), fixing #590; tests added. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged charmcraft#596 via bcbdd278, fixing #590 by omitting the implicit charm or bundle part when an explicit parts section exists. Added tests for explicit and implicit part configurations. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Resolves #590 by preventing implicit charm or bundle part creation when the parts section is explicitly defined. Adds tests for various parts configurations and passes CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Prevents implicit charm or bundle parts from being created when a parts section is explicitly defined. Resolves #590 and CRAFT-633 by aligning behavior with user configuration. Includes comprehensive tests. |
Update history
No update history recorded yet.
Related work
-
Related To:
charmcraft#590
(confidence 97%)
Issue explicitly cited as 'Fixes #590'; builds with the dump plugin failed because explicit parts were augmented with implicit charm defaults.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1616 Default `charm` or `bundle` part is not added if `parts` is defined but empty in `charmcraft.yaml`. | charmcraft | closed | Fixed by merged PR canonical/charmcraft#1815 (commit 2a0eb973), correcting default charm/bundle part handling in charmcraft.yaml. | |
| #2070 docs: fix build errors in craft-parts | charmcraft | closed | Merged PR #2070, fixing Charmcraft ref and label build errors; remaining craft-parts errors depended on canonical/craft-parts#965. | |
| #458 build: integrate craft-parts lifecycle (CRAFT-89, CRAFT-367, CRAFT-357) | charmcraft | merged | Merged PR #458 via 9dc20872 (implementation 437dab55), adding a craft-parts lifecycle and charm build plugin to run the charm builder. | |
| #590 Unable to build a charm using the dump plugin | charmcraft | closed | Implicit charm part was merged into user-defined 'charm' part, adding invalid charm-entrypoint/charm-requirements keys. Fixed by PR #596 (merge commit 0dacae0a, CRAFT-633) which skips the implicit part when a parts: section exists. | |
| #2186 docs: fix build errors | charmcraft | merged | Merged as charmcraft/charmcraft#2186 in commit 42f42bd2, fixing the targeted docs build error. Remaining transclusion problems were addressed separately in canonical/craft-parts#1021. | |
| #592 requirements: update craft-parts to 1.0.4 | charmcraft | merged | Merged PR #592 updated Charmcraft's craft-parts dependency from 1.0.3 to 1.0.4; commit 361e6bcf was merged via 6f383549. | |
| #538 requirements: update craft-parts to 1.0.1 (CRAFT-430, CRAFT-520) | charmcraft | merged | Merged PR #538 (commit e36c73ae, work commit 9dd87fe8) bumped Charmcraft to craft-parts 1.0.1, dropped the stage-package apt refresh, and cut regression test time from 1:30 to 0:37. Fixes #526, released in Charmcraft 1.3.0 via PR #548. | |
| #1164 fix: don't package projects with no parts | craft-application | merged | Merged PR #1164 (squash commit dc14f0e1, CRAFT-4693) skips package creation when a project defines no parts; approved by 2 reviewers with all CI checks green. | |
| #471 config: add charm part to documentation (CRAFT-356) | charmcraft | merged | Merged PR #471 via commit e0b18661, documenting the charm part in the configuration schema for CRAFT-356. | |
| #3636 parts: integrate craft-parts (CRAFT-765) | snapcraft | merged | Merged as ae8467056, integrating craft-parts for project-part validation and parts lifecycle processing (CRAFT-765). |