Skip to content

bst artifact log fails if project options are invalid

Summary

When running bst artifact log <artifact name>, BuildStream will try to resolve the project options of the toplevel project (this most probably can only happen if BuildStream is trying to load the project) - if the defaults are invalid options, then bst artifact log <artifact name> will fail.

Steps to reproduce

First, have a project with the following in the project.conf, perhaps adding this to an existing project can help reproduce:

options:
  build_arch:
    type: arch
    description: Build architecture
    values:
      - arm
      - aarch64

Or, use the freedesktop-sdk project which has these options.

Then, try to read a log file from the artifact cache on an intel machine.

Notice that the project option uses an arch option with only arm arches, and the default is left up to BuildStream to guess with uname.

What is the current bug behavior?

BuildStream exits with an error status and prints the following:

Error loading project: Invalid value for arch option 'build_arch': x86-64
Valid values: arm, aarch64

What is the expected correct behavior?

BuildStream should just show the log file of the artifact.

BuildStream does not need to load the project when given an artifact name, it need only load the project when given an element name.

Relevant logs and/or screenshots

Possible fixes

Didn't look at the implementation yet, perhaps the code currently tries loading an element and falls back to trying the artifact cache ?

Other relevant information

  • BuildStream version affected: /milestone %BuildStream_v1.x

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