Clean slate between rebuilds
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
Sometimes, the `rockcraft pack` command will fail with the following error,
```sh
Failed to copy image: Command '['umoci', 'init', '--layout', '/root/images/bare']' returned non-zero exit status 1. (⨯ image layout creation: path already exists: /root/images/bare)
2022-05-19 12:28:58.701 Traceback (most recent call last):
2022-05-19 12:28:58.702 File "/snap/rockcraft/x1/lib/python3.8/site-packages/rockcraft/oci.py", line 239, in _process_run
2022-05-19 12:28:58.705 subprocess.run(
2022-05-19 12:28:58.705 File "/snap/rockcraft/x1/usr/lib/python3.8/subprocess.py", line 516, in run
2022-05-19 12:28:58.705 raise CalledProcessError(retcode, process.args,
2022-05-19 12:28:58.705 subprocess.CalledProcessError: Command '['umoci', 'init', '--layout', '/root/images/bare']' returned non-zero exit status 1.
2022-05-19 12:28:58.707 Full execution log: '/root/.cache/rockcraft/log/rockcraft-20220519-122857.121178.log'
```
a way to reproduce that seem to be,
1. build a part with multiple stage packages
2. remove a package from the list
3. try to rebuild the part
Evaluation history
No evaluation history available.