← Back to issue list

Charms packed using the reactive plugin shows dirty version

View original Github issue

Metadata

Project
charmcraft
Number
#693
Type
issue
State
closed
Author
hloeung
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 The reactive plugin was updated to stop removing charmcraft.yaml before invoking charm build. This prevents git describe from marking the version as dirty, resolving the issue.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#872 charm artifacts from reactive plugin are missing valuable build metadata charmcraft open Reactive charms built via charmcraft's reactive plugin lack the .build.manifest file that charm-tools generates, and manifest.yaml omits charm-tools version. Triaged (Status: Triaged, Type: Bug); internal ticket CHARMCRAFT-654 created 2025-09-17; no code change yet.
75%
#777 Do not modify the charm's project when packing using the reactive plugin (CRAFT-928). charmcraft merged Merged to resolve issue #693. The change prevents the reactive plugin from modifying the charm's project during packing. Approved by one reviewer with zero unresolved comments. Two files modified, netting a 21-line reduction.
75%
#2273 charmcraft.yaml deleted while packing (working tree not clean) charmcraft open charmcraft pack deletes charmcraft.yaml from the working tree, making git describe --dirty report -dirty on clean release builds. Reported with charmcraft 3.4.3, no maintainer response or labels in ~13 months.
73%
#1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file charmcraft open charmcraft pack ignores updated build-snaps channel in charmcraft.yaml without a clean; tracked as a craft-parts bug (canonical/craft-parts#496, still open) awaiting a dependency patch release to pull into charmcraft.
70%
#710 `charmcraft pack` retains no longer existing files from previous packs charmcraft open charmcraft pack includes files deleted from the working directory in the charm archive; clean fixes it. Triaged as a known bug, re-confirmed present in Oct 2024, upstream craft-parts bug filed, per-part clean workaround documented.
70%