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/06 10:55:31 UTC

[GitHub] [buildstream] nanonyme opened a new issue, #1798: bst2: Bug with variable expansion with included variables with conditionals

nanonyme opened a new issue, #1798:
URL: https://github.com/apache/buildstream/issues/1798

   We noticed after removal of conf-extra that variable resolution is incorrect and has probably been all the time with conf-extra papering over the bug. We have element definition here https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/elements/bootstrap/build/gcc-stage1.bst#L68 that uses conf-extra, however, we are setting it for all target option possibilities in https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/elements/bootstrap/include/gcc-arch-opts.yml.
   
   It looks like with conf-extra in plugin configuration as empty string final values were correct (although resolution was incorrect) but now that conf-extra is removed, bst2 simply fails with this construct.
   


-- 
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.apache.org

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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340538396

   @gtristan your assessment seemed to be not complete. https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/3435905448 remains failing after the suggested change


-- 
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


[GitHub] [buildstream] nanonyme closed issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme closed issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`
URL: https://github.com/apache/buildstream/issues/1798


-- 
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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340530321

   This is even more confusing because it happened on aarch64 which clearly is not building x86_64 cross-compiler.


-- 
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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340555853

   This is IMHO not a BuildStream bug in the end. It is expected behaviour that BuildStream does not error if conditionals do not match. There is no if-elif-else construct available. It turns out there are two bugs here in freedesktop-sdk: one was the x86-64 vs x86_64 and the other is that aarch64 was missing completely. I will fix both.


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340545812

   I will rewrite the description and title back. The original issue is fixed and bug persists.


-- 
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


[GitHub] [buildstream] gtristan commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
gtristan commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340634224

   > This is IMHO not a BuildStream bug in the end. It is expected behaviour that BuildStream does not error if conditionals do not match. There is no if-elif-else construct available. It turns out there are two bugs here in freedesktop-sdk: one was the x86-64 vs x86_64 and the other is that aarch64 was missing completely. I will fix both.
   
   Right, there is nothing we could do about unhandled `aarch64`, however we *do* know that an enum project option (or an arch option) can only have specific values, and we *could* potentially detect a situation where you are checking an expression which could never be true.
   
   IMO this could have saved some time with an early error.
   


-- 
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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340549263

   Oh, this is actually same case. The variable is missing!


-- 
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


[GitHub] [buildstream] nanonyme commented on issue #1798: Error out in situations where conditional statements `(?)` can never evaluate `true`

Posted by GitBox <gi...@apache.org>.
nanonyme commented on issue #1798:
URL: https://github.com/apache/buildstream/issues/1798#issuecomment-1340563436

   The second bug was aarch64 definition was missing completely. After fixing both these bugs there is now clear error that this variable is not defined on unsupported arches.


-- 
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