You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2022/12/07 06:24:38 UTC

[GitHub] [buildstream] gtristan commented on issue #1798: bst2: Bug with variable expansion with included variables with conditionals

gtristan commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340443131

   Interesting - this is an fdsdk bug, and on the buildstream side, it is unfortunate that there is no obvious way to report a better error.
   
   The issue is that by default on an `x86_64` machine, the arch will resolve to `x86_64` (regardless of how your host reports it, it will be normalized to a machine name supported by REAPI).
   
   Looking at https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/elements/bootstrap/include/gcc-arch-opts.yml, there is no default specified for `conf-extra`, so effectively fdsdk is not defining any `conf-extra` variable for the `x86_64` target_arch.
   
   Interestingly, fdsdk *does* check if the `target_arch` is equal to the string `"x86-64"` and provides some values, but there is no architecture named `x86-64` so that does not happen.
   
   While BuildStream does have good control on how options are *specified* and will give you a good error, say in this case:
   ```
   tristan@pony:~/work/freedesktop-sdk$ bst -o target_arch x86-64 show bootstrap/build/gcc-stage1.bst 
   
   Error loading project: Invalid value for arch option 'target_arch': x86-64
   Valid values: arm, aarch64, i686, x86_64, ppc64le, ppc64, riscv64
   ```
   BuildStream does *not* have similar support to how conditional statements compare project options to impossible values. It would certainly be desirable to have such an error, but this is tricky to do as the conditional statements are just python-like generic statements processed by Jinja2.
   
   I will retitle and rebrand this issue accordingly, while preserving the initial description in order to highlight a use case where this can easily bite users.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org