Unnecessary priming of dependency when priming a part
Metadata
Current evaluation
Triaged bug report reproduces dependency foo being primed when bar is primed; current code still maps Step.PRIME to Step.PRIME, while a maintainer questions whether dependencies must be primed.
Suggested action: keep open
Reason: The exact YAML, dry-run command, and log provide a solid reproducer, and the current function still returns Step.PRIME for Step.PRIME with a matching unit-test expectation. The issue is labeled Triaged and Bug, but the only maintainer comment questions the intended behavior without resolution, so design confirmation is still needed before changing dependency semantics.
Evaluated by: mr-cal-bot
Impact:
38
Quick Win:
19
Complexity:
34
Confidence:
91
Actionability:
76
Issue body
### Bug Description
If a part depends on another, using `after`, and this part is primed, the dependency will be primed too.
`dependency_prerequisite_step` (see https://github.com/canonical/craft-parts/blob/main/craft_parts/steps.py#L85) should probably be fixed to be:
```python
def dependency_prerequisite_step(step: Step) -> Step | None:
"""Obtain the step a given step may depend on.
:returns: The prerequisite step.
"""
# With V2 plugins we don't need to repull if dependency is restaged
if step <= Step.OVERLAY:
return None
return Step.STAGE
```
### To Reproduce
`python3 -mcraft_parts -v --dry-run prime bar`
### part yaml
```shell
parts:
bar:
after: [foo]
plugin: nil
foo:
plugin: nil
```
### Relevant log output
```shell
Pull bar
Pull foo (required to overlay 'bar')
Overlay foo (required to overlay 'bar')
Overlay bar
Build foo (required to build 'bar')
Stage foo (required to build 'bar')
Build bar
Stage bar
Prime foo (required to prime 'bar')
Prime bar
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
38
Quick Win:
19
Complexity:
34
Confidence:
91
Actionability:
76
|
keep open | Triaged bug report reproduces dependency foo being primed when bar is primed; current code still maps Step.PRIME to Step.PRIME, while a maintainer questions whether dependencies must be primed. | |
| stealth/space-bunny-alpha |
Impact:
35
Quick Win:
19
Complexity:
26
Confidence:
84
Actionability:
73
|
keep open | Triaged bug: priming bar also primes its after-dependency foo; an exact reproducer and prerequisite-step change are proposed, but intended dependency semantics remain disputed. | |
| qwen/qwen3.6-35b-a3b |
Impact:
40
Quick Win:
19
Complexity:
20
Confidence:
65
Actionability:
60
|
keep open | Bug report that dependency parts are unnecessarily primed when a dependent part is primed, with a proposed fix to dependency_prerequisite_step in craft-parts/steps.py. | |
| qwen/qwen3.8-27b |
Impact:
30
Quick Win:
16
Staleness:
72
Complexity:
45
Confidence:
78
Support Request:
10
|
close stale | Priming a part also primes its dependencies unnecessarily; proposed fix to dependency_prerequisite_step. Triaged as bug, but maintainer questioned whether behavior is intentional and requested a use case; reporter never responded. Code has evolved with overlay support but core behavior unchanged. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
80
Complexity:
15
Confidence:
70
Support Request:
20
|
close stale | Reports unnecessary dependency priming when priming a part, with a proposed code fix. Triaged as a bug, but discussion stalled after a maintainer questioned the expected behavior and requested a use case over 10 months ago. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
75
Complexity:
20
Confidence:
65
Support Request:
40
|
close stale | Bug report claiming that priming a part unnecessarily primes its dependencies. Suggests a code fix. Triaged but inactive for 300 days; maintainer questioned the expected behavior and requested a use case. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1977 lifecycle: when priming dependencies need to be primed | snapcraft | merged | Merged PR #1977 in commit 90557f016, forcing dependencies to be primed because the DT_NEEDED crawler needs them available. |