Script element corrupts cache when using layout and enables integration commands
Summary
Script element allows to overwrite files directly in the cache corrupting it. This happens when running integration commands.
This issue happens on both 1.2 and master.
Steps to reproduce
- element base.bst is the base image
- element a.bst has an integration command that modifies a file that exists in base.bst
- element b.bst is a script element with base.bst and b.bst in dependencies. The element has a layout, and base.bst is mounted at '/'.
Build b.bst. Then checkout base.bst, you will see the file is modified.
What is the current bug behavior?
The file in cache is modified and does not correspond its object hash.
What is the expected correct behavior?
Files in the cache should be immutable.
Relevant logs and/or screenshots
Possible fixes
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.x