canonical / canonical/craft-application

Projects with no parts are always repacked

Open
#844 2 comments 0 reactions 1 assignee Claimed by @cmatsuoka View on GitHub
Status: Triaged Type: Bug
Dominant language
Python
Stars
14
Forks
29
Avg merge
2d 3h
Merged PRs (30d)
12

Description

### Bug Description

In an application with `always_repack=False`, at least one part is needed to ensure `prime_state_timestamp` is not `None`: https://github.com/canonical/craft-application/blob/109efee05914b24832763335c1d7064af4ed21f5/craft_application/commands/lifecycle.py#L470-L475

### To Reproduce

```bash
cat <<'EOF' >testcraft.yaml
name: temp
version: "0.1"
base: ubuntu@24.04
platforms:
amd64:
EOF

testcraft pack
testcraft pack

cat <<'EOF' >testcraft.yaml
name: temp
version: "0.1"
base: ubuntu@24.04
platforms:
amd64:
parts:
foo:
plugin: nil
EOF

testcraft pack
testcraft pack
```

Expected behaviour: the second and fourth `testcraft pack` calls should print `Already packed: temp-0.1-amd64.testcraft`.

Actual behaviour: only the fourth one does.

### part yaml

```shell
{}
```

### Relevant log output

```shell
:: 2025-08-06 12:49:51.687 Could not find prime state timestamps.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.