apache / apache/buildstream

Execution rights on an object can corrupt local cache

Open
#910 10 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/910)
In GitLab by [[Gitlab user @valentindavid]](https://gitlab.com/valentindavid) on Feb 12, 2019, 17:55

## Summary

[//]: # (Summarize the bug encountered concisely)

Because we use linking of files form cache, when an object require execution rights, the execution rights leak into the local cache. This breaks reproducibility of builds, because a file might have no execution right or have it whether another artifact contains the same object with execution rights is on the local cache or not.

## Steps to reproduce

[//]: # (How one can reproduce the issue - this is very important)

- Have element `a.bst` that creates a file `a`.
- Have element `b.bst` that build-depends on `a.bst`.
- Build `b.bst` and see that file `a` has no execution rights.
- Have element `c.bst` that build-depends on `a.bst`. It installs `a` and `chmod +x` it.
- Build `b.bst` again.

## What is the current bug behavior?

[//]: # (What actually happens)

`a` has execution rights on the second build.

## What is the expected correct behavior?

[//]: # (What you should see instead)

`a` does not have execution rights on the second build.
## Relevant logs and/or screenshots

[//]: # (Paste any relevant logs - please use code blocks ``` to format console output, logs, and code as it's hard to read otherwise. You can also add a Snippet and link it here. Check the markdown giude on Gitlab for further tips)

## Possible fixes

[//]: # (If you can, link to the line of code that might be responsible for the problem)

## Other relevant information

[//]: # (Add the BuildStream version. Substitute below the "x" by "1", "2" or the right version. Add more than one version if necessary)

* BuildStream version affected: /milestone %BuildStream_v1.x

----

Contributor guide

Open the contributing guide

Research direction

No files or tests are named in the issue. Start with the described a.bst, b.bst, and c.bst reproduction sequence and inspect how local-cache linking handles execution rights. Done means rebuilding b.bst produces the same non-executable permissions regardless of whether c.bst was built first.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.