← Back to issue list

Shared directories are not properly cleaned when partitions are enabled

View original Github issue

Metadata

Project
craft-parts
Number
#665
Type
issue
State
open
Author
mr-cal
Labels
Created
2024-02-17 00:17:14+00:00
Updated
2025-07-15 16:10:48+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done - Redesign the state manager to track the partition where files are located - Redesign the `clean_shared_area()` function to remove the correct files from the list of tracked files from the `StateManager`'s state files The solution could leverage the data structures added by #664. ### Why it needs to get done If the same file exists in multiple partitions in a shared directory (`stage` or `prime`), cleaning doesn't work as expected. It will indiscriminately remove the file from all partitions. See [this test](https://github.com/canonical/craft-parts/pull/666/files#diff-0d1cfe4b47f2489eca5633ebe11745aadfdc8e83893f931870ab2399091b70d6R181-R201) for an example. This is because the `StateManager` does not track files per-partition.

Evaluation history

No evaluation history available.