Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
| 2 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 3 | Introduction |
| 4 | ============ |
| 5 | |
| 6 | This guide provides a list of the backwards-incompatible changes you |
| 7 | might need to adapt to in your existing Yocto Project configuration |
| 8 | when upgrading to a new release. |
| 9 | |
| 10 | If you are upgrading over multiple releases, you will need to follow |
| 11 | the sections from the version following the one you were previously |
| 12 | using up to the new version you are upgrading to. |
| 13 | |
| 14 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 15 | General Migration Considerations |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 16 | -------------------------------- |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 17 | |
| 18 | Some considerations are not tied to a specific Yocto Project release. |
| 19 | This section presents information you should consider when migrating to |
| 20 | any 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 43 | recipe. Doing so isolates your changes from the main recipe, making |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 44 | 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 48 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 49 | - *Updating Append Files*: |
| 50 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 51 | Since append (``.bbappend``) files generally only contain |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 52 | your customizations, they often do not need to be adjusted for new |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 53 | releases. However, if the append file is specific to a |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 54 | 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 Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 68 | .. tip:: |
| 69 | |
| 70 | You can list all append files used in your configuration by running: |
| 71 | |
| 72 | bitbake-layers show-appends |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 73 | |
| 74 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 75 | .. _migration-general-buildhistory: |
| 76 | |
| 77 | - *Checking Image / SDK Changes*: |
| 78 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 79 | The :ref:`ref-classes-buildhistory` class can be used |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 80 | 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 84 | #. Enable :ref:`ref-classes-buildhistory` before the migration |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 85 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 86 | #. Run a pre-migration build |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 87 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 88 | #. 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 Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 95 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 96 | #. Set a tag in the :ref:`ref-classes-buildhistory` output (which is a git repository) before |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 97 | 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 100 | #. Perform the migration |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 101 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 102 | #. Run a build |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 103 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 104 | #. 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 Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 106 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 107 | For more information on using :ref:`ref-classes-buildhistory`, see |
| 108 | :ref:`dev-manual/build-quality:maintaining build output quality`. |