qa-checks.rst 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. *****************************
  3. QA Error and Warning Messages
  4. *****************************
  5. .. _qa-introduction:
  6. Introduction
  7. ============
  8. When building a recipe, the OpenEmbedded build system performs various
  9. QA checks on the output to ensure that common issues are detected and
  10. reported. Sometimes when you create a new recipe to build new software,
  11. it will build with no problems. When this is not the case, or when you
  12. have QA issues building any software, it could take a little time to
  13. resolve them.
  14. While it is tempting to ignore a QA message or even to disable QA
  15. checks, it is best to try and resolve any reported QA issues. This
  16. chapter provides a list of the QA messages and brief explanations of the
  17. issues you could encounter so that you can properly resolve problems.
  18. The next section provides a list of all QA error and warning messages
  19. based on a default configuration. Each entry provides the message or
  20. error form along with an explanation.
  21. .. note::
  22. - At the end of each message, the name of the associated QA test (as
  23. listed in the ":ref:`insane.bbclass <ref-classes-insane>`"
  24. section) appears within square brackets.
  25. - As mentioned, this list of error and warning messages is for QA
  26. checks only. The list does not cover all possible build errors or
  27. warnings you could encounter.
  28. - Because some QA checks are disabled by default, this list does not
  29. include all possible QA check errors and warnings.
  30. .. _qa-errors-and-warnings:
  31. Errors and Warnings
  32. ===================
  33. .. _qa-check-libexec:
  34. - ``<packagename>: <path> is using libexec please relocate to <libexecdir> [libexec]``
  35. The specified package contains files in ``/usr/libexec`` when the
  36. distro configuration uses a different path for ``<libexecdir>`` By
  37. default, ``<libexecdir>`` is ``$prefix/libexec``. However, this
  38. default can be changed (e.g. ``${libdir}``).
  39.  
  40. .. _qa-check-rpaths:
  41. - ``package <packagename> contains bad RPATH <rpath> in file <file> [rpaths]``
  42. The specified binary produced by the recipe contains dynamic library
  43. load paths (rpaths) that contain build system paths such as
  44. :term:`TMPDIR`, which are incorrect for the target and
  45. could potentially be a security issue. Check for bad ``-rpath``
  46. options being passed to the linker in your
  47. :ref:`ref-tasks-compile` log. Depending on the build
  48. system used by the software being built, there might be a configure
  49. option to disable rpath usage completely within the build of the
  50. software.
  51.  
  52. .. _qa-check-useless-rpaths:
  53. - ``<packagename>: <file> contains probably-redundant RPATH <rpath> [useless-rpaths]``
  54. The specified binary produced by the recipe contains dynamic library
  55. load paths (rpaths) that on a standard system are searched by default
  56. by the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths
  57. will not cause any breakage, they do waste space and are unnecessary.
  58. Depending on the build system used by the software being built, there
  59. might be a configure option to disable rpath usage completely within
  60. the build of the software.
  61.  
  62. .. _qa-check-file-rdeps:
  63. - ``<packagename> requires <files>, but no providers in its RDEPENDS [file-rdeps]``
  64. A file-level dependency has been identified from the specified
  65. package on the specified files, but there is no explicit
  66. corresponding entry in :term:`RDEPENDS`. If
  67. particular files are required at runtime then :term:`RDEPENDS` should be
  68. declared in the recipe to ensure the packages providing them are
  69. built.
  70.  
  71. .. _qa-check-build-deps:
  72. - ``<packagename1> rdepends on <packagename2>, but it isn't a build dependency? [build-deps]``
  73. There is a runtime dependency between the two specified packages, but
  74. there is nothing explicit within the recipe to enable the
  75. OpenEmbedded build system to ensure that dependency is satisfied.
  76. This condition is usually triggered by an
  77. :term:`RDEPENDS` value being added at the packaging
  78. stage rather than up front, which is usually automatic based on the
  79. contents of the package. In most cases, you should change the recipe
  80. to add an explicit :term:`RDEPENDS` for the dependency.
  81.  
  82. .. _qa-check-dev-so:
  83. - ``non -dev/-dbg/nativesdk- package contains symlink .so: <packagename> path '<path>' [dev-so]``
  84. Symlink ``.so`` files are for development only, and should therefore
  85. go into the ``-dev`` package. This situation might occur if you add
  86. ``*.so*`` rather than ``*.so.*`` to a non-dev package. Change
  87. :term:`FILES` (and possibly
  88. :term:`PACKAGES`) such that the specified ``.so``
  89. file goes into an appropriate ``-dev`` package.
  90.  
  91. .. _qa-check-staticdev:
  92. - ``non -staticdev package contains static .a library: <packagename> path '<path>' [staticdev]``
  93. Static ``.a`` library files should go into a ``-staticdev`` package.
  94. Change :term:`FILES` (and possibly
  95. :term:`PACKAGES`) such that the specified ``.a`` file
  96. goes into an appropriate ``-staticdev`` package.
  97.  
  98. .. _qa-check-libdir:
  99. - ``<packagename>: found library in wrong location [libdir]``
  100. The specified file may have been installed into an incorrect
  101. (possibly hardcoded) installation path. For example, this test will
  102. catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
  103. "lib32". Another example is when recipes install
  104. ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib". False
  105. positives occasionally exist. For these cases add "libdir" to
  106. :term:`INSANE_SKIP` for the package.
  107.  
  108. .. _qa-check-debug-files:
  109. - ``non debug package contains .debug directory: <packagename> path <path> [debug-files]``
  110. The specified package contains a ``.debug`` directory, which should
  111. not appear in anything but the ``-dbg`` package. This situation might
  112. occur if you add a path which contains a ``.debug`` directory and do
  113. not explicitly add the ``.debug`` directory to the ``-dbg`` package.
  114. If this is the case, add the ``.debug`` directory explicitly to
  115. ``FILES_${PN}-dbg``. See :term:`FILES` for additional
  116. information on :term:`FILES`.
  117.  
  118. .. _qa-check-arch:
  119. - ``Architecture did not match (<file_arch>, expected <machine_arch>) in <file> [arch]``
  120. By default, the OpenEmbedded build system checks the Executable and
  121. Linkable Format (ELF) type, bit size, and endianness of any binaries
  122. to ensure they match the target architecture. This test fails if any
  123. binaries do not match the type since there would be an
  124. incompatibility. The test could indicate that the wrong compiler or
  125. compiler options have been used. Sometimes software, like
  126. bootloaders, might need to bypass this check. If the file you receive
  127. the error for is firmware that is not intended to be executed within
  128. the target operating system or is intended to run on a separate
  129. processor within the device, you can add "arch" to
  130. :term:`INSANE_SKIP` for the package. Another
  131. option is to check the :ref:`ref-tasks-compile` log
  132. and verify that the compiler options being used are correct.
  133.  
  134. - ``Bit size did not match (<file_bits>, expected <machine_bits>) in <file> [arch]``
  135. By default, the OpenEmbedded build system checks the Executable and
  136. Linkable Format (ELF) type, bit size, and endianness of any binaries
  137. to ensure they match the target architecture. This test fails if any
  138. binaries do not match the type since there would be an
  139. incompatibility. The test could indicate that the wrong compiler or
  140. compiler options have been used. Sometimes software, like
  141. bootloaders, might need to bypass this check. If the file you receive
  142. the error for is firmware that is not intended to be executed within
  143. the target operating system or is intended to run on a separate
  144. processor within the device, you can add "arch" to
  145. :term:`INSANE_SKIP` for the package. Another
  146. option is to check the :ref:`ref-tasks-compile` log
  147. and verify that the compiler options being used are correct.
  148.  
  149. - ``Endianness did not match (<file_endianness>, expected <machine_endianness>) in <file> [arch]``
  150. By default, the OpenEmbedded build system checks the Executable and
  151. Linkable Format (ELF) type, bit size, and endianness of any binaries
  152. to ensure they match the target architecture. This test fails if any
  153. binaries do not match the type since there would be an
  154. incompatibility. The test could indicate that the wrong compiler or
  155. compiler options have been used. Sometimes software, like
  156. bootloaders, might need to bypass this check. If the file you receive
  157. the error for is firmware that is not intended to be executed within
  158. the target operating system or is intended to run on a separate
  159. processor within the device, you can add "arch" to
  160. :term:`INSANE_SKIP` for the package. Another
  161. option is to check the :ref:`ref-tasks-compile` log
  162. and verify that the compiler options being used are correct.
  163.  
  164. .. _qa-check-textrel:
  165. - ``ELF binary '<file>' has relocations in .text [textrel]``
  166. The specified ELF binary contains relocations in its ``.text``
  167. sections. This situation can result in a performance impact at
  168. runtime.
  169. Typically, the way to solve this performance issue is to add "-fPIC"
  170. or "-fpic" to the compiler command-line options. For example, given
  171. software that reads :term:`CFLAGS` when you build it,
  172. you could add the following to your recipe::
  173. CFLAGS_append = " -fPIC "
  174. For more information on text relocations at runtime, see
  175. https://www.akkadia.org/drepper/textrelocs.html.
  176.  
  177. .. _qa-check-ldflags:
  178. - ``File '<file>' in package '<package>' doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]``
  179. This indicates that binaries produced when building the recipe have
  180. not been linked with the :term:`LDFLAGS` options
  181. provided by the build system. Check to be sure that the :term:`LDFLAGS`
  182. variable is being passed to the linker command. A common workaround
  183. for this situation is to pass in :term:`LDFLAGS` using
  184. :term:`TARGET_CC_ARCH` within the recipe as
  185. follows::
  186. TARGET_CC_ARCH += "${LDFLAGS}"
  187.  
  188. .. _qa-check-xorg-driver-abi:
  189. - ``Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi]``
  190. The specified package contains an Xorg driver, but does not have a
  191. corresponding ABI package dependency. The xserver-xorg recipe
  192. provides driver ABI names. All drivers should depend on the ABI
  193. versions that they have been built against. Driver recipes that
  194. include ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
  195. automatically get these versions. Consequently, you should only need
  196. to explicitly add dependencies to binary driver recipes.
  197.  
  198. .. _qa-check-infodir:
  199. - ``The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]``
  200. The ``/usr/share/info/dir`` should not be packaged. Add the following
  201. line to your :ref:`ref-tasks-install` task or to your
  202. ``do_install_append`` within the recipe as follows::
  203. rm ${D}${infodir}/dir
  204.  
  205. .. _qa-check-symlink-to-sysroot:
  206. - ``Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot]``
  207. The specified symlink points into :term:`TMPDIR` on the
  208. host. Such symlinks will work on the host. However, they are clearly
  209. invalid when running on the target. You should either correct the
  210. symlink to use a relative path or remove the symlink.
  211.  
  212. .. _qa-check-la:
  213. - ``<file> failed sanity test (workdir) in path <path> [la]``
  214. The specified ``.la`` file contains :term:`TMPDIR`
  215. paths. Any ``.la`` file containing these paths is incorrect since
  216. ``libtool`` adds the correct sysroot prefix when using the files
  217. automatically itself.
  218.  
  219. .. _qa-check-pkgconfig:
  220. - ``<file> failed sanity test (tmpdir) in path <path> [pkgconfig]``
  221. The specified ``.pc`` file contains
  222. :term:`TMPDIR`\ ``/``\ :term:`WORKDIR`
  223. paths. Any ``.pc`` file containing these paths is incorrect since
  224. ``pkg-config`` itself adds the correct sysroot prefix when the files
  225. are accessed.
  226.  
  227. .. _qa-check-debug-deps:
  228. - ``<packagename> rdepends on <debug_packagename> [debug-deps]``
  229. There is a dependency between the specified non-dbg package (i.e. a
  230. package whose name does not end in ``-dbg``) and a package that is a
  231. ``dbg`` package. The ``dbg`` packages contain debug symbols and are
  232. brought in using several different methods:
  233. - Using the ``dbg-pkgs``
  234. :term:`IMAGE_FEATURES` value.
  235. - Using :term:`IMAGE_INSTALL`.
  236. - As a dependency of another ``dbg`` package that was brought in
  237. using one of the above methods.
  238. The dependency might have been automatically added because the
  239. ``dbg`` package erroneously contains files that it should not contain
  240. (e.g. a non-symlink ``.so`` file) or it might have been added
  241. manually (e.g. by adding to :term:`RDEPENDS`).
  242.  
  243. .. _qa-check-dev-deps:
  244. - ``<packagename> rdepends on <dev_packagename> [dev-deps]``
  245. There is a dependency between the specified non-dev package (a package
  246. whose name does not end in ``-dev``) and a package that is a ``dev``
  247. package. The ``dev`` packages contain development headers and are
  248. usually brought in using several different methods:
  249. - Using the ``dev-pkgs``
  250. :term:`IMAGE_FEATURES` value.
  251. - Using :term:`IMAGE_INSTALL`.
  252. - As a dependency of another ``dev`` package that was brought in
  253. using one of the above methods.
  254. The dependency might have been automatically added (because the
  255. ``dev`` package erroneously contains files that it should not have
  256. (e.g. a non-symlink ``.so`` file) or it might have been added
  257. manually (e.g. by adding to :term:`RDEPENDS`).
  258.  
  259. .. _qa-check-dep-cmp:
  260. - ``<var>_<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp]``
  261. If you are adding a versioned dependency relationship to one of the
  262. dependency variables (:term:`RDEPENDS`,
  263. :term:`RRECOMMENDS`,
  264. :term:`RSUGGESTS`,
  265. :term:`RPROVIDES`,
  266. :term:`RREPLACES`, or
  267. :term:`RCONFLICTS`), you must only use the named
  268. comparison operators. Change the versioned dependency values you are
  269. adding to match those listed in the message.
  270.  
  271. .. _qa-check-compile-host-path:
  272. - ``<recipename>: The compile log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [compile-host-path]``
  273. The log for the :ref:`ref-tasks-compile` task
  274. indicates that paths on the host were searched for files, which is
  275. not appropriate when cross-compiling. Look for "is unsafe for
  276. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  277. file.
  278.  
  279. .. _qa-check-install-host-path:
  280. - ``<recipename>: The install log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [install-host-path]``
  281. The log for the :ref:`ref-tasks-install` task
  282. indicates that paths on the host were searched for files, which is
  283. not appropriate when cross-compiling. Look for "is unsafe for
  284. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  285. file.
  286.  
  287. .. _qa-check-configure-unsafe:
  288. - ``This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this. [configure-unsafe]``
  289. The log for the :ref:`ref-tasks-configure` task
  290. indicates that paths on the host were searched for files, which is
  291. not appropriate when cross-compiling. Look for "is unsafe for
  292. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  293. file.
  294.  
  295. .. _qa-check-pkgname:
  296. - ``<packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname]``
  297. The convention within the OpenEmbedded build system (sometimes
  298. enforced by the package manager itself) is to require that package
  299. names are all lower case and to allow a restricted set of characters.
  300. If your recipe name does not match this, or you add packages to
  301. :term:`PACKAGES` that do not conform to the
  302. convention, then you will receive this error. Rename your recipe. Or,
  303. if you have added a non-conforming package name to :term:`PACKAGES`,
  304. change the package name appropriately.
  305.  
  306. .. _qa-check-unknown-configure-option:
  307. - ``<recipe>: configure was passed unrecognized options: <options> [unknown-configure-option]``
  308. The configure script is reporting that the specified options are
  309. unrecognized. This situation could be because the options were
  310. previously valid but have been removed from the configure script. Or,
  311. there was a mistake when the options were added and there is another
  312. option that should be used instead. If you are unsure, consult the
  313. upstream build documentation, the ``./configure --help`` output, and
  314. the upstream change log or release notes. Once you have worked out
  315. what the appropriate change is, you can update
  316. :term:`EXTRA_OECONF`,
  317. :term:`PACKAGECONFIG_CONFARGS`, or the
  318. individual :term:`PACKAGECONFIG` option values
  319. accordingly.
  320.  
  321. .. _qa-check-pn-overrides:
  322. - ``Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]``
  323. The specified recipe has a name (:term:`PN`) value that
  324. appears in :term:`OVERRIDES`. If a recipe is named
  325. such that its :term:`PN` value matches something already in :term:`OVERRIDES`
  326. (e.g. :term:`PN` happens to be the same as :term:`MACHINE`
  327. or :term:`DISTRO`), it can have unexpected
  328. consequences. For example, assignments such as
  329. ``FILES_${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``.
  330. Rename your recipe (or if :term:`PN` is being set explicitly, change the
  331. :term:`PN` value) so that the conflict does not occur. See
  332. :term:`FILES` for additional information.
  333.  
  334. .. _qa-check-pkgvarcheck:
  335. - ``<recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck]``
  336. Certain variables (:term:`RDEPENDS`,
  337. :term:`RRECOMMENDS`,
  338. :term:`RSUGGESTS`,
  339. :term:`RCONFLICTS`,
  340. :term:`RPROVIDES`,
  341. :term:`RREPLACES`, :term:`FILES`,
  342. ``pkg_preinst``, ``pkg_postinst``, ``pkg_prerm``, ``pkg_postrm``, and
  343. :term:`ALLOW_EMPTY`) should always be set specific
  344. to a package (i.e. they should be set with a package name override
  345. such as ``RDEPENDS_${PN} = "value"`` rather than
  346. ``RDEPENDS = "value"``). If you receive this error, correct any
  347. assignments to these variables within your recipe.
  348. - ``recipe uses DEPENDS_${PN}, should use DEPENDS [pkgvarcheck]``
  349. This check looks for instances of setting ``DEPENDS_${PN}``
  350. which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus
  351. it is not correct to specify it for a particular package, nor will such
  352. an assignment actually work.) Set :term:`DEPENDS` instead.
  353. .. _qa-check-already-stripped:
  354. - ``File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped]``
  355. Produced binaries have already been stripped prior to the build
  356. system extracting debug symbols. It is common for upstream software
  357. projects to default to stripping debug symbols for output binaries.
  358. In order for debugging to work on the target using ``-dbg`` packages,
  359. this stripping must be disabled.
  360. Depending on the build system used by the software being built,
  361. disabling this stripping could be as easy as specifying an additional
  362. configure option. If not, disabling stripping might involve patching
  363. the build scripts. In the latter case, look for references to "strip"
  364. or "STRIP", or the "-s" or "-S" command-line options being specified
  365. on the linker command line (possibly through the compiler command
  366. line if preceded with "-Wl,").
  367. .. note::
  368. Disabling stripping here does not mean that the final packaged
  369. binaries will be unstripped. Once the OpenEmbedded build system
  370. splits out debug symbols to the ``-dbg`` package, it will then
  371. strip the symbols from the binaries.
  372.  
  373. .. _qa-check-packages-list:
  374. - ``<packagename> is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]``
  375. Package names must appear only once in the
  376. :term:`PACKAGES` variable. You might receive this
  377. error if you are attempting to add a package to :term:`PACKAGES` that is
  378. already in the variable's value.
  379.  
  380. .. _qa-check-files-invalid:
  381. - ``FILES variable for package <packagename> contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid]``
  382. The string "//" is invalid in a Unix path. Correct all occurrences
  383. where this string appears in a :term:`FILES` variable so
  384. that there is only a single "/".
  385.  
  386. .. _qa-check-installed-vs-shipped:
  387. - ``<recipename>: Files/directories were installed but not shipped in any package [installed-vs-shipped]``
  388. Files have been installed within the
  389. :ref:`ref-tasks-install` task but have not been
  390. included in any package by way of the :term:`FILES`
  391. variable. Files that do not appear in any package cannot be present
  392. in an image later on in the build process. You need to do one of the
  393. following:
  394. - Add the files to :term:`FILES` for the package you want them to appear
  395. in (e.g. ``FILES_${``\ :term:`PN`\ ``}`` for the main
  396. package).
  397. - Delete the files at the end of the ``do_install`` task if the
  398. files are not needed in any package.
  399.  
  400. - ``<oldpackage>-<oldpkgversion> was registered as shlib provider for <library>, changing it to <newpackage>-<newpkgversion> because it was built later``
  401. This message means that both ``<oldpackage>`` and ``<newpackage>``
  402. provide the specified shared library. You can expect this message
  403. when a recipe has been renamed. However, if that is not the case, the
  404. message might indicate that a private version of a library is being
  405. erroneously picked up as the provider for a common library. If that
  406. is the case, you should add the library's ``.so`` file name to
  407. :term:`PRIVATE_LIBS` in the recipe that provides
  408. the private version of the library.
  409. .. _qa-check-unlisted-pkg-lics:
  410. - ``LICENSE_<packagename> includes licenses (<licenses>) that are not listed in LICENSE [unlisted-pkg-lics]``
  411. The :term:`LICENSE` of the recipe should be a superset
  412. of all the licenses of all packages produced by this recipe. In other
  413. words, any license in ``LICENSE_*`` should also appear in
  414. :term:`LICENSE`.
  415. .. _qa-check-configure-gettext:
  416. - ``AM_GNU_GETTEXT used but no inherit gettext [configure-gettext]``
  417. If a recipe is building something that uses automake and the automake
  418. files contain an ``AM_GNU_GETTEXT`` directive then this check will fail
  419. if there is no ``inherit gettext`` statement in the recipe to ensure
  420. that gettext is available during the build. Add ``inherit gettext`` to
  421. remove the warning.
  422. .. _qa-check-mime:
  423. - ``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]``
  424. The specified package contains mime type files (``.xml`` files in
  425. ``${datadir}/mime/packages``) and yet does not inherit the mime
  426. class which will ensure that these get properly installed. Either
  427. add ``inherit mime`` to the recipe or remove the files at the
  428. ``do_install`` step if they are not needed.
  429. .. _qa-check-mime-xdg:
  430. - ``package contains desktop file with key 'MimeType' but does not inhert mime-xdg: <packagename> path '<file>' [mime-xdg]``
  431. The specified package contains a .desktop file with a 'MimeType' key
  432. present, but does not inherit the mime-xdg class that is required in
  433. order for that to be activated. Either add ``inherit mime`` to the
  434. recipe or remove the files at the ``do_install`` step if they are not
  435. needed.
  436. .. _qa-check-src-uri-bad:
  437. - ``<recipename>: SRC_URI uses unstable GitHub archives [src-uri-bad]``
  438. GitHub provides "archive" tarballs, however these can be re-generated
  439. on the fly and thus the file's signature will not necessarily match that
  440. in the SRC_URI checksums in future leading to build failures. It is
  441. recommended that you use an official release tarball or switch to
  442. pulling the corresponding revision in the actual git repository instead.
  443. - ``SRC_URI uses PN not BPN [src-uri-bad]``
  444. If some part of :term:`SRC_URI` needs to reference the recipe name, it should do
  445. so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change
  446. for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND`
  447. or multilib are being used. This check will fail if a reference to ``${PN}``
  448. is found within the :term:`SRC_URI` value - change it to ``${BPN}`` instead.
  449. .. _qa-check-unhandled-features-check:
  450. - ``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]``
  451. This check ensures that if one of the variables that the :ref:`features_check <ref-classes-features_check>`
  452. class supports (e.g. :term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe
  453. inherits ``features_check`` in order for the requirement to actually work. If
  454. you are seeing this message, either add ``inherit features_check`` to your recipe
  455. or remove the reference to the variable if it is not needed.
  456. .. _qa-check-missing-update-alternatives:
  457. - ``<recipename>: recipe defines ALTERNATIVE_<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]``
  458. This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the
  459. recipe also inherits :ref:`update-alternatives <ref-classes-update-alternatives>` such
  460. that the alternative will be correctly set up. If you are seeing this message, either
  461. add ``inherit update-alternatives`` to your recipe or remove the reference to the variable
  462. if it is not needed.
  463. .. _qa-check-shebang-size:
  464. - ``<packagename>: <file> maximum shebang size exceeded, the maximum size is 128. [shebang-size]``
  465. This check ensures that the shebang line (``#!`` in the first line) for a script
  466. is not longer than 128 characters, which can cause an error at runtime depending
  467. on the operating system. If you are seeing this message then the specified script
  468. may need to be patched to have a shorter in order to avoid runtime problems.
  469. .. _qa-check-perllocalpod:
  470. - ``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]``
  471. ``perllocal.pod`` is an index file of locally installed modules and so shouldn't be
  472. installed by any distribution packages. The :ref:`cpan <ref-classes-cpan>` class
  473. already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes,
  474. but if a recipe is using ``MakeMaker`` directly then they might not be doing this
  475. correctly. This check ensures that perllocal.pod is not in any package in order to
  476. avoid multiple packages shipping this file and thus their packages conflicting
  477. if installed together.
  478. .. _qa-check-usrmerge:
  479. - ``<packagename> package is not obeying usrmerge distro feature. /<path> should be relocated to /usr. [usrmerge]``
  480. If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package
  481. installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this
  482. message, it indicates that the ``do_install`` step (or perhaps the build process that
  483. ``do_install`` is calling into, e.g. ``make install`` is using hardcoded paths instead
  484. of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be
  485. changed so that it does.
  486. .. _qa-check-patch-fuzz:
  487. - ``Fuzz detected: <patch output> [patch-fuzz]``
  488. This check looks for evidence of "fuzz" when applying patches within the ``do_patch``
  489. task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context
  490. lines in order to apply the patch. Consider this example:
  491. Patch to be applied::
  492. --- filename
  493. +++ filename
  494. context line 1
  495. context line 2
  496. context line 3
  497. +newly added line
  498. context line 4
  499. context line 5
  500. context line 6
  501. Original source code::
  502. different context line 1
  503. different context line 2
  504. context line 3
  505. context line 4
  506. different context line 5
  507. different context line 6
  508. Outcome (after applying patch with fuzz)::
  509. different context line 1
  510. different context line 2
  511. context line 3
  512. newly added line
  513. context line 4
  514. different context line 5
  515. different context line 6
  516. Chances are, the newly added line was actually added in a completely
  517. wrong location, or it was already in the original source and was added
  518. for the second time. This is especially possible if the context line 3
  519. and 4 are blank or have only generic things in them, such as ``#endif`` or ``}``.
  520. Depending on the patched code, it is entirely possible for an incorrectly
  521. patched file to still compile without errors.
  522. *How to eliminate patch fuzz warnings*
  523. Use the ``devtool`` command as explained by the warning. First, unpack the
  524. source into devtool workspace::
  525. devtool modify <recipe>
  526. This will apply all of the patches, and create new commits out of them in
  527. the workspace - with the patch context updated.
  528. Then, replace the patches in the recipe layer::
  529. devtool finish --force-patch-refresh <recipe> <layer_path>
  530. The patch updates then need be reviewed (preferably with a side-by-side diff
  531. tool) to ensure they are indeed doing the right thing i.e.:
  532. #. they are applied in the correct location within the file;
  533. #. they do not introduce duplicate lines, or otherwise do things that
  534. are no longer necessary.
  535. To confirm these things, you can also review the patched source code in
  536. devtool's workspace, typically in ``<build_dir>/workspace/sources/<recipe>/``
  537. Once the review is done, you can create and publish a layer commit with
  538. the patch updates that modify the context. Devtool may also refresh
  539. other things in the patches, those can be discarded.
  540. Configuring and Disabling QA Checks
  541. ===================================
  542. You can configure the QA checks globally so that specific check failures
  543. either raise a warning or an error message, using the
  544. :term:`WARN_QA` and :term:`ERROR_QA`
  545. variables, respectively. You can also disable checks within a particular
  546. recipe using :term:`INSANE_SKIP`. For information on
  547. how to work with the QA checks, see the
  548. ":ref:`insane.bbclass <ref-classes-insane>`" section.
  549. .. note::
  550. Please keep in mind that the QA checks are meant to detect real
  551. or potential problems in the packaged output. So exercise caution
  552. when disabling these checks.