summaryrefslogtreecommitdiff
path: root/upstream-layers/yocto-docs/documentation/dev-manual/temporary-source-code.rst
blob: cb27d22070efecd39f01b399ac440dab1466df80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK

Finding Temporary Source Code
*****************************

You might find it helpful during development to modify the temporary
source code used by recipes to build packages. For example, suppose you
are developing a patch and you need to experiment a bit to figure out
your solution. After you have initially built the package, you can
iteratively tweak the source code, which is located in the
:term:`Build Directory`, and then you can force a re-compile and quickly
test your altered code. Once you settle on a solution, you can then preserve
your changes in the form of patches.

During a build, the unpacked temporary source code used by recipes to
build packages is available in the :term:`Build Directory` as defined by the
:term:`S` variable. Below is the default value for the :term:`S` variable as
defined in the ``meta/conf/bitbake.conf`` configuration file in
:term:`OpenEmbedded-Core (OE-Core)`::

   S = "${UNPACKDIR}/${BP}"

You should be aware that many recipes override the
:term:`S` variable when the default isn't accurate.

.. note::

   The :term:`BP` represents the base recipe name, which consists of the name
   and version::

           BP = "${BPN}-${PV}"

   This matches the location that the git fetcher unpacks to, and usually
   matches unpacked content of release tarballs (e.g. they contain a single
   directory which matches value of ${BP} exactly).

The path to the unpack directory for the recipe
(:term:`UNPACKDIR`) is defined as follows::

   ${WORKDIR}/sources

In turn, the path to the work directory for the recipe
(:term:`WORKDIR`) is defined as
follows::

   ${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}

The actual directory depends on several things:

-  :term:`BASE_WORKDIR`: The top-level build
   output directory.

-  :term:`MULTIMACH_TARGET_SYS`:
   The target system identifier.

-  :term:`PN`: The recipe name.

-  :term:`PV`: The recipe version.

As an example, assume a Source Directory top-level folder named
``project``, a default :term:`Build Directory` at ``project/build``, and a
``qemux86-poky-linux`` machine target system. Furthermore, suppose your
recipe is named ``foo_1.3.0.bb``. In this case, the work directory the
build system uses to build the package would be as follows::

   project/build/tmp/work/qemux86-poky-linux/foo/1.3.0

.. note::

   If you want to iterate over testing your local changes, the proper way
   is to use the ``devtool`` utility.

   To learn how to use ``devtool`` to add, modify, upgrade recipes and more,
   see the :ref:`dev-manual/devtool:Using the \`\`devtool\`\` command-line tool`
   section of this Development Tasks Manual.