Skip to contentSkip to conversation

PROVIDES inconsistency

DISCUSSION Richard Purdie 4 participants 4 messages Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

On irc it was pointed out we have an inconsistency in the documentation of PROVIDES:

https://docs.yoctoproject.org/ref-manual/ref-variables.html#term-PROVIDES

https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PROVIDES

One says don't use +=, the other uses it as an example.

We should probably decide on which and clarify the manual.

In many ways I prefer encouraging users to use "+=" rather than setting plain "=".

Thoughts/patches from anyone?

Cheers,

Richard

#1 lore raw

Hi Richard,

Quoted 6 lines · Richard Purdie

Hi,

On irc it was pointed out we have an inconsistency in the documentation of PROVIDES:

https://docs.yoctoproject.org/ref-manual/ref-variables.html#term-PROVIDES

Quoted 9 lines

https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PROVIDES

One says don't use +=, the other uses it as an example.

We should probably decide on which and clarify the manual.

In many ways I prefer encouraging users to use "+=" rather than setting plain "=".

+= all the way.

Even if your recipe sets PROVIDES = "test123test", bitbake (Yocto?) will add ${PN} to it (otherwise recipes without PROVIDES would just flat out fail to be found by the DEPENDS mechanism).

It's less confusing if you have PROVIDES +=, showing that there's actually already a value set for it.

Cheers,
Quentin

#2 lore raw
Quoted 18 lines · Quentin Schulz

Hi Richard,

Quoted 6 lines · Richard Purdie

Hi,

On irc it was pointed out we have an inconsistency in the documentation of PROVIDES:

https://docs.yoctoproject.org/ref-manual/ref-variables.html#term-PROVIDES

Quoted 9 lines

https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PROVIDES

One says don't use +=, the other uses it as an example.

We should probably decide on which and clarify the manual.

In many ways I prefer encouraging users to use "+=" rather than setting plain "=".

Quoted 8 lines

+= all the way.

Even if your recipe sets PROVIDES = "test123test", bitbake (Yocto?) will add ${PN} to it (otherwise recipes without PROVIDES would just flat out fail to be found by the DEPENDS mechanism).

It's less confusing if you have PROVIDES +=, showing that there's actually already a value set for it.

Agreed. Even though there are some implicit behaviors w.r.t. PROVIDES, it seems that the principal of least surprise would say we should recommend "+=". For example, if I were to use "=", I might be surprised that the recipe was still available under it's old name (due to the implicit behavior). The fact that using "=" being "recommended" requires an explanation seems sufficient evidence that += would better match expectations.

Quoted 6 lines

Cheers,
Quentin

#3 lore raw
In reply to Quentin Schulz
Quoted 19 lines · Quentin Schulz

Hi Richard,

Quoted 6 lines · Richard Purdie

Hi,

On irc it was pointed out we have an inconsistency in the documentation of PROVIDES:

https://docs.yoctoproject.org/ref-manual/ref-variables.html#term-PROVIDES

Quoted 9 lines

https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PROVIDES

One says don't use +=, the other uses it as an example.

We should probably decide on which and clarify the manual.

In many ways I prefer encouraging users to use "+=" rather than setting plain "=".

Quoted 8 lines

+= all the way.

Even if your recipe sets PROVIDES = "test123test", bitbake (Yocto?) will add ${PN} to it (otherwise recipes without PROVIDES would just flat out fail to be found by the DEPENDS mechanism).

It's less confusing if you have PROVIDES +=, showing that there's actually already a value set for it.

i well recall raising this very issue once upon a long time ago. at
this point, i'm fine either way ***as long as*** it's clearly explained that "=" is perfectly adequate because of the automatic addition of ${PN}. if you don't explain that, then the first time someone runs across PROVIDES = "..." and doesn't know that, they'll think it's an error.

rday