Skip to contentSkip to conversation

migration-guides/migration-5.3.rst: add guidance for breaking WORKDIR changes

PATCH Superseded Antonin Godard 2 participants 5 messages Jun 24, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover migration-guides/migration-5.3.rst: add guidance for breaking WORKDIR changes

---
Alexander Kanavin (1):
migration-guides/migration-5.3.rst: add guidance for breaking WORKDIR changes

Antonin Godard (1):
ref-manual/variables.rst: document BB_GIT_DEFAULT_DESTSUFFIX

 documentation/migration-guides/migration-5.3.rst | 50 ++++++++++++++++++++++++
 documentation/ref-manual/variables.rst           |  7 ++++
 2 files changed, 57 insertions(+)

---
base-commit: 8a64ef83efcd5df70706a651751c8198f7c27c13
change-id: 20250624-migration-5-3-unpackdir-9e2e7bcfee1d

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>
#1 lore raw

PATCH 1/2 ref-manual/variables.rst: document BB_GIT_DEFAULT_DESTSUFFIX

Recently added in BitBake with 378db0fdd95f ("fetch2/git: allow overriding default unpack directory with a variable").

---
 documentation/ref-manual/variables.rst | 7 +++++++
 1 file changed, 7 insertions(+)
documentation/ref-manual/variables.rst +7 -0
index 0a748c918..ae6402220 100644
@@ -560,6 +560,13 @@ system and gives an overview of their function and contents.
    :term:`BB_GENERATE_SHALLOW_TARBALLS`
       See :term:`bitbake:BB_GENERATE_SHALLOW_TARBALLS` in the BitBake manual.
 
+   :term:`BB_GIT_DEFAULT_DESTSUFFIX`
+      See :term:`bitbake:BB_GENERATE_SHALLOW_TARBALLS` in the BitBake manual.
+
+      In :term:`OpenEmbedded-Core (OE-Core)`, this variable is set to
+      :term:`BP` by default in :oe_git:`bitbake.conf
+      </openembedded-core/tree/meta/conf/bitbake.conf>`.
+
    :term:`BB_GIT_SHALLOW`
       See :term:`bitbake:BB_GIT_SHALLOW` in the BitBake manual.
 
Signature · 1 line
2.49.0
#2 lore raw

Re: [docs] [PATCH 1/2] ref-manual/variables.rst: document BB_GIT_DEFAULT_DESTSUFFIX

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 564

Quoted 2 lines · Antonin Godard via lists.yoctoproject.org
documentation/ref-manual/variables.rst +2 -0
+   :term:`BB_GIT_DEFAULT_DESTSUFFIX`
+      See :term:`bitbake:BB_GENERATE_SHALLOW_TARBALLS` in the BitBake manual.

Incorrect copy-paste.

Alex

#3 lore raw

Re: [docs] [PATCH 1/2] ref-manual/variables.rst: document BB_GIT_DEFAULT_DESTSUFFIX

Quoted 7 lines · Alexander Kanavin

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 564

Quoted 2 lines · Antonin Godard via lists.yoctoproject.org
documentation/ref-manual/variables.rst +2 -0
+   :term:`BB_GIT_DEFAULT_DESTSUFFIX`
+      See :term:`bitbake:BB_GENERATE_SHALLOW_TARBALLS` in the BitBake manual.

Incorrect copy-paste.

Ha, well spotted thanks.

Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 2/2 migration-guides/migration-5.3.rst: add guidance for breaking WORKDIR changes

In reply to Antonin Godard

From: Alexander Kanavin <[email protected]>

---
 documentation/migration-guides/migration-5.3.rst | 50 ++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
documentation/migration-guides/migration-5.3.rst +50 -0
index 09095c7bb..4d2e1763c 100644
@@ -14,6 +14,56 @@ Migration notes for |yocto-ver| (|yocto-codename|)
 This section provides migration information for moving to the Yocto
 Project |yocto-ver| Release (codename "|yocto-codename|") from the prior release.
 
+:term:`WORKDIR` changes
+~~~~~~~~~~~~~~~~~~~~~~~
+
+``S = ${WORKDIR}/something`` no longer supported
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If a recipe has :term:`S` set to be ``${``\ :term:`WORKDIR`\ ``}/something``,
+this is no longer supported, and an error will be issued. The recipe should be
+changed to::
+
+   S = "${UNPACKDIR}/something"
+
+``S = ${WORKDIR}/git`` and ``S = ${UNPACKDIR}/git`` should be removed
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Git fetcher now unpacks into the :term:`BB_GIT_DEFAULT_DESTSUFFIX` directory
+rather than the ``git/`` directory under :term:`UNPACKDIR`.
+:term:`BB_GIT_DEFAULT_DESTSUFFIX` is set in :term:`OpenEmbedded-Core
+(OE-Core)`'s :oe_git:`bitbake.conf
+</openembedded-core/tree/meta/conf/bitbake.conf>` to :term:`BP`.
+
+This location matches the default value of :term:`S` set by bitbake.conf, so :term:`S`
+setting in recipes can and should be removed.
+
+Note that when :term:`S` is set to a subdirectory of the git checkout, then it
+should be instead adjusted according to the previous point::
+
+   S = "${UNPACKDIR}/${BP}/something"
+
+Note that "git" as the source checkout location can be hardcoded
+in other places in recipes; when it's in :term:`SRC_URI`, replace with
+:term:`BB_GIT_DEFAULT_DESTSUFFIX`, otherwise replace with :term:`BP`.
+
+How to make those adjustments without tedious manual editing
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following sed command can be used to remove S = "${WORKDIR}/git
+across a whole layer::
+
+   sed -i "/^S = \"\${WORKDIR}\/git\"/d" `find . -name *.bb -o -name *.inc -o -name *.bbclass`
+
+Then, the following command can tweak the remaining :term:`S` assignments to
+refer to :term:`UNPACKDIR` instead of :term:`WORKDIR`::
+
+   sed -i "s/^S = \"\${WORKDIR}\//S = \"\${UNPACKDIR}\//g" `find . -name *.bb -o -name *.inc -o -name *.bbclass`
+
+The first change can introduce a lot of consecutive empty lines, so those can be removed with::
+
+   sed -i -z -E 's/([ \t\f\v\r]*\n){3,}/\n\n/g' `find . -name *.bb -o -name *.inc`
+
 Supported kernel versions
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.49.0