← Back to issue list

craft-parts doesn't track primed files when using `override-prime`

View original Github issue

Metadata

Project
craft-parts
Number
#1122
Type
issue
State
open
Author
mr-cal
Labels
Created
2025-06-10 16:46:50+00:00
Updated
2025-06-10 16:55:49+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description When using `override-prime`, craft-parts doesn't track what files are primed. This is because craft-parts returns an empty fileset when using an `override-` script: https://github.com/canonical/craft-parts/blob/53f7d3602e6b083bb6a96e2eae1205861cff7e6d/craft_parts/executor/part_handler.py#L535 This causes downstream issues: - https://github.com/canonical/snapcraft/issues/4547 - https://github.com/canonical/snapcraft/issues/5552 ### To Reproduce ```python import pathlib import logging import yaml import craft_parts from craft_parts import LifecycleManager, Step # logging.basicConfig(level=logging.DEBUG) parts_yaml = { "no override-prime": { "parts": { "hello": { "plugin": "nil", "override-build": "touch $CRAFT_PART_INSTALL/hello.txt\ncraftctl default", }, }, }, "override-prime": { "parts": { "hello": { "plugin": "nil", "override-build": "touch $CRAFT_PART_INSTALL/hello.txt\ncraftctl default", "override-prime": "craftctl default", }, }, }, } for name, parts in parts_yaml.items(): lcm = LifecycleManager( parts, application_name="example", cache_dir=".", ) lcm.clean() actions = lcm.plan(Step.PRIME) with lcm.action_executor() as aex: aex.execute(actions) prime_state = pathlib.Path("parts/hello/state/prime") prime_data = yaml.safe_load(prime_state.read_text()) print(f"Primed files tracked with {name}: {prime_data.get('files')}") ``` ### Relevant log output ```shell Primed files tracked with no override-prime: {'hello.txt'} Primed files tracked with override-prime: set() ```

Evaluation history

No evaluation history available.