diff mbox series

[3/3] ref-manual: variables: Add example for SYSROOT_DIRS variable

Message ID 20231019214827.405886-3-bhstalel@gmail.com
State New
Headers show
Series [1/3] ref-manual: variabls: Add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE variables | expand

Commit Message

Talel BELHADJ SALEM Oct. 19, 2023, 9:48 p.m. UTC
Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
---
 documentation/ref-manual/variables.rst | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Michael Opdenacker Oct. 20, 2023, 9:28 a.m. UTC | #1
On 19.10.23 at 23:48, BELHADJ SALEM Talel wrote:
> Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> ---
>   documentation/ref-manual/variables.rst | 29 ++++++++++++++++++++++++++
>   1 file changed, 29 insertions(+)
>
> diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
> index 958b98fd6..8f1abf43a 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -8474,6 +8474,35 @@ system and gives an overview of their function and contents.
>                /sysroot-only \
>                "
>   
> +      Consider the following example in which you need to manipulate this variable.
> +      Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is
> +      installed into a custom folder other than "``${libdir}``"
> +      or "``${base_libdir}``", let's say "``/opt/lib``".
> +
> +      .. note::
> +
> +         This is not a recommended way to deal with shared libraries, but this
> +         is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
> +
> +      When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
> +      :term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``B``
> +      into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``".
> +
> +      Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to
> +      ``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So,
> +      the linking process will still fail.


s/still fail/fail/
I meant to use "still fail" in the second part.

> +
> +      To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`::
> +
> +         SYSROOT_DIRS:append = " /opt/lib"
> +
> +      .. note::
> +         Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will fail


s/will fail/will still fail/


> +         because the linker does not know that location since :term:`TARGET_LDFLAGS` (if your recipe
> +         is for the target) doesn't contain it. Therefore, so you should add::


I'd actually tweak this sentence a bit to make it easier to read:

because the linker does not know that location, since :term:`TARGET_LDFLAGS`
doesn't contain it (if your recipe is for the target). Therefore, so you should add::

We are very close too!
Thanks!
Michael.
Talel BELHADJ SALEM Oct. 20, 2023, 9:44 a.m. UTC | #2
Hello Michael,

For the moment, when fixing a patch, I send the patch again without adding
"Reviewed-by", is it necessary?
And also, is it necessary to send all patches again even if one of them is
good?

Thanks again for the support.
Talel

On Fri, Oct 20, 2023 at 10:28 AM Michael Opdenacker <
michael.opdenacker@bootlin.com> wrote:

>
> On 19.10.23 at 23:48, BELHADJ SALEM Talel wrote:
> > Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> > ---
> >   documentation/ref-manual/variables.rst | 29 ++++++++++++++++++++++++++
> >   1 file changed, 29 insertions(+)
> >
> > diff --git a/documentation/ref-manual/variables.rst
> b/documentation/ref-manual/variables.rst
> > index 958b98fd6..8f1abf43a 100644
> > --- a/documentation/ref-manual/variables.rst
> > +++ b/documentation/ref-manual/variables.rst
> > @@ -8474,6 +8474,35 @@ system and gives an overview of their function
> and contents.
> >                /sysroot-only \
> >                "
> >
> > +      Consider the following example in which you need to manipulate
> this variable.
> > +      Assume you have a recipe ``A`` that provides a shared library
> ``.so.*`` that is
> > +      installed into a custom folder other than "``${libdir}``"
> > +      or "``${base_libdir}``", let's say "``/opt/lib``".
> > +
> > +      .. note::
> > +
> > +         This is not a recommended way to deal with shared libraries,
> but this
> > +         is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
> > +
> > +      When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
> > +      :term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe
> ``B``
> > +      into ``B``'s :term:`SYSROOT_DESTDIR` that is
> "``${WORKDIR}/sysroot-destdir``".
> > +
> > +      Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will
> never be copied to
> > +      ``A``'s :term:`RECIPE_SYSROOT`, which is
> "``${WORKDIR}/recipe-sysroot``". So,
> > +      the linking process will still fail.
>
>
> s/still fail/fail/
> I meant to use "still fail" in the second part.
>
> > +
> > +      To fix this, you need to add ``/opt/lib`` to
> :term:`SYSROOT_DIRS`::
> > +
> > +         SYSROOT_DIRS:append = " /opt/lib"
> > +
> > +      .. note::
> > +         Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the
> linking process will fail
>
>
> s/will fail/will still fail/
>
>
> > +         because the linker does not know that location since
> :term:`TARGET_LDFLAGS` (if your recipe
> > +         is for the target) doesn't contain it. Therefore, so you
> should add::
>
>
> I'd actually tweak this sentence a bit to make it easier to read:
>
> because the linker does not know that location, since
> :term:`TARGET_LDFLAGS`
> doesn't contain it (if your recipe is for the target). Therefore, so you
> should add::
>
> We are very close too!
> Thanks!
> Michael.
>
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>
Michael Opdenacker Oct. 20, 2023, 10:01 a.m. UTC | #3
On 20.10.23 at 11:44, BELHADJ SALEM Talel wrote:
> Hello Michael,
>
> For the moment, when fixing a patch, I send the patch again without 
> adding "Reviewed-by", is it necessary?

Well, speaking in general, if you happen to send a updated patch series, 
you could add the "Reviewed-by" lines that you received, but only for 
the patches that were not modified since they were reviewed.

> And also, is it necessary to send all patches again even if one of 
> them is good?

No sure here, unless the series were sent a while ago. At least it 
doesn't hurt to resend, and it makes it easier to have complete series 
for people reading the mailing list archives to review the patches.

Happy to help you help the project!
Cheers
Michael.
diff mbox series

Patch

diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 958b98fd6..8f1abf43a 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -8474,6 +8474,35 @@  system and gives an overview of their function and contents.
              /sysroot-only \
              "
 
+      Consider the following example in which you need to manipulate this variable.
+      Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is
+      installed into a custom folder other than "``${libdir}``"
+      or "``${base_libdir}``", let's say "``/opt/lib``".
+
+      .. note::
+
+         This is not a recommended way to deal with shared libraries, but this
+         is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
+
+      When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
+      :term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``B``
+      into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``".
+
+      Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to
+      ``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So,
+      the linking process will still fail.
+
+      To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`::
+
+         SYSROOT_DIRS:append = " /opt/lib"
+
+      .. note::
+         Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will fail
+         because the linker does not know that location since :term:`TARGET_LDFLAGS` (if your recipe
+         is for the target) doesn't contain it. Therefore, so you should add::
+
+            TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib"
+
    :term:`SYSROOT_DIRS_IGNORE`
       Directories that are not staged into the sysroot by the
       :ref:`ref-tasks-populate_sysroot` task. You