Skip to content

BuildStream refuses to cache artifacts with files that have very strict permissions

Summary

When trying to build an element that produces an artifact which contains a file without write permissions, BuildStream will fail to cache the artifact.

This is particularly annoying when trying to depend on a base platform with, say, a /etc/shadow file.

Steps to reproduce

  1. Create a simple BuildStream project.

  2. Create a tarfile containing a file with its permissions set to 400.

  3. Create a .bst file similar to:

    ```yaml
    kind: import
    sources:
    - kind: tar
      base-dir: ''
      url: file:///src/src/permissions.tar.gz
    ```
  4. Attempt to build the element.

What is the current bug behavior?

BuildStream will fail to cache the resulting files in an artifact.

What is the expected correct behavior?

BuildStream caches the resulting artifact.

Relevant logs and/or screenshots

The error message given when BuildStream attempts to cache:

[--:--:--] START   [readonly.bst] : Staging sources
[00:00:00] SUCCESS [readonly.bst] : Staging sources
[--:--:--] START   [readonly.bst] : Caching artifact
[00:00:00] FAILURE [readonly.bst] : Caching artifact
[00:00:00] FAILURE [readonly.bst] : Failed to commit artifact: openat(none): Permission denied
======================================================================

Other relevant information

  • BuildStream version affected: /milestone %"BuildStream_v1.1"
  • BuildStream version affected: /milestone %BuildStream_v1.2
  • BuildStream version affected: /milestone %"BuildStream_v1.3"

Edited by Tristan Maat
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information