Charms packed using the reactive plugin shows dirty version
Metadata
Current evaluation
Fixed in merged PR #777 (CRAFT-928): reactive packing now leaves charmcraft.yaml in place, preventing charm build from adding a -dirty version.
Resolution: closed resolved
Reason: PR #777 stopped the reactive plugin from removing charmcraft.yaml, so charm-tools no longer sees a dirty worktree. The change is recorded in commit f157feb9.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Hi,
My charmcraft.yaml is available at https://git.launchpad.net/smtp-relay-charm/tree/charmcraft.yaml
When charms are built using `charmcraft pack`, the `version` generated adds the `-dirty` tag. This is because the reactive plugin removes charmcraft.yaml before calling `charm-tools`'s `charm build`. This is in https://github.com/canonical/charmcraft/blob/main/charmcraft/reactive_plugin.py#L147
`charm-tools`'s `charm build` uses `git describe --dirty --always` per https://github.com/juju/charm-tools/blob/master/charmtools/build/tactics.py#L1348
[hloeung@dharkan build]$ pwd
/home/hloeung/tmp/smtp-relay/build/parts/charm/build
[hloeung@dharkan build]$ git describe --dirty --always
3e81ffa-dirty
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed in merged PR #777 (CRAFT-928): reactive packing now leaves charmcraft.yaml in place, preventing charm build from adding a -dirty version. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in merged PR #777 (CRAFT-928): reactive packing no longer removes charmcraft.yaml, so charm build no longer marks versions as dirty. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed by modifying the reactive plugin to stop removing charmcraft.yaml before building. This prevented git describe from incorrectly marking packed charm versions as dirty. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved by modifying the reactive plugin to stop removing charmcraft.yaml during the build process, which previously triggered git dirty state detection and appended a dirty version tag. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed by updating the reactive plugin to retain charmcraft.yaml during builds. Keeping the file prevents git describe from incorrectly appending a dirty tag to generated charm versions. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#777
(confidence 100%)
Merged CRAFT-928 change that resolved the reactive plugin's spurious dirty version.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #777 Do not modify the charm's project when packing using the reactive plugin (CRAFT-928). | charmcraft | merged | Merged PR #777 (CRAFT-928) via commit bac1d03b, preventing reactive packing from modifying the charm project and fixing #693's incorrect dirty versions. | |
| #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. | |
| #2273 charmcraft.yaml deleted while packing (working tree not clean) | charmcraft | open | Packing a Charmcraft 3.4.3 reproducer deletes tracked charmcraft.yaml before a dump part, making git describe --dirty tag release builds incompatible; untriaged and apparently unresolved | |
| #613 plugins: reactive using charm tool (CRAFT-699) | charmcraft | merged | Merged PR #613 (merge commit 32c8650a, branch charm-tools-plugin) added the reactive charm plugin built on the charm tool, implementing CRAFT-699; 11 files, +499/-8. | |
| #821 5.5.0 changes pack semantics if the project file has different metadata | craft-application | open | Metadata-only charmcraft.yaml edits were skipped as "Already packed," leaving stale .charm artifacts; Charmcraft PR #2890 is reported to fix repacking after the edit. | |
| #1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file | charmcraft | open | Tracked upstream: charmcraft pack ignores build-snaps channel changes in charmcraft.yaml unless clean is run. Root cause is craft-parts#496 (build-snaps missing from properties_of_interest), still unfixed; charmcraft only needs a craft-parts bump once patched. | |
| #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. |