On Fri, 12 Jan 2024 at 12:21, Böszörményi Zoltán <zbos...@gmail.com> wrote:
>
> 2024. 01. 02. 23:57 keltezéssel, Dmitry Baryshkov írta:
> > On Tue, 2 Jan 2024 at 17:30, Richard Purdie
> > <richard.pur...@linuxfoundation.org> wrote:
> >> On Tue, 2024-01-02 at 17:25 +0200, Dmitry Baryshkov wrote:
> >>> On Tue, 2 Jan 2024 at 13:40, Richard Purdie
> >>> <richard.pur...@linuxfoundation.org> wrote:
> >>>> On Tue, 2024-01-02 at 12:32 +0200, Dmitry Baryshkov wrote:
> >>>>> On Sat, 30 Dec 2023 at 23:02, Richard Purdie
> >>>>> <richard.pur...@linuxfoundation.org> wrote:
> >>>>>> On Sat, 2023-12-30 at 21:14 +0200, Dmitry Baryshkov wrote:
> >>>>>>> From: Zoltán Böszörményi <zbos...@gmail.com>
> >>>>>>>
> >>>>>>> Mesa now has two OpenCL implementations: Clover (older one) and 
> >>>>>>> RustiCL
> >>>>>>> (newer one). Extend the "opencl" package config to include both
> >>>>>>> implementations into the libopencl-mesa (-dev) packages. As the Clover
> >>>>>>> implementation is in maintenance mode and is expected to be removed at
> >>>>>>> some point, it doesn't make sense to split the packages or to provide
> >>>>>>> two config options.
> >>>>>>>
> >>>>>>> Signed-off-by: Zoltán Böszörményi <zbos...@gmail.com>
> >>>>>>> [DB: reworked rust class inheritance]
> >>>>>>> [DB: merged "rusticl" and "clover" back to "opencl"]
> >>>>>>> Signed-off-by: Dmitry Baryshkov <dmitry.barysh...@linaro.org>
> >>>>>>> ---
> >>>>>>>   meta/recipes-graphics/mesa/mesa.inc | 21 ++++++++++++++++-----
> >>>>>>>   1 file changed, 16 insertions(+), 5 deletions(-)
> >>>>>>>
> >>>>>>> diff --git a/meta/recipes-graphics/mesa/mesa.inc 
> >>>>>>> b/meta/recipes-graphics/mesa/mesa.inc
> >>>>>>> index efbce5caade5..a192562a7935 100644
> >>>>>>> --- a/meta/recipes-graphics/mesa/mesa.inc
> >>>>>>> +++ b/meta/recipes-graphics/mesa/mesa.inc
> >>>>>>> @@ -48,6 +48,12 @@ PROVIDES = " \
> >>>>>>>
> >>>>>>>   inherit meson pkgconfig python3native gettext features_check
> >>>>>>>
> >>>>>>> +# We can not include rust conditionally, otherwise it can not be 
> >>>>>>> overriden by
> >>>>>>> +# the bbappends.  Instead always include it, but remove the 
> >>>>>>> dependencies by
> >>>>>>> +# default.
> >>>>>>> +inherit rust
> >>>>>>> +INHIBIT_DEFAULT_RUST_DEPS = "${@bb.utils.contains('PACKAGECONFIG', 
> >>>>>>> 'opencl', '', '1', d)}"
> >>>>>>> +
> >>>>>> I'd really prefer not to have the rust inherit unconditionally. I have
> >>>>>> some ideas about how we could fix this in bitbake so we may need to
> >>>>>> wait for that if we can't avoid the PACKAGECONFIG issue from appends...
> >>>>> Well, it's not just appends. Extending PACKAGECONFIG from local.conf
> >>>>> also doesn't work. In fact even adding "opencl" to the default
> >>>>> PACKAGECONFIG doesn't work unless I move `inherit
> >>>>> @{bb.utils.contains....` after the PACKAGECONFIG definition. Using
> >>>>> `INHIBIT_DEFAULT_RUST_DEPS` works around that issue, but yes, it has a
> >>>>> drawback of including rust unconditionally.
> >>>> PACKAGECONFIG:append:pn-mesa = " opencl"
> >>> Yes, I tried that. I got an error about rust tools not being defined.
> >>> I think the :append: and overrides are handled after the inherit
> >>> argument is handled. So it is either PACKAGECONFIG being fully defined
> >>> before inherit (literally before), or inherit ends up with an empty
> >>> argument.
> >> The append and overrides would be expanded at the time the expression
> >> in the inherit statement is evaluated so if that didn't work there is
> >> something else at play...
> > I did not attempt debugging the bitbake itself. However I can see that
> > with this line in local.conf, PACKAGECONFIG is updated, but the RUSTC
> > is not defined (which means that rust.bbclass was not inherited). Then
> > I tried adding opencl to the default PACKAGECONFIG in mesa.inc. If
> > inherit comes before PACKAGECONFIG being set, it is not honoured. If
> > inherit comes after PACKAGECONFIG, it works as expected (and RUSTC
> > gets defined).
>
> Something like this should work:
>
> inherit ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'rust', '', d)}
>
> E.g. the libxml2 recipe does it, although for a different bbclass.

This way enabling opencl in .bbappend is not honoured.

-- 
With best wishes
Dmitry
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193600): 
https://lists.openembedded.org/g/openembedded-core/message/193600
Mute This Topic: https://lists.openembedded.org/mt/103436170/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to