From: Quentin Schulz <quentin.schulz@cherry.de>
To: antonin.godard@bootlin.com, docs@lists.yoctoproject.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [docs] [PATCH 6/6] ref-manual/variables: improve the UNPACKDIR documentation
Date: Thu, 20 Feb 2025 17:41:09 +0100 [thread overview]
Message-ID: <f4db28cd-1701-49ba-8c90-938128fe61df@cherry.de> (raw)
In-Reply-To: <20250218-overview-figures-v1-6-75d23b5e7a88@bootlin.com>
Hi Antonin,
On 2/18/25 10:12 AM, Antonin Godard via lists.yoctoproject.org wrote:
> It was clear why UNPACKDIR was introduced at first, and what is the
> recommended way of setting S and UNPACKDIR for a clean separation of the
> source code and WORKDIR. Add documentation for this in the reference
> manual.
>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> ---
> documentation/ref-manual/variables.rst | 39 +++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
> index adbef69d8f39d33be87c5db6688a807156540410..d970fc21f69fe35830a9d6b5a28da7cb257c0709 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -10035,9 +10035,46 @@ system and gives an overview of their function and contents.
>
> :term:`UNPACKDIR`
> This variable, used by the :ref:`ref-classes-base` class,
> - specifies where fetches sources should be unpacked by the
> + specifies where fetched sources should be unpacked by the
> :ref:`ref-tasks-unpack` task.
>
> + Although the default value of this directory is
> + ``${WORKDIR}/sources-unpack``, the recommended way of setting
> + :term:`UNPACKDIR` and :term:`S` is::
> +
> + S = "${WORKDIR}/sources"
> + UNPACKDIR = "${S}"
> +
Mmmm I think this is an issue, because we then show a non-recommended
configuration in the SVG in the previous patches where UNPACKDIR != S.
> + This allows the source code to be safely unpacked and patched in a
> + separate directory.
> +
I think I know where you want to go with this, but the first time I read
this I didn't understand it. UNPACKDIR = S in the example above, why
does this say the source code is unpacked and patched (implying two
steps/stages) in a separate directory then?
I think this is because we used to put everything from the fetcher into
WORKDIR and there were unexpected leftovers between builds and UNPACKDIR
now is a separate directory for the fetcher to put everything it does
in, instead of WORKDIR?
I'm not sure we need to document how messed up it was in the past rather
just what this does now?
> + .. note::
> +
> + In some cases, the :term:`UNPACKDIR` directory only holds the sources
> + temporarily. When the first directory after :term:`WORKDIR` in the
> + :term:`S` variable is matched in :term:`UNPACKDIR`, the directory
> + in :term:`UNPACKDIR` is moved to the :term:`WORKDIR` directory.
> +
> + For example, let's represent the :term:`UNPACKDIR` directory
> + for the ``foobar`` recipe after extraction as follows::
> +
> + ${WORKDIR}/sources-unpack/foobar-1.0.0/...
> +
> + And the variable :term:`S` for this recipe defined as::
> +
> + S = "${WORKDIR}/${BP}"
> +
> + Where :term:`BP` expands to ``foobar-1.0.0``.
> +
> + Since the first directory of :term:`S` after :term:`WORKDIR`
> + (``foobar-1.0.0``) matches the directory ``foobar-1.0.0`` under
> + ``sources-unpack``, the latter is moved to the :term:`WORKDIR`
> + directory. The final location of the source code will then be
> + ``${WORKDIR}/foobar-1.0.0``.
> +
> + This behavior was added for compatibility for recipes that do not set
> + the :term:`UNPACKDIR` and :term:`S` variable in the recommended way.
> +
I've read this 5 times now, it may be too late for my brain today but I
am not sure I got it :)
Let me try to reword it just to make sure I understood/got it right?
If UNPACKDIR differs from S, but the name of the directory (dirA) where
sources are unpacked in UNPACKDIR matches the basename of the directory
used for S, then the content of UNPACKDIR/dirA is moved into S?
If that's right, what really happens? Is UNPACKDIR variable modified to
point to S once the move is done? When is this happening?
Cheers,
Quentin
next prev parent reply other threads:[~2025-02-20 16:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 9:11 [PATCH 0/6] Updates around the UNPACKDIR variable Antonin Godard
2025-02-18 9:11 ` [PATCH 1/6] overview-manual: convert source-fetching.png to svg and fix UNPACKDIR Antonin Godard
2025-02-20 16:03 ` [docs] " Quentin Schulz
2025-02-18 9:11 ` [PATCH 2/6] overview-manual: convert patching.png to svg Antonin Godard
2025-02-20 16:05 ` [docs] " Quentin Schulz
2025-02-18 9:11 ` [PATCH 3/6] overview-manual: convert configuration-compile-autoreconf.png " Antonin Godard
2025-02-20 16:13 ` [docs] " Quentin Schulz
2025-02-24 9:19 ` Antonin Godard
2025-02-24 10:26 ` Quentin Schulz
2025-02-24 10:37 ` Antonin Godard
2025-02-18 9:11 ` [PATCH 4/6] overview-manual: convert analysis-for-package-splitting.png " Antonin Godard
2025-02-20 16:18 ` [docs] " Quentin Schulz
2025-02-24 10:44 ` Antonin Godard
2025-02-24 10:48 ` Quentin Schulz
2025-02-18 9:12 ` [PATCH 5/6] overview-manual: add UNPACKDIR in the directory description Antonin Godard
2025-02-20 16:22 ` [docs] " Quentin Schulz
2025-02-18 9:12 ` [PATCH 6/6] ref-manual/variables: improve the UNPACKDIR documentation Antonin Godard
2025-02-20 16:41 ` Quentin Schulz [this message]
2025-02-24 10:53 ` [docs] " Antonin Godard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4db28cd-1701-49ba-8c90-938128fe61df@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=antonin.godard@bootlin.com \
--cc=docs@lists.yoctoproject.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.