Charmcraft cannot build a non-operator framework charm
Metadata
Current evaluation
Generic hooks-only charm packing was fixed by PR #596, merged as 0dacae0a, allowing builds without an Operator Framework entry point; the fix shipped in edge.
Resolution: closed resolved
Reason: Maintainer cmatsuoka confirmed that PR #596 addressed generic hooks-based charms and made the fix available in edge. The PR was merged in commit 0dacae0a and allowed explicit parts to avoid the implicit charm bundle containing dispatch and the virtualenv.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The current version of charmcraft cannot build a "hooks only" charm. An example of such a charm is [tiny-bash](https://github.com/erik78se/tiny-bash).
If you try to build that charm, you get the following output:
```
❯ git clone https://github.com/erik78se/tiny-bash.git
Cloning into 'tiny-bash'...
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 52 (delta 1), reused 5 (delta 0), pack-reused 35
Receiving objects: 100% (52/52), 22.74 KiB | 2.27 MiB/s, done.
Resolving deltas: 100% (13/13), done.
❯ cd tiny-bash
❯ charmcraft -v pack
2021-05-06 12:18:15,939 charmcraft DEBUG Starting charmcraft version 0.10.0+58.ge8d67aa
2021-05-06 12:18:15,939 charmcraft.main DEBUG Raw pre-parsed sysargs: args={'help': False, 'verbose': True, 'quiet': False, 'project_dir': None} filtered=['pack']
2021-05-06 12:18:15,939 charmcraft.commands DEBUG Couldn't find config file /home/jon/temp/tiny-bash/charmcraft.yaml
2021-05-06 12:18:15,939 charmcraft.main DEBUG General parsed sysargs: command='pack' args=[]
2021-05-06 12:18:15,940 charmcraft.main DEBUG Command parsed sysargs: Namespace(entrypoint=None, requirement=None)
2021-05-06 12:18:15,940 charmcraft ERROR Charm entry point was not found: '/home/jon/temp/tiny-bash/src/charm.py' (full execution logs in /home/jon/snap/charmcraft/common/charmcraft-log-tdb6s3cj)
```
There isn't an obvious `entrypoint` to specify here, and even if we did, we'd need to not include the `dispatch` and virtualenv in the built charm, which would require some changes to the `build`/`pack` command.
Related to #329
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Generic hooks-only charm packing was fixed by PR #596, merged as 0dacae0a, allowing builds without an Operator Framework entry point; the fix shipped in edge. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/charmcraft#596, merged as 0dacae0a. Charmcraft could build generic hooks-only charms without a framework entry point, excluding dispatch and virtualenv; the fix shipped in edge. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in PR #596. Charmcraft now builds hooks-only charms without requiring a framework entry point. The update excludes dispatch and virtualenv from the package and is available in the edge channel. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed and merged in PR #596. Charmcraft now supports building hooks-only charms without requiring a framework entrypoint. The fix is available in the edge channel. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in PR #596. Charmcraft now builds hooks-only charms without requiring an operator entry point. The fix is in the edge channel and updates build/pack commands to exclude dispatch and virtualenv for non-operator charms. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved in PR #596. Charmcraft now supports building hooks-only charms without requiring an operator framework entry point. The fix is available in the edge channel. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#596
(confidence 99%)
Merged PR implementing the hooks-only charm build fix, in commit 0dacae0a.
-
Related To:
canonical/charmcraft#329
(confidence 95%)
The issue body explicitly identifies #329 as related support for uploading hooks-only charms.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #335 Ability to build a hooks only charm | charmcraft | closed | Closed unmerged; the --bare CLI was superseded by plugin-based building in #458 (9dc20872). Generic hooks-only charm support was later delivered by #596 (0dacae0a). | |
| #2055 `no hooks nor dispatch file` after packing | charmcraft | closed | Fixed by merged PR #2073 (commit a93a2d91): Charmcraft now rejects platform-based charm projects without parts instead of producing an invalid metadata-only charm. |