← Back to issue list

Unnecessary priming of dependency when priming a part

View original Github issue

Metadata

Project
craft-parts
Number
#1290
Type
issue
State
open
Author
upils
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

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.

Suggested action: close stale

Reason: Maintainer @lengau asked on 2025-09-11 for a use case justifying why dependency priming should be skipped, and the reporter never responded. Over 10 months have passed with no further activity. The behavior may be intentional (dependency output needed downstream), and without the requested justification the issue cannot be validated as a bug.

Impact: 30 Quick Win: 16.5 Staleness: 72 Complexity: 45 Confidence: 78 Support Request: 10

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
qwen/qwen3.8-27b
Impact: 30
Quick Win: 16.5
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 60
Support Request: 10
close stale Priming a part unnecessarily primes its after dependencies. Suggests modifying dependency_prerequisite_step to skip priming for steps up to OVERLAY. Triaged, under discussion regarding expected behavior, inactive for 280 days.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.