migration-general.rst 4.7 KB

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