migration-3.2.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Release 3.2 (gatesgarth)
  3. ========================
  4. This section provides migration information for moving to the Yocto
  5. Project 3.2 Release (codename "gatesgarth") from the prior release.
  6. .. _migration-3.2-minimum-system-requirements:
  7. Minimum system requirements
  8. ---------------------------
  9. ``gcc`` version 6.0 is now required at minimum on the build host. For older
  10. host distributions where this is not available, you can use the
  11. ``buildtools-extended-tarball`` (easily installable using
  12. ``scripts/install-buildtools``).
  13. .. _migration-3.2-removed-recipes:
  14. Removed recipes
  15. ---------------
  16. The following recipes have been removed:
  17. - ``bjam-native``: replaced by ``boost-build-native``
  18. - ``avahi-ui``: folded into the main ``avahi`` recipe --- the GTK UI can be disabled using :term:`PACKAGECONFIG` for ``avahi``.
  19. - ``build-compare``: no longer needed with the removal of the ``packagefeed-stability`` class
  20. - ``dhcp``: obsolete, functionally replaced by ``dhcpcd`` and ``kea``
  21. - ``libmodulemd-v1``: replaced by ``libmodulemd``
  22. - ``packagegroup-core-device-devel``: obsolete
  23. .. _migration-3.2-removed-classes:
  24. Removed classes
  25. ---------------
  26. The following classes (.bbclass files) have been removed:
  27. - ``spdx``: obsolete --- the Yocto Project is a strong supporter of SPDX, but this class was old code using a dated approach and had the potential to be misleading. The ``meta-sdpxscanner`` layer is a much more modern and active approach to handling this and is recommended as a replacement.
  28. - ``packagefeed-stability``: this class had become obsolete with the advent of hash equivalence and reproducible builds.
  29. pseudo path filtering and mismatch behaviour
  30. --------------------------------------------
  31. pseudo now operates on a filtered subset of files. This is a significant change
  32. to the way pseudo operates within OpenEmbedded --- by default, pseudo monitors and
  33. logs (adds to its database) any file created or modified whilst in a ``fakeroot``
  34. environment. However, there are large numbers of files that we simply don't care
  35. about the permissions of whilst in that ``fakeroot`` context, for example ${:term:`S`}, ${:term:`B`}, ${:term:`T`},
  36. ${:term:`SSTATE_DIR`}, the central sstate control directories, and others.
  37. As of this release, new functionality in pseudo is enabled to ignore these
  38. directory trees (controlled using a new :term:`PSEUDO_IGNORE_PATHS` variable)
  39. resulting in a cleaner database with less chance of "stray" mismatches if files
  40. are modified outside pseudo context. It also should reduce some overhead from
  41. pseudo as the interprocess round trip to the server is avoided.
  42. There is a possible complication where some existing recipe may break, for
  43. example, a recipe was found to be writing to ``${B}/install`` for
  44. ``make install`` in :ref:`ref-tasks-install` and since ``${B}`` is listed as not to be tracked,
  45. there were errors trying to ``chown root`` for files in this location. Another
  46. example was the ``tcl`` recipe where the source directory :term:`S` is set to a
  47. subdirectory of the source tree but files were written out to the directory
  48. structure above that subdirectory. For these types of cases in your own recipes,
  49. extend :term:`PSEUDO_IGNORE_PATHS` to cover additional paths that pseudo should not
  50. be monitoring.
  51. In addition, pseudo's behaviour on mismatches has now been changed --- rather
  52. than doing what turns out to be a rather dangerous "fixup" if it sees a file
  53. with a different path but the same inode as another file it has previously seen,
  54. pseudo will throw an ``abort()`` and direct you to a :yocto_wiki:`wiki page </Pseudo_Abort>`
  55. that explains how to deal with this.
  56. .. _migration-3.2-multilib-mlprefix:
  57. ``MLPREFIX`` now required for multilib when runtime dependencies conditionally added
  58. ------------------------------------------------------------------------------------
  59. In order to solve some previously intractable problems with runtime
  60. dependencies and multilib, a change was made that now requires the :term:`MLPREFIX`
  61. value to be explicitly prepended to package names being added as
  62. dependencies (e.g. in :term:`RDEPENDS` and :term:`RRECOMMENDS` values)
  63. where the dependency is conditionally added.
  64. If you have anonymous Python or in-line Python conditionally adding
  65. dependencies in your custom recipes, and you intend for those recipes to
  66. work with multilib, then you will need to ensure that ``${MLPREFIX}``
  67. is prefixed on the package names in the dependencies, for example
  68. (from the ``glibc`` recipe)::
  69. RRECOMMENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"
  70. This also applies when conditionally adding packages to :term:`PACKAGES` where
  71. those packages have dependencies, for example (from the ``alsa-plugins`` recipe)::
  72. PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
  73. ...
  74. RDEPENDS_${PN}-pulseaudio-conf += "\
  75. ${MLPREFIX}libasound-module-conf-pulse \
  76. ${MLPREFIX}libasound-module-ctl-pulse \
  77. ${MLPREFIX}libasound-module-pcm-pulse \
  78. "
  79. .. _migration-3.2-packagegroup-core-device-devel:
  80. packagegroup-core-device-devel no longer included in images built for qemu* machines
  81. ------------------------------------------------------------------------------------
  82. ``packagegroup-core-device-devel`` was previously added automatically to
  83. images built for ``qemu*`` machines, however the purpose of the group and what
  84. it should contain is no longer clear, and in general, adding userspace
  85. development items to images is best done at the image/class level; thus this
  86. packagegroup was removed.
  87. This packagegroup previously pulled in the following:
  88. - ``distcc-config``
  89. - ``nfs-export-root``
  90. - ``bash``
  91. - ``binutils-symlinks``
  92. If you still need any of these in your image built for a ``qemu*`` machine
  93. then you will add them explicitly to :term:`IMAGE_INSTALL` or another
  94. appropriate place in the dependency chain for your image (if you have not
  95. already done so).
  96. .. _migration-3.2-dhcp:
  97. DHCP server/client replaced
  98. ---------------------------
  99. The ``dhcp`` software package has become unmaintained and thus has been
  100. functionally replaced by ``dhcpcd`` (client) and ``kea`` (server). You will
  101. need to replace references to the recipe/package names as appropriate --- most
  102. commonly, at the package level ``dhcp-client`` should be replaced by
  103. ``dhcpcd`` and ``dhcp-server`` should be replaced by ``kea``. If you have any
  104. custom configuration files for these they will need to be adapted --- refer to
  105. the upstream documentation for ``dhcpcd`` and ``kea`` for further details.
  106. .. _migration-3.2-packaging-changes:
  107. Packaging changes
  108. -----------------
  109. - ``python3``: the ``urllib`` Python package has now moved into the core package, as it is used more commonly than just netclient (e.g. email, xml, mimetypes, pydoc). In addition, the ``pathlib`` module is now also part of the core package.
  110. - ``iptables``: ``iptables-apply`` and ``ip6tables-apply`` have been split out to their own package to avoid a bash dependency in the main ``iptables`` package
  111. .. _migration-3.2-package-qa-checks:
  112. Package QA check changes
  113. ------------------------
  114. Previously, the following package QA checks triggered warnings, however they can
  115. be indicators of genuine underlying problems and are therefore now treated as
  116. errors:
  117. - :ref:`already-stripped <qa-check-already-stripped>`
  118. - :ref:`compile-host-path <qa-check-compile-host-path>`
  119. - :ref:`installed-vs-shipped <qa-check-installed-vs-shipped>`
  120. - :ref:`ldflags <qa-check-ldflags>`
  121. - :ref:`pn-overrides <qa-check-pn-overrides>`
  122. - :ref:`rpaths <qa-check-rpaths>`
  123. - :ref:`staticdev <qa-check-staticdev>`
  124. - :ref:`unknown-configure-option <qa-check-unknown-configure-option>`
  125. - :ref:`useless-rpaths <qa-check-useless-rpaths>`
  126. In addition, the following new checks were added and default to triggering an error:
  127. - :ref:`shebang-size <qa-check-shebang-size>`: Check for shebang (#!) lines longer than 128 characters, which can give an error at runtime depending on the operating system.
  128. - :ref:`unhandled-features-check <qa-check-unhandled-features-check>`: Check if any of the variables supported by the :ref:`features_check <ref-classes-features_check>` class is set while not inheriting the class itself.
  129. - :ref:`missing-update-alternatives <qa-check-missing-update-alternatives>`: Check if the recipe sets the :term:`ALTERNATIVE` variable for any of its packages, and does not inherit the :ref:`update-alternatives <ref-classes-update-alternatives>` class.
  130. - A trailing slash or duplicated slashes in the value of :term:`S` or :term:`B` will now trigger a warning so that they can be removed and path comparisons can be more reliable --- remove any instances of these in your recipes if the warning is displayed.
  131. .. _migration-3.2-src-uri-file-globbing:
  132. Globbing no longer supported in ``file://`` entries in ``SRC_URI``
  133. ------------------------------------------------------------------
  134. Globbing (``*`` and ``?`` wildcards) in ``file://`` URLs within :term:`SRC_URI`
  135. did not properly support file checksums, thus changes to the source files
  136. would not always change the :ref:`ref-tasks-fetch` task checksum, and consequently would
  137. not ensure that the changed files would be incorporated in subsequent builds.
  138. Unfortunately it is not practical to make globbing work generically here, so
  139. the decision was taken to remove support for globs in ``file://`` URLs.
  140. If you have any usage of these in your recipes, then you will now need to
  141. either add each of the files that you expect to match explicitly, or
  142. alternatively if you still need files to be pulled in dynamically, put the
  143. files into a subdirectory and reference that instead.
  144. .. _migration-3.2-deploydir-clean:
  145. deploy class now cleans ``DEPLOYDIR`` before ``do_deploy``
  146. ----------------------------------------------------------
  147. :ref:`ref-tasks-deploy` as implemented in the :ref:`deploy <ref-classes-deploy>` class now cleans up ${:term:`DEPLOYDIR`} before running, just as :ref:`ref-tasks-install` cleans up ${:term:`D`} before running. This reduces the risk of :term:`DEPLOYDIR` being accidentally contaminated by files from previous runs, possibly even with different config, in case of incremental builds.
  148. Most recipes and classes that inherit the :ref:`deploy <ref-classes-deploy>` class or interact with :ref:`ref-tasks-deploy` are unlikely to be affected by this unless they add ``prefuncs`` to :ref:`ref-tasks-deploy` *which also* put files into ``${DEPLOYDIR}`` --- these should be refactored to use ``do_deploy_prepend`` instead.
  149. .. _migration-3.2-nativesdk-sdk-provides-dummy:
  150. Custom SDK / SDK-style recipes need to include ``nativesdk-sdk-provides-dummy``
  151. -------------------------------------------------------------------------------
  152. All :ref:`nativesdk <ref-classes-nativesdk>` packages require ``/bin/sh`` due
  153. to their postinstall scriptlets, thus this package has to be dummy-provided
  154. within the SDK and ``nativesdk-sdk-provides-dummy`` now does this. If you have
  155. a custom SDK recipe (or your own SDK-style recipe similar to e.g.
  156. ``buildtools-tarball``), you will need to ensure
  157. ``nativesdk-sdk-provides-dummy`` or an equivalent is included in
  158. :term:`TOOLCHAIN_HOST_TASK`.
  159. ``ld.so.conf`` now moved back to main ``glibc`` package
  160. -------------------------------------------------------
  161. There are cases where one doesn't want ``ldconfig`` on target (e.g. for
  162. read-only root filesystems, it's rather pointless), yet one still
  163. needs ``/etc/ld.so.conf`` to be present at image build time:
  164. When some recipe installs libraries to a non-standard location, and
  165. therefore installs in a file in ``/etc/ld.so.conf.d/foo.conf``, we
  166. need ``/etc/ld.so.conf`` containing::
  167. include /etc/ld.so.conf.d/*.conf
  168. in order to get those other locations picked up.
  169. Thus ``/etc/ld.so.conf`` is now in the main ``glibc`` package so that
  170. there's always an ``ld.so.conf`` present when the build-time ``ldconfig``
  171. runs towards the end of image construction.
  172. The ``ld.so.conf`` and ``ld.so.conf.d/*.conf`` files do not take up
  173. significant space (at least not compared to the ~700kB ``ldconfig`` binary), and they
  174. might be needed in case ``ldconfig`` is installable, so they are left
  175. in place after the image is built. Technically it would be possible to
  176. remove them if desired, though it would not be trivial if you still
  177. wanted the build-time ldconfig to function (:term:`ROOTFS_POSTPROCESS_COMMAND`
  178. will not work as ``ldconfig`` is run after the functions referred to
  179. by that variable).
  180. .. _migration-3.2-virgl:
  181. Host DRI drivers now used for GL support within ``runqemu``
  182. -----------------------------------------------------------
  183. ``runqemu`` now uses the mesa-native libraries everywhere virgl is used
  184. (i.e. when ``gl``, ``gl-es`` or ``egl-headless`` options are specified),
  185. but instructs them to load DRI drivers from the host. Unfortunately this
  186. may not work well with proprietary graphics drivers such as those from
  187. Nvidia; if you are using such drivers then you may need to switch to an
  188. alternative (such as Nouveau in the case of Nvidia hardware) or avoid
  189. using the GL options.
  190. .. _migration-3.2-initramfs-suffix:
  191. Initramfs images now use a blank suffix
  192. ---------------------------------------
  193. The reference :term:`Initramfs` images (``core-image-minimal-initramfs``,
  194. ``core-image-tiny-initramfs`` and ``core-image-testmaster-initramfs``) now
  195. set an empty string for :term:`IMAGE_NAME_SUFFIX`, which otherwise defaults
  196. to ``".rootfs"``. These images aren't root filesystems and thus the rootfs
  197. label didn't make sense. If you are looking for the output files generated
  198. by these image recipes directly then you will need to adapt to the new
  199. naming without the ``.rootfs`` part.
  200. .. _migration-3.2-image-artifact-names:
  201. Image artifact name variables now centralised in image-artifact-names class
  202. ---------------------------------------------------------------------------
  203. The defaults for the following image artifact name variables have been moved
  204. from ``bitbake.conf`` to a new ``image-artifact-names`` class:
  205. - :term:`IMAGE_BASENAME`
  206. - :term:`IMAGE_LINK_NAME`
  207. - :term:`IMAGE_NAME`
  208. - :term:`IMAGE_NAME_SUFFIX`
  209. - :term:`IMAGE_VERSION_SUFFIX`
  210. Image-related classes now inherit this class, and typically these variables
  211. are only referenced within image recipes so those will be unaffected by this
  212. change. However if you have references to these variables in either a recipe
  213. that is not an image or a class that is enabled globally, then those will
  214. now need to be changed to ``inherit image-artifact-names``.
  215. .. _migration-3.2-misc:
  216. Miscellaneous changes
  217. ---------------------
  218. - Support for the long-deprecated ``PACKAGE_GROUP`` variable has now been removed --- replace any remaining instances with :term:`FEATURE_PACKAGES`.
  219. - The ``FILESPATHPKG`` variable, having been previously deprecated, has now been removed. Replace any remaining references with appropriate use of :term:`FILESEXTRAPATHS`.
  220. - Erroneous use of ``inherit +=`` (instead of ``INHERIT +=``) in a configuration file now triggers an error instead of silently being ignored.
  221. - ptest support has been removed from the ``kbd`` recipe, as upstream has moved to autotest which is difficult to work with in a cross-compilation environment.
  222. - ``oe.utils.is_machine_specific()`` and ``oe.utils.machine_paths()`` have been removed as their utility was questionable. In the unlikely event that you have references to these in your own code, then the code will need to be reworked.
  223. - The ``i2ctransfer`` module is now disabled by default when building ``busybox`` in order to be consistent with disabling the other i2c tools there. If you do wish the i2ctransfer module to be built in BusyBox then add ``CONFIG_I2CTRANSFER=y`` to your custom BusyBox configuration.
  224. - In the ``Upstream-Status`` header convention for patches, ``Accepted`` has been replaced with ``Backport`` as these almost always mean the same thing i.e. the patch is already upstream and may need to be removed in a future recipe upgrade. If you are adding these headers to your own patches then use ``Backport`` to indicate that the patch has been sent upstream.
  225. - The ``tune-supersparc.inc`` tune file has been removed as it does not appear to be widely used and no longer works.