blob: 1820f5cfd8a246e4d77483ead5a30563177ec4b1 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
Andrew Geisslereff27472021-10-29 15:35:00 -05003Introduction
4============
5
6This guide provides a list of the backwards-incompatible changes you
7might need to adapt to in your existing Yocto Project configuration
8when upgrading to a new release.
9
10If you are upgrading over multiple releases, you will need to follow
11the sections from the version following the one you were previously
12using up to the new version you are upgrading to.
13
14
Andrew Geisslerc9f78652020-09-18 14:11:35 -050015General Migration Considerations
Andrew Geisslereff27472021-10-29 15:35:00 -050016--------------------------------
Andrew Geisslerc9f78652020-09-18 14:11:35 -050017
18Some considerations are not tied to a specific Yocto Project release.
19This section presents information you should consider when migrating to
20any new Yocto Project release.
21
22- *Dealing with Customized Recipes*:
23
24 Issues could arise if you take
25 older recipes that contain customizations and simply copy them
26 forward expecting them to work after you migrate to new Yocto Project
27 metadata. For example, suppose you have a recipe in your layer that
28 is a customized version of a core recipe copied from the earlier
29 release, rather than through the use of an append file. When you
30 migrate to a newer version of Yocto Project, the metadata (e.g.
31 perhaps an include file used by the recipe) could have changed in a
32 way that would break the build. Say, for example, a function is
33 removed from an include file and the customized recipe tries to call
34 that function.
35
36 You could "forward-port" all your customizations in your recipe so
37 that everything works for the new release. However, this is not the
38 optimal solution as you would have to repeat this process with each
39 new release if changes occur that give rise to problems.
40
41 The better solution (where practical) is to use append files
42 (``*.bbappend``) to capture any customizations you want to make to a
Andrew Geisslereff27472021-10-29 15:35:00 -050043 recipe. Doing so isolates your changes from the main recipe, making
Andrew Geisslerc9f78652020-09-18 14:11:35 -050044 them much more manageable. However, sometimes it is not practical to
45 use an append file. A good example of this is when introducing a
46 newer or older version of a recipe in another layer.
47
Andrew Geisslereff27472021-10-29 15:35:00 -050048
Andrew Geisslerc9f78652020-09-18 14:11:35 -050049- *Updating Append Files*:
50
Andrew Geisslereff27472021-10-29 15:35:00 -050051 Since append (``.bbappend``) files generally only contain
Andrew Geisslerc9f78652020-09-18 14:11:35 -050052 your customizations, they often do not need to be adjusted for new
Andrew Geisslereff27472021-10-29 15:35:00 -050053 releases. However, if the append file is specific to a
Andrew Geisslerc9f78652020-09-18 14:11:35 -050054 particular version of the recipe (i.e. its name does not use the %
55 wildcard) and the version of the recipe to which it is appending has
56 changed, then you will at a minimum need to rename the append file to
57 match the name of the recipe file. A mismatch between an append file
58 and its corresponding recipe file (``.bb``) will trigger an error
59 during parsing.
60
61 Depending on the type of customization the append file applies, other
62 incompatibilities might occur when you upgrade. For example, if your
63 append file applies a patch and the recipe to which it is appending
64 is updated to a newer version, the patch might no longer apply. If
65 this is the case and assuming the patch is still needed, you must
66 modify the patch file so that it does apply.
67
Andrew Geisslereff27472021-10-29 15:35:00 -050068 .. tip::
69
70 You can list all append files used in your configuration by running:
71
72 bitbake-layers show-appends
Andrew Geisslerc9f78652020-09-18 14:11:35 -050073
74
Patrick Williams975a06f2022-10-21 14:42:47 -050075.. _migration-general-buildhistory:
76
77- *Checking Image / SDK Changes*:
78
Andrew Geissler517393d2023-01-13 08:55:19 -060079 The :ref:`ref-classes-buildhistory` class can be used
Patrick Williams975a06f2022-10-21 14:42:47 -050080 if you wish to check the impact of changes to images / SDKs across
81 the migration (e.g. added/removed packages, added/removed files, size
82 changes etc.). To do this, follow these steps:
83
Andrew Geissler517393d2023-01-13 08:55:19 -060084 #. Enable :ref:`ref-classes-buildhistory` before the migration
Patrick Williams975a06f2022-10-21 14:42:47 -050085
Andrew Geissler517393d2023-01-13 08:55:19 -060086 #. Run a pre-migration build
Patrick Williams975a06f2022-10-21 14:42:47 -050087
Andrew Geissler517393d2023-01-13 08:55:19 -060088 #. Capture the :ref:`ref-classes-buildhistory` output (as
89 specified by :term:`BUILDHISTORY_DIR`) and ensure it is preserved for
90 subsequent builds. How you would do this depends on how you are running
91 your builds - if you are doing this all on one workstation in the same
92 :term:`Build Directory` you may not need to do anything other than not
93 deleting the :ref:`ref-classes-buildhistory` output
94 directory. For builds in a pipeline it may be more complicated.
Patrick Williams975a06f2022-10-21 14:42:47 -050095
Andrew Geissler517393d2023-01-13 08:55:19 -060096 #. Set a tag in the :ref:`ref-classes-buildhistory` output (which is a git repository) before
Patrick Williams975a06f2022-10-21 14:42:47 -050097 migration, to make the commit from the pre-migration build easy to find
98 as you may end up running multiple builds during the migration.
99
Andrew Geissler517393d2023-01-13 08:55:19 -0600100 #. Perform the migration
Patrick Williams975a06f2022-10-21 14:42:47 -0500101
Andrew Geissler517393d2023-01-13 08:55:19 -0600102 #. Run a build
Patrick Williams975a06f2022-10-21 14:42:47 -0500103
Andrew Geissler517393d2023-01-13 08:55:19 -0600104 #. Check the output changes between the previously set tag and HEAD in the
105 :ref:`ref-classes-buildhistory` output using ``git diff`` or ``buildhistory-diff``.
Patrick Williams975a06f2022-10-21 14:42:47 -0500106
Andrew Geissler517393d2023-01-13 08:55:19 -0600107 For more information on using :ref:`ref-classes-buildhistory`, see
108 :ref:`dev-manual/build-quality:maintaining build output quality`.