migration-4.0.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Release 4.0 (kirkstone)
  3. =======================
  4. Migration notes for 4.0 (kirkstone)
  5. -----------------------------------
  6. This section provides migration information for moving to the Yocto
  7. Project 4.0 Release (codename "kirkstone") from the prior release.
  8. .. _migration-4.0-inclusive-language:
  9. Inclusive language improvements
  10. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. To use more `inclusive language <https://inclusivenaming.org/>`__
  12. in the code and documentation, some variables have been renamed, and
  13. some have been deleted where they are no longer needed. In many cases the
  14. new names are also easier to understand. BitBake will stop with an error when
  15. renamed or removed variables still exist in your recipes or configuration.
  16. Please note that the change applies also to environmental variables, so
  17. make sure you use a fresh environment for your build.
  18. The following variables have changed their names:
  19. - ``BB_ENV_WHITELIST`` became :term:`BB_ENV_PASSTHROUGH`
  20. - ``BB_ENV_EXTRAWHITE`` became :term:`BB_ENV_PASSTHROUGH_ADDITIONS`
  21. - ``BB_HASHBASE_WHITELIST`` became :term:`BB_BASEHASH_IGNORE_VARS`
  22. - ``BB_HASHCONFIG_WHITELIST`` became :term:`BB_HASHCONFIG_IGNORE_VARS`
  23. - ``BB_HASHTASK_WHITELIST`` became ``BB_TASKHASH_IGNORE_TASKS``
  24. - ``BB_SETSCENE_ENFORCE_WHITELIST`` became ``BB_SETSCENE_ENFORCE_IGNORE_TASKS``
  25. - ``CVE_CHECK_PN_WHITELIST`` became :term:`CVE_CHECK_SKIP_RECIPE`
  26. - ``CVE_CHECK_WHITELIST`` became :term:`CVE_CHECK_IGNORE`
  27. - ``ICECC_USER_CLASS_BL`` became :term:`ICECC_CLASS_DISABLE`
  28. - ``ICECC_SYSTEM_CLASS_BL`` became :term:`ICECC_CLASS_DISABLE`
  29. - ``ICECC_USER_PACKAGE_WL`` became :term:`ICECC_RECIPE_ENABLE`
  30. - ``ICECC_USER_PACKAGE_BL`` became :term:`ICECC_RECIPE_DISABLE`
  31. - ``ICECC_SYSTEM_PACKAGE_BL`` became :term:`ICECC_RECIPE_DISABLE`
  32. - ``LICENSE_FLAGS_WHITELIST`` became :term:`LICENSE_FLAGS_ACCEPTED`
  33. - ``MULTI_PROVIDER_WHITELIST`` became :term:`BB_MULTI_PROVIDER_ALLOWED`
  34. - ``PNBLACKLIST`` became :term:`SKIP_RECIPE`
  35. - ``SDK_LOCAL_CONF_BLACKLIST`` became :term:`ESDK_LOCALCONF_REMOVE`
  36. - ``SDK_LOCAL_CONF_WHITELIST`` became :term:`ESDK_LOCALCONF_ALLOW`
  37. - ``SDK_INHERIT_BLACKLIST`` became :term:`ESDK_CLASS_INHERIT_DISABLE`
  38. - ``SSTATE_DUPWHITELIST`` became ``SSTATE_ALLOW_OVERLAP_FILES``
  39. - ``SYSROOT_DIRS_BLACKLIST`` became :term:`SYSROOT_DIRS_IGNORE`
  40. - ``UNKNOWN_CONFIGURE_WHITELIST`` became :term:`UNKNOWN_CONFIGURE_OPT_IGNORE`
  41. - ``WHITELIST_<license>`` became :term:`INCOMPATIBLE_LICENSE_EXCEPTIONS`
  42. In addition, ``BB_STAMP_WHITELIST``, ``BB_STAMP_POLICY``, ``INHERIT_BLACKLIST``,
  43. ``TUNEABI``, ``TUNEABI_WHITELIST``, and ``TUNEABI_OVERRIDE`` have been removed.
  44. Many internal variable names have been also renamed accordingly.
  45. In addition, in the ``cve-check`` output, the CVE issue status ``Whitelisted``
  46. has been renamed to ``Ignored``.
  47. The :term:`BB_DISKMON_DIRS` variable value now uses the term ``HALT``
  48. instead of ``ABORT``.
  49. A :oe_git:`convert-variable-renames.py
  50. </openembedded-core/tree/scripts/contrib/convert-variable-renames.py>`
  51. script is provided to convert your recipes and configuration,
  52. and also warns you about the use of problematic words. The script performs
  53. changes and you need to review them before committing. An example warning
  54. looks like::
  55. poky/scripts/lib/devtool/upgrade.py needs further work at line 275 since it contains abort
  56. Fetching changes
  57. ~~~~~~~~~~~~~~~~
  58. - Because of the uncertainty in future default branch names in git repositories,
  59. it is now required to add a branch name to all URLs described
  60. by ``git://`` and ``gitsm://`` :term:`SRC_URI` entries. For example::
  61. SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
  62. A :oe_git:`convert-srcuri </openembedded-core/tree/scripts/contrib/convert-srcuri.py>`
  63. script to convert your recipes is available in :term:`OpenEmbedded-Core (OE-Core)`
  64. and in :term:`Poky`.
  65. - Because of `GitHub dropping support for the git:
  66. protocol <https://github.blog/2021-09-01-improving-git-protocol-security-github/>`__,
  67. recipes now need to use ``;protocol=https`` at the end of GitHub
  68. URLs. The same ``convert-srcuri`` script mentioned above can be used to convert
  69. your recipes.
  70. - Network access from tasks is now disabled by default on kernels which support
  71. this feature (on most recent distros such as CentOS 8 and Debian 11 onwards).
  72. This means that tasks accessing the network need to be marked as such with the ``network``
  73. flag. For example::
  74. do_mytask[network] = "1"
  75. This is allowed by default from :ref:`ref-tasks-fetch` but not from any of our other standard
  76. tasks. Recipes shouldn't be accessing the network outside of :ref:`ref-tasks-fetch` as it
  77. usually undermines fetcher source mirroring, image and licence manifests, software
  78. auditing and supply chain security.
  79. License changes
  80. ~~~~~~~~~~~~~~~
  81. - The ambiguous "BSD" license has been removed from the ``common-licenses`` directory.
  82. Each recipe that fetches or builds BSD-licensed code should specify the proper
  83. version of the BSD license in its :term:`LICENSE` value.
  84. - :term:`LICENSE` variable values should now use `SPDX identifiers <https://spdx.org/licenses/>`__.
  85. If they do not, by default a warning will be shown. A
  86. :oe_git:`convert-spdx-licenses.py </openembedded-core/tree/scripts/contrib/convert-spdx-licenses.py>`
  87. script can be used to update your recipes.
  88. - :term:`INCOMPATIBLE_LICENSE` should now use `SPDX identifiers <https://spdx.org/licenses/>`__.
  89. Additionally, wildcarding is now limited to specifically supported values -
  90. see the :term:`INCOMPATIBLE_LICENSE` documentation for further information.
  91. - The ``AVAILABLE_LICENSES`` variable has been removed. This variable was a performance
  92. liability and is highly dependent on which layers are added to the configuration,
  93. which can cause signature issues for users. In addition the ``available_licenses()``
  94. function has been removed from the :ref:`ref-classes-license` class as
  95. it is no longer needed.
  96. Removed recipes
  97. ~~~~~~~~~~~~~~~
  98. The following recipes have been removed in this release:
  99. - ``dbus-test``: merged into main dbus recipe
  100. - ``libid3tag``: moved to meta-oe - no longer needed by anything in OE-Core
  101. - ``libportal``: moved to meta-gnome - no longer needed by anything in OE-Core
  102. - ``linux-yocto``: removed version 5.14 recipes (5.15 and 5.10 still provided)
  103. - ``python3-nose``: has not changed since 2016 upstream, and no longer needed by anything in OE-Core
  104. - ``rustfmt``: not especially useful as a standalone recipe
  105. Python changes
  106. ~~~~~~~~~~~~~~
  107. - ``distutils`` has been deprecated upstream in Python 3.10 and thus the ``distutils*``
  108. classes have been moved to ``meta-python``. Recipes that inherit the ``distutils*``
  109. classes should be updated to inherit ``setuptools*`` equivalents instead.
  110. - The Python package build process is now based on `wheels <https://pythonwheels.com/>`__.
  111. The new Python packaging classes that should be used are
  112. :ref:`ref-classes-python_flit_core`, :ref:`ref-classes-python_setuptools_build_meta`
  113. and :ref:`ref-classes-python_poetry_core`.
  114. - The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-install` task now
  115. installs the ``wheel`` binary archive. In current versions of ``setuptools`` the
  116. legacy ``setup.py install`` method is deprecated. If the ``setup.py`` cannot be used
  117. with wheels, for example it creates files outside of the Python module or standard
  118. entry points, then :ref:`ref-classes-setuptools3_legacy` should
  119. be used instead.
  120. Prelink removed
  121. ~~~~~~~~~~~~~~~
  122. Prelink has been dropped by ``glibc`` upstream in 2.36. It already caused issues with
  123. binary corruption, has a number of open bugs and is of questionable benefit
  124. without disabling load address randomization and PIE executables.
  125. We disabled prelinking by default in the honister (3.4) release, but left it able
  126. to be enabled if desired. However, without glibc support it cannot be maintained
  127. any further, so all of the prelinking functionality has been removed in this release.
  128. If you were enabling the ``image-prelink`` class in :term:`INHERIT`, :term:`IMAGE_CLASSES`,
  129. :term:`USER_CLASSES` etc in your configuration, then you will need to remove the
  130. reference(s).
  131. Reproducible as standard
  132. ~~~~~~~~~~~~~~~~~~~~~~~~
  133. Reproducibility is now considered as standard functionality, thus the
  134. ``reproducible`` class has been removed and its previous contents merged into the
  135. :ref:`ref-classes-base` class. If you have references in your configuration to
  136. ``reproducible`` in :term:`INHERIT`, :term:`USER_CLASSES` etc. then they should be
  137. removed.
  138. Additionally, the ``BUILD_REPRODUCIBLE_BINARIES`` variable is no longer used.
  139. Specifically for the kernel, if you wish to enable build timestamping functionality
  140. that is normally disabled for reproducibility reasons, you can do so by setting
  141. a new :term:`KERNEL_DEBUG_TIMESTAMPS` variable to "1".
  142. Supported host distribution changes
  143. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. - Support for :wikipedia:`AlmaLinux <AlmaLinux>`
  145. hosts replacing :wikipedia:`CentOS <CentOS>`.
  146. The following distribution versions were dropped: CentOS 8, Ubuntu 16.04 and Fedora 30, 31 and 32.
  147. - ``gcc`` version 7.5 is now required at minimum on the build host. For older
  148. host distributions where this is not available, you can use the
  149. :term:`buildtools-extended` tarball (easily installable using
  150. ``scripts/install-buildtools``).
  151. :append/:prepend in combination with other operators
  152. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153. The ``append``, ``prepend`` and ``remove`` operators can now only be combined with
  154. ``=`` and ``:=`` operators. To the exception of the ``append`` plus ``+=`` and
  155. ``prepend`` plus ``=+`` combinations, all combinations could be factored up to the
  156. ``append``, ``prepend`` or ``remove`` in the combination. This brought a lot of
  157. confusion on how the override style syntax operators work and should be used.
  158. Therefore, those combinations should be replaced by a single ``append``,
  159. ``prepend`` or ``remove`` operator without any additional change.
  160. For the ``append`` plus ``+=`` (and ``prepend`` plus ``=+``) combinations,
  161. the content should be prefixed (respectively suffixed) by a space to maintain
  162. the same behavior. You can learn more about override style syntax operators
  163. (``append``, ``prepend`` and ``remove``) in the BitBake documentation:
  164. :ref:`bitbake-user-manual/bitbake-user-manual-metadata:appending and prepending (override style syntax)`
  165. and :ref:`bitbake-user-manual/bitbake-user-manual-metadata:removal (override style syntax)`.
  166. Miscellaneous changes
  167. ~~~~~~~~~~~~~~~~~~~~~
  168. - ``blacklist.bbclass`` is removed and the functionality moved to the
  169. :ref:`ref-classes-base` class with a more descriptive
  170. ``varflag`` variable named :term:`SKIP_RECIPE` which will use the `bb.parse.SkipRecipe()`
  171. function. The usage remains the same, for example::
  172. SKIP_RECIPE[my-recipe] = "Reason for skipping recipe"
  173. - :ref:`ref-classes-allarch` packagegroups can no longer depend on packages
  174. which use :term:`PKG` renaming such as :ref:`ref-classes-debian`. Such packagegroups
  175. recipes should be changed to avoid inheriting :ref:`ref-classes-allarch`.
  176. - The ``lnr`` script has been removed. ``lnr`` implemented the same behaviour as `ln --relative --symbolic`,
  177. since at the time of creation `--relative` was only available in coreutils 8.16
  178. onwards which was too new for the older supported distros. Current supported host
  179. distros have a new enough version of coreutils, so it is no longer needed. If you have
  180. any calls to ``lnr`` in your recipes or classes, they should be replaced with
  181. `ln --relative --symbolic` or `ln -rs` if you prefer the short version.
  182. - The ``package_qa_handle_error()`` function formerly in the :ref:`ref-classes-insane`
  183. class has been moved and renamed - if you have any references in your own custom
  184. classes they should be changed to ``oe.qa.handle_error()``.
  185. - When building ``perl``, Berkeley db support is no longer enabled by default, since
  186. Berkeley db is largely obsolete. If you wish to reenable it, you can append ``bdb``
  187. to :term:`PACKAGECONFIG` in a ``perl`` bbappend or ``PACKAGECONFIG:pn-perl`` at
  188. the configuration level.
  189. - For the ``xserver-xorg`` recipe, the ``xshmfence``, ``xmlto`` and ``systemd`` options
  190. previously supported in :term:`PACKAGECONFIG` have been removed, as they are no
  191. longer supported since the move from building it with autotools to meson in this release.
  192. - For the ``libsdl2`` recipe, various X11 features are now disabled by default (primarily
  193. for reproducibility purposes in the native case) with options in :term:`EXTRA_OECMAKE`
  194. within the recipe. These can be changed within a bbappend if desired. See the
  195. ``libsdl2`` recipe for more details.
  196. - The ``cortexa72-crc`` and ``cortexa72-crc-crypto`` tunes have been removed since
  197. the crc extension is now enabled by default for cortexa72. Replace any references to
  198. these with ``cortexa72`` and ``cortexa72-crypto`` respectively.
  199. - The Python development shell (previously known as ``devpyshell``) feature has been
  200. renamed to ``pydevshell``. To start it you should now run::
  201. bitbake <target> -c pydevshell
  202. - The ``packagegroups-core-full-cmdline-libs`` packagegroup is no longer produced, as
  203. libraries should normally be brought in via dependencies. If you have any references
  204. to this then remove them.
  205. - The :term:`TOPDIR` variable and the current working directory are no longer modified
  206. when parsing recipes. Any code depending on the previous behaviour will no longer
  207. work - change any such code to explicitly use appropriate path variables instead.
  208. - In order to exclude the kernel image from the image rootfs,
  209. :term:`RRECOMMENDS`\ ``:${KERNEL_PACKAGE_NAME}-base`` should be set instead of
  210. :term:`RDEPENDS`\ ``:${KERNEL_PACKAGE_NAME}-base``.