craft-parts doesn't track primed files when using `override-prime`
Metadata
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.