local source plugin can introduce non-determinism
Summary
It came to light while discussing potential new features for the new remote plugin in !581 (merged), that we might be relying on the user's umask
to determine what permissions local
sources will have when staged.
Steps to reproduce
What is the current bug behavior?
The result of staging local sources can depend on how the BuildStream project was stored or obtained (was it in a tarball ? was it cloned in a git repository ?), or local host configuration (what is the user's umask
?).
What is the expected correct behavior?
The result of staging local sources should always be deterministic
Relevant logs and/or screenshots
Possible fixes
Not sure what the solution for this will be, perhaps we need:
- A sane default:
- Fully deterministic mode bits set at stage time, accounting only for whether the
local
file is executable or not - This approach makes a reasonable assumption that whatever way you obtained your project, the local files inside the project directory at least retained the information of whether the file was executable or not.
- This would by default, e.g. use always
0755
for executable files, and0644
for non-executable files
- Fully deterministic mode bits set at stage time, accounting only for whether the
- Some way to control the permission bits for individual files, only for the case where the user asks for that
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.4