migration-3.4.rst 12 KB

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