migration-general.rst 4.6 KB

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