migration-3.4.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Migration notes for 3.4 (honister)
  3. ----------------------------------
  4. This section provides migration information for moving to the Yocto
  5. Project 3.4 Release (codename "honister") from the prior release.
  6. Override syntax changes
  7. ~~~~~~~~~~~~~~~~~~~~~~~
  8. In this release, the ``:`` character replaces the use of ``_`` to
  9. refer to an override, most commonly when making a conditional assignment
  10. of a variable. This means that an entry like::
  11. SRC_URI_qemux86 = "file://somefile"
  12. now becomes::
  13. SRC_URI:qemux86 = "file://somefile"
  14. since ``qemux86`` is an override. This applies to any use of override
  15. syntax, so the following::
  16. SRC_URI_append = " file://somefile"
  17. SRC_URI_append_qemux86 = " file://somefile2"
  18. SRC_URI_remove_qemux86-64 = "file://somefile3"
  19. SRC_URI_prepend_qemuarm = "file://somefile4 "
  20. FILES_${PN}-ptest = "${bindir}/xyz"
  21. IMAGE_CMD_tar = "tar"
  22. BASE_LIB_tune-cortexa76 = "lib"
  23. SRCREV_pn-bash = "abc"
  24. BB_TASK_NICE_LEVEL_task-testimage = '0'
  25. would now become::
  26. SRC_URI:append = " file://somefile"
  27. SRC_URI:append:qemux86 = " file://somefile2"
  28. SRC_URI:remove:qemux86-64 = "file://somefile3"
  29. SRC_URI:prepend:qemuarm = "file://somefile4 "
  30. FILES:${PN}-ptest = "${bindir}/xyz"
  31. IMAGE_CMD:tar = "tar"
  32. BASE_LIB:tune-cortexa76 = "lib"
  33. SRCREV:pn-bash = "abc"
  34. BB_TASK_NICE_LEVEL:task-testimage = '0'
  35. This also applies to
  36. :ref:`variable queries to the datastore <bitbake-user-manual/bitbake-user-manual-metadata:functions for accessing datastore variables>`,
  37. for example using ``getVar`` and similar so ``d.getVar("RDEPENDS_${PN}")``
  38. becomes ``d.getVar("RDEPENDS:${PN}")``.
  39. Whilst some of these are fairly obvious such as :term:`MACHINE` and :term:`DISTRO`
  40. overrides, some are less obvious, for example the packaging variables such as
  41. :term:`RDEPENDS`, :term:`FILES` and so on taking package names (e.g. ``${PN}``,
  42. ``${PN}-ptest``) as overrides. These overrides are not always in
  43. :term:`OVERRIDES` but applied conditionally in specific contexts
  44. such as packaging. ``task-<taskname>`` is another context specific override, the
  45. context being specific tasks in that case. Tune overrides are another special
  46. case where some code does use them as overrides but some does not. We plan to try
  47. and make the tune code use overrides more consistently in the future.
  48. There are some variables which do not use override syntax which include the
  49. suffix to variables in ``layer.conf`` files such as :term:`BBFILE_PATTERN`,
  50. :term:`SRCREV`\ ``_xxx`` where ``xxx`` is a name from :term:`SRC_URI` and
  51. :term:`PREFERRED_VERSION`\ ``_xxx``. In particular, ``layer.conf`` suffixes
  52. may be the same as a :term:`DISTRO` override causing some confusion. We do
  53. plan to try and improve consistency as these issues are identified.
  54. To help with migration of layers, a script has been provided in OE-Core.
  55. Once configured with the overrides used by a layer, this can be run as::
  56. <oe-core>/scripts/contrib/convert-overrides.py <layerdir>
  57. .. note::
  58. Please read the notes in the script as it isn't entirely automatic and it isn't
  59. expected to handle every case. In particular, it needs to be told which overrides
  60. the layer uses (usually machine and distro names/overrides) and the result should
  61. be carefully checked since it can be a little enthusiastic and will convert
  62. references to ``_append``, ``_remove`` and ``_prepend`` in function and variable
  63. names.
  64. For reference, this conversion is important as it allows BitBake to more reliably
  65. determine what is an override and what is not, as underscores are also used in
  66. variable names without intending to be overrides. This should allow us to proceed
  67. with other syntax improvements and simplifications for usability. It also means
  68. BitBake no longer has to guess and maintain large lookup lists just in case
  69. e.g. ``functionname`` in ``my_functionname`` is an override, and thus should improve
  70. efficiency.
  71. New host dependencies
  72. ~~~~~~~~~~~~~~~~~~~~~
  73. The ``lz4c``, ``pzstd`` and ``zstd`` commands are now required to be
  74. installed on the build host to support LZ4 and Zstandard compression
  75. functionality. These are typically provided by ``lz4`` and ``zstd``
  76. packages in most Linux distributions. Alternatively they are available
  77. as part of :term:`buildtools` tarball if your distribution does not provide
  78. them. For more information see
  79. :ref:`ref-manual/system-requirements:required packages for the build host`.
  80. Removed recipes
  81. ~~~~~~~~~~~~~~~
  82. The following recipes have been removed in this release:
  83. - ``assimp``: problematic from a licensing perspective and no longer
  84. needed by anything else
  85. - ``clutter-1.0``: legacy component moved to meta-gnome
  86. - ``clutter-gst-3.0``: legacy component moved to meta-gnome
  87. - ``clutter-gtk-1.0``: legacy component moved to meta-gnome
  88. - ``cogl-1.0``: legacy component moved to meta-gnome
  89. - ``core-image-clutter``: removed along with clutter
  90. - ``linux-yocto``: removed version 5.4 recipes (5.14 and 5.10 still
  91. provided)
  92. - ``mklibs-native``: not actively tested and upstream mklibs still
  93. requires Python 2
  94. - ``mx-1.0``: obsolete (last release 2012) and isn't used by anything in
  95. any known layer
  96. - ``packagegroup-core-clutter``: removed along with clutter
  97. Removed classes
  98. ~~~~~~~~~~~~~~~
  99. - ``clutter``: moved to meta-gnome along with clutter itself
  100. - ``image-mklibs``: not actively tested and upstream mklibs still
  101. requires Python 2
  102. - ``meta``: no longer useful. Recipes that need to skip installing
  103. packages should inherit :ref:`ref-classes-nopackages` instead.
  104. Prelinking disabled by default
  105. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. Recent tests have shown that prelinking works only when PIE is not
  107. enabled (see `here <https://rlbl.me/prelink-1>`__ and `here <https://rlbl.me/prelink-2>`__),
  108. and as PIE is both a desirable security feature, and the only
  109. configuration provided and tested by the Yocto Project, there is
  110. simply no sense in continuing to enable prelink.
  111. There's also a concern that no one is maintaining the code, and there
  112. are open bugs (including :yocto_bugs:`this serious one </show_bug.cgi?id=14429>`).
  113. Given that prelink does intricate address arithmetic and rewriting
  114. of binaries the best option is to disable the feature. It is recommended
  115. that you consider disabling this feature in your own configuration if
  116. it is currently enabled.
  117. Virtual runtime provides
  118. ~~~~~~~~~~~~~~~~~~~~~~~~
  119. Recipes shouldn't use the ``virtual/`` string in :term:`RPROVIDES` and
  120. :term:`RDEPENDS` --- it is confusing because ``virtual/`` has no special
  121. meaning in :term:`RPROVIDES` and :term:`RDEPENDS` (unlike in the
  122. corresponding build-time :term:`PROVIDES` and :term:`DEPENDS`).
  123. Tune files moved to architecture-specific directories
  124. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. The tune files found in ``conf/machine/include`` have now been moved
  126. into their respective architecture name directories under that same
  127. location; e.g. x86 tune files have moved into an ``x86`` subdirectory,
  128. MIPS tune files have moved into a ``mips`` subdirectory, etc.
  129. The ARM tunes have an extra level (``armv8a``, ``armv8m``, etc.) and
  130. some have been renamed to make them uniform with the rest of the tunes.
  131. See :yocto_git:`this commit </poky/commit/?id=1d381f21f5f13aa0c4e1a45683ed656ebeedd37d>`
  132. for reference.
  133. If you have any references to tune files (e.g. in custom machine
  134. configuration files) they will need to be updated.
  135. Extensible SDK host extension
  136. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137. For a normal SDK, some layers append to :term:`TOOLCHAIN_HOST_TASK`
  138. unconditionally which is fine, until the eSDK tries to override the
  139. variable to its own values. Instead of installing packages specified
  140. in this variable it uses native recipes instead --- a very different
  141. approach. This has led to confusing errors when binaries are added
  142. to the SDK but not relocated.
  143. To avoid these issues, a new :term:`TOOLCHAIN_HOST_TASK_ESDK` variable has
  144. been created. If you wish to extend what is installed in the host
  145. portion of the eSDK then you will now need to set this variable.
  146. Package/recipe splitting
  147. ~~~~~~~~~~~~~~~~~~~~~~~~
  148. - ``perl-cross`` has been split out from the main ``perl`` recipe to
  149. its own ``perlcross`` recipe for maintenance reasons. If you have
  150. bbappends for the perl recipe then these may need extending.
  151. - The ``wayland`` recipe now packages its binaries in a
  152. ``wayland-tools`` package rather than putting them into
  153. ``wayland-dev``.
  154. - Xwayland has been split out of the xserver-xorg tree and thus is now
  155. in its own ``xwayland`` recipe. If you need Xwayland in your image
  156. then you may now need to add it explicitly.
  157. - The ``rpm`` package no longer has ``rpm-build`` in its :term:`RRECOMMENDS`;
  158. if by chance you still need rpm package building functionality in
  159. your image and you have not already done so then you should add
  160. ``rpm-build`` to your image explicitly.
  161. - The Python ``statistics`` standard module is now packaged in its own
  162. ``python3-statistics`` package instead of ``python3-misc`` as
  163. previously.
  164. Image / SDK generation changes
  165. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166. - Recursive dependencies on the :ref:`ref-tasks-build` task are now disabled when
  167. building SDKs. These are generally not needed; in the unlikely event
  168. that you do encounter problems then it will probably be as a result of
  169. missing explicit dependencies that need to be added.
  170. - Errors during "complementary" package installation (e.g. for ``*-dbg``
  171. and ``*-dev`` packages) during image construction are no longer
  172. ignored. Historically some of these packages had installation problems,
  173. that is no longer the case. In the unlikely event that you see errors
  174. as a result, you will need to fix the installation/packaging issues.
  175. - When building an image, only packages that will be used in building
  176. the image (i.e. the first entry in :term:`PACKAGE_CLASSES`) will be
  177. produced if multiple package types are enabled (which is not a typical
  178. configuration). If in your CI system you need to have the original
  179. behaviour, use ``bitbake --runall build <target>``.
  180. - The ``-lic`` package is no longer automatically added to
  181. :term:`RRECOMMENDS` for every other package when
  182. :term:`LICENSE_CREATE_PACKAGE` is set to "1". If you wish all license
  183. packages to be installed corresponding to packages in your image, then
  184. you should instead add the new ``lic-pkgs`` feature to
  185. :term:`IMAGE_FEATURES`.
  186. Miscellaneous
  187. ~~~~~~~~~~~~~
  188. - Certificates are now properly checked when BitBake fetches sources
  189. over HTTPS. If you receive errors as a result for your custom recipes,
  190. you will need to use a mirror or address the issue with the operators
  191. of the server in question.
  192. - ``avahi`` has had its GTK+ support disabled by default. If you wish to
  193. re-enable it, set ``AVAHI_GTK = "gtk3"`` in a bbappend for the
  194. ``avahi`` recipe or in your custom distro configuration file.
  195. - Setting the ``BUILD_REPRODUCIBLE_BINARIES`` variable to "0" no longer
  196. uses a strangely old fallback date of April 2011, it instead disables
  197. building reproducible binaries as you would logically expect.
  198. - Setting noexec/nostamp/fakeroot varflags to any value besides "1" will
  199. now trigger a warning. These should be either set to "1" to enable, or
  200. not set at all to disable.
  201. - The previously deprecated ``COMPRESS_CMD`` and
  202. ``CVE_CHECK_CVE_WHITELIST`` variables have been removed. Use
  203. :term:`CONVERSION_CMD` and ``CVE_CHECK_WHITELIST`` (replaced by
  204. :term:`CVE_CHECK_IGNORE` in version 4.0) respectively
  205. instead.
  206. - The obsolete ``oe_machinstall`` function previously provided in the
  207. :ref:`ref-classes-utils` class has been removed. For
  208. machine-specific installation it is recommended that you use the
  209. built-in override support in the fetcher or overrides in general
  210. instead.
  211. - The ``-P`` (``--clear-password``) option can no longer be used with
  212. ``useradd`` and ``usermod`` entries in :term:`EXTRA_USERS_PARAMS`.
  213. It was being implemented using a custom patch to the ``shadow`` recipe
  214. which clashed with a ``-P`` option that was added upstream in
  215. ``shadow`` version 4.9, and in any case is fundamentally insecure.
  216. Hardcoded passwords are still supported but they need to be hashed, see
  217. examples in :term:`EXTRA_USERS_PARAMS`.