build: create charm builder tool (CRAFT-373)
Metadata
Current evaluation
Superseded by merged charmcraft#453, which moved charm-building logic to a standalone CharmBuilder; the venv and pip optimizations were deferred.
Resolution: closed superseded
Reason: PR #453 replaced this proposal and merged as commit 3e5eed05, with implementation commit 23b6c74f. The maintainer explicitly deferred the added venv and pip changes.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Extract the build routine from the Builder class and create a stand-alone
charm builder tool. Invoke the tool from the Builder class passing all the
appropriate arguments to build charms. This tool will be invoked from the
charm plugin after parts integration.
The payload venv is now created from the user site of a staging venv to
cache the previous installation and avoid reinstalling packages that are
already installed. This is done to avoid spending a long time building
packages when binary wheels are disabled.
Charm building tests moved from `tests/commands/test_build.py` to
`tests/test_charm_builder.py`, replacing the `Builder` class with the
`CharmBuilder` class. Additional tests added to verify handling of
package dependencies and pip binaries arguments, and invocation
of the builder tool.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Superseded by merged charmcraft#453, which moved charm-building logic to a standalone CharmBuilder; the venv and pip optimizations were deferred. | |
| stealth/space-bunny-alpha | — | closed superseded | Replaced by merged charmcraft#453, which extracted charm-building logic into a standalone tool; the proposed venv and pip optimizations were deferred. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed due to requested changes and nine unresolved review comments. Author plans to resubmit a cleaner version later, abandoning this iteration. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Abandoned without merging. The author plans to propose a cleaner version that moves existing code without extras at a later date. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
charmcraft#453
(confidence 100%)
Merged successor PR implementing the standalone charm builder and replacing #452.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #453 build: spin off charm builder as a separate tool (CRAFT-373) | charmcraft | merged | Merged #453 in commit 3e5eed05, extracting charm-building routines into a standalone CharmBuilder invoked by build; venv and pip enhancements were deferred. | |
| #541 charm_builder: build dependencies locally (CRAFT-537) | charmcraft | merged | Merged in charmcraft#541 via 0d14d8a2: charm_builder now builds dependencies locally in a persistent staging venv, avoiding binary dependencies and repeat rebuilds during repacks. | |
| #249 `charmcraft build` will let you build a charm that won't deploy | charmcraft | closed | Closed by facundobatista as a duplicate, tracking all build-time sanity checks (incl. config.yaml/actions.yaml validity) in the umbrella issue charmcraft#27; later implemented by merged PR #556 (a585aec6). | |
| #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. | |
| #148 feat(charm): add a build planner for bases charms | craft-platforms | merged | Merged PR #148 added a Charm build planner for legacy charms using the bases key, addressing CHARMCRAFT-630 in commit 16ff218. | |
| #720 `charmcraft --help` still mentions `build` that is deprecated | charmcraft | closed | Fixed in canonical/charmcraft#739 (commit 1a461c39): removed deprecated build from top-level help and promoted pack as the standard build command. | |
| #238 `charmcraft init` creates broken charm | charmcraft | closed | Superseded by charmcraft#247, a planned overhaul of init templates and generated tests; #247 later closed without implementing its proposed guard against building incomplete templates. | |
| #324 Provide the building charms functionality through the pack command. | charmcraft | merged | Merged into main: charm building is now available through the pack command, in merge commit ebc0d75b. | |
| #865 Isolated charm_builder.py as a generic plugin script (CRAFT-1032). | charmcraft | merged | Merged as commit 56242113, isolating charm_builder.py as a standalone plugin with stdout output and RuntimeError, fixing #750. | |
| #1791 Charmcraft 3 including previously-built charms in new charm builds | charmcraft | closed | Fixed in PR #1793 (commit affc209b): subsequent charmcraft pack runs no longer include previously built .charm artifacts in the new charm. |