qa-checks.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  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:`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. .. _qa-check-empty-dirs:
  118. - ``<packagename> installs files in <path>, but it is expected to be empty [empty-dirs]``
  119. The specified package is installing files into a directory that is
  120. normally expected to be empty (such as ``/tmp``). These files may
  121. be more appropriately installed to a different location, or
  122. perhaps alternatively not installed at all, usually by updating the
  123. :ref:`ref-tasks-install` task/function.
  124. .. _qa-check-arch:
  125. - ``Architecture did not match (<file_arch>, expected <machine_arch>) in <file> [arch]``
  126. By default, the OpenEmbedded build system checks the Executable and
  127. Linkable Format (ELF) type, bit size, and endianness of any binaries
  128. to ensure they match the target architecture. This test fails if any
  129. binaries do not match the type since there would be an
  130. incompatibility. The test could indicate that the wrong compiler or
  131. compiler options have been used. Sometimes software, like
  132. bootloaders, might need to bypass this check. If the file you receive
  133. the error for is firmware that is not intended to be executed within
  134. the target operating system or is intended to run on a separate
  135. processor within the device, you can add "arch" to
  136. :term:`INSANE_SKIP` for the package. Another
  137. option is to check the :ref:`ref-tasks-compile` log
  138. and verify that the compiler options being used are correct.
  139.  
  140. - ``Bit size did not match (<file_bits>, expected <machine_bits>) in <file> [arch]``
  141. By default, the OpenEmbedded build system checks the Executable and
  142. Linkable Format (ELF) type, bit size, and endianness of any binaries
  143. to ensure they match the target architecture. This test fails if any
  144. binaries do not match the type since there would be an
  145. incompatibility. The test could indicate that the wrong compiler or
  146. compiler options have been used. Sometimes software, like
  147. bootloaders, might need to bypass this check. If the file you receive
  148. the error for is firmware that is not intended to be executed within
  149. the target operating system or is intended to run on a separate
  150. processor within the device, you can add "arch" to
  151. :term:`INSANE_SKIP` for the package. Another
  152. option is to check the :ref:`ref-tasks-compile` log
  153. and verify that the compiler options being used are correct.
  154.  
  155. - ``Endianness did not match (<file_endianness>, expected <machine_endianness>) in <file> [arch]``
  156. By default, the OpenEmbedded build system checks the Executable and
  157. Linkable Format (ELF) type, bit size, and endianness of any binaries
  158. to ensure they match the target architecture. This test fails if any
  159. binaries do not match the type since there would be an
  160. incompatibility. The test could indicate that the wrong compiler or
  161. compiler options have been used. Sometimes software, like
  162. bootloaders, might need to bypass this check. If the file you receive
  163. the error for is firmware that is not intended to be executed within
  164. the target operating system or is intended to run on a separate
  165. processor within the device, you can add "arch" to
  166. :term:`INSANE_SKIP` for the package. Another
  167. option is to check the :ref:`ref-tasks-compile` log
  168. and verify that the compiler options being used are correct.
  169.  
  170. .. _qa-check-textrel:
  171. - ``ELF binary '<file>' has relocations in .text [textrel]``
  172. The specified ELF binary contains relocations in its ``.text``
  173. sections. This situation can result in a performance impact at
  174. runtime.
  175. Typically, the way to solve this performance issue is to add "-fPIC"
  176. or "-fpic" to the compiler command-line options. For example, given
  177. software that reads :term:`CFLAGS` when you build it,
  178. you could add the following to your recipe::
  179. CFLAGS:append = " -fPIC "
  180. For more information on text relocations at runtime, see
  181. https://www.akkadia.org/drepper/textrelocs.html.
  182.  
  183. .. _qa-check-ldflags:
  184. - ``File '<file>' in package '<package>' doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]``
  185. This indicates that binaries produced when building the recipe have
  186. not been linked with the :term:`LDFLAGS` options
  187. provided by the build system. Check to be sure that the :term:`LDFLAGS`
  188. variable is being passed to the linker command. A common workaround
  189. for this situation is to pass in :term:`LDFLAGS` using
  190. :term:`TARGET_CC_ARCH` within the recipe as
  191. follows::
  192. TARGET_CC_ARCH += "${LDFLAGS}"
  193.  
  194. .. _qa-check-xorg-driver-abi:
  195. - ``Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi]``
  196. The specified package contains an Xorg driver, but does not have a
  197. corresponding ABI package dependency. The xserver-xorg recipe
  198. provides driver ABI names. All drivers should depend on the ABI
  199. versions that they have been built against. Driver recipes that
  200. include ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
  201. automatically get these versions. Consequently, you should only need
  202. to explicitly add dependencies to binary driver recipes.
  203.  
  204. .. _qa-check-infodir:
  205. - ``The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]``
  206. The ``/usr/share/info/dir`` should not be packaged. Add the following
  207. line to your :ref:`ref-tasks-install` task or to your
  208. ``do_install:append`` within the recipe as follows::
  209. rm ${D}${infodir}/dir
  210.  
  211. .. _qa-check-symlink-to-sysroot:
  212. - ``Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot]``
  213. The specified symlink points into :term:`TMPDIR` on the
  214. host. Such symlinks will work on the host. However, they are clearly
  215. invalid when running on the target. You should either correct the
  216. symlink to use a relative path or remove the symlink.
  217.  
  218. .. _qa-check-la:
  219. - ``<file> failed sanity test (workdir) in path <path> [la]``
  220. The specified ``.la`` file contains :term:`TMPDIR`
  221. paths. Any ``.la`` file containing these paths is incorrect since
  222. ``libtool`` adds the correct sysroot prefix when using the files
  223. automatically itself.
  224.  
  225. .. _qa-check-pkgconfig:
  226. - ``<file> failed sanity test (tmpdir) in path <path> [pkgconfig]``
  227. The specified ``.pc`` file contains
  228. :term:`TMPDIR`\ ``/``\ :term:`WORKDIR`
  229. paths. Any ``.pc`` file containing these paths is incorrect since
  230. ``pkg-config`` itself adds the correct sysroot prefix when the files
  231. are accessed.
  232.  
  233. .. _qa-check-debug-deps:
  234. - ``<packagename> rdepends on <debug_packagename> [debug-deps]``
  235. There is a dependency between the specified non-dbg package (i.e. a
  236. package whose name does not end in ``-dbg``) and a package that is a
  237. ``dbg`` package. The ``dbg`` packages contain debug symbols and are
  238. brought in using several different methods:
  239. - Using the ``dbg-pkgs``
  240. :term:`IMAGE_FEATURES` value.
  241. - Using :term:`IMAGE_INSTALL`.
  242. - As a dependency of another ``dbg`` package that was brought in
  243. using one of the above methods.
  244. The dependency might have been automatically added because the
  245. ``dbg`` package erroneously contains files that it should not contain
  246. (e.g. a non-symlink ``.so`` file) or it might have been added
  247. manually (e.g. by adding to :term:`RDEPENDS`).
  248.  
  249. .. _qa-check-dev-deps:
  250. - ``<packagename> rdepends on <dev_packagename> [dev-deps]``
  251. There is a dependency between the specified non-dev package (a package
  252. whose name does not end in ``-dev``) and a package that is a ``dev``
  253. package. The ``dev`` packages contain development headers and are
  254. usually brought in using several different methods:
  255. - Using the ``dev-pkgs``
  256. :term:`IMAGE_FEATURES` value.
  257. - Using :term:`IMAGE_INSTALL`.
  258. - As a dependency of another ``dev`` package that was brought in
  259. using one of the above methods.
  260. The dependency might have been automatically added (because the
  261. ``dev`` package erroneously contains files that it should not have
  262. (e.g. a non-symlink ``.so`` file) or it might have been added
  263. manually (e.g. by adding to :term:`RDEPENDS`).
  264.  
  265. .. _qa-check-dep-cmp:
  266. - ``<var>:<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp]``
  267. If you are adding a versioned dependency relationship to one of the
  268. dependency variables (:term:`RDEPENDS`,
  269. :term:`RRECOMMENDS`,
  270. :term:`RSUGGESTS`,
  271. :term:`RPROVIDES`,
  272. :term:`RREPLACES`, or
  273. :term:`RCONFLICTS`), you must only use the named
  274. comparison operators. Change the versioned dependency values you are
  275. adding to match those listed in the message.
  276.  
  277. .. _qa-check-compile-host-path:
  278. - ``<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]``
  279. The log for the :ref:`ref-tasks-compile` task
  280. indicates that paths on the host were searched for files, which is
  281. not appropriate when cross-compiling. Look for "is unsafe for
  282. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  283. file.
  284.  
  285. .. _qa-check-install-host-path:
  286. - ``<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]``
  287. The log for the :ref:`ref-tasks-install` task
  288. indicates that paths on the host were searched for files, which is
  289. not appropriate when cross-compiling. Look for "is unsafe for
  290. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  291. file.
  292.  
  293. .. _qa-check-configure-unsafe:
  294. - ``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]``
  295. The log for the :ref:`ref-tasks-configure` task
  296. indicates that paths on the host were searched for files, which is
  297. not appropriate when cross-compiling. Look for "is unsafe for
  298. cross-compilation" or "CROSS COMPILE Badness" in the specified log
  299. file.
  300.  
  301. .. _qa-check-pkgname:
  302. - ``<packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname]``
  303. The convention within the OpenEmbedded build system (sometimes
  304. enforced by the package manager itself) is to require that package
  305. names are all lower case and to allow a restricted set of characters.
  306. If your recipe name does not match this, or you add packages to
  307. :term:`PACKAGES` that do not conform to the
  308. convention, then you will receive this error. Rename your recipe. Or,
  309. if you have added a non-conforming package name to :term:`PACKAGES`,
  310. change the package name appropriately.
  311.  
  312. .. _qa-check-unknown-configure-option:
  313. - ``<recipe>: configure was passed unrecognized options: <options> [unknown-configure-option]``
  314. The configure script is reporting that the specified options are
  315. unrecognized. This situation could be because the options were
  316. previously valid but have been removed from the configure script. Or,
  317. there was a mistake when the options were added and there is another
  318. option that should be used instead. If you are unsure, consult the
  319. upstream build documentation, the ``./configure --help`` output, and
  320. the upstream change log or release notes. Once you have worked out
  321. what the appropriate change is, you can update
  322. :term:`EXTRA_OECONF`,
  323. :term:`PACKAGECONFIG_CONFARGS`, or the
  324. individual :term:`PACKAGECONFIG` option values
  325. accordingly.
  326.  
  327. .. _qa-check-pn-overrides:
  328. - ``Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]``
  329. The specified recipe has a name (:term:`PN`) value that
  330. appears in :term:`OVERRIDES`. If a recipe is named
  331. such that its :term:`PN` value matches something already in :term:`OVERRIDES`
  332. (e.g. :term:`PN` happens to be the same as :term:`MACHINE`
  333. or :term:`DISTRO`), it can have unexpected
  334. consequences. For example, assignments such as
  335. ``FILES:${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``.
  336. Rename your recipe (or if :term:`PN` is being set explicitly, change the
  337. :term:`PN` value) so that the conflict does not occur. See
  338. :term:`FILES` for additional information.
  339.  
  340. .. _qa-check-pkgvarcheck:
  341. - ``<recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck]``
  342. Certain variables (:term:`RDEPENDS`,
  343. :term:`RRECOMMENDS`,
  344. :term:`RSUGGESTS`,
  345. :term:`RCONFLICTS`,
  346. :term:`RPROVIDES`,
  347. :term:`RREPLACES`, :term:`FILES`,
  348. ``pkg_preinst``, ``pkg_postinst``, ``pkg_prerm``, ``pkg_postrm``, and
  349. :term:`ALLOW_EMPTY`) should always be set specific
  350. to a package (i.e. they should be set with a package name override
  351. such as ``RDEPENDS:${PN} = "value"`` rather than
  352. ``RDEPENDS = "value"``). If you receive this error, correct any
  353. assignments to these variables within your recipe.
  354. - ``recipe uses DEPENDS:${PN}, should use DEPENDS [pkgvarcheck]``
  355. This check looks for instances of setting ``DEPENDS:${PN}``
  356. which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus
  357. it is not correct to specify it for a particular package, nor will such
  358. an assignment actually work.) Set :term:`DEPENDS` instead.
  359. .. _qa-check-already-stripped:
  360. - ``File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped]``
  361. Produced binaries have already been stripped prior to the build
  362. system extracting debug symbols. It is common for upstream software
  363. projects to default to stripping debug symbols for output binaries.
  364. In order for debugging to work on the target using ``-dbg`` packages,
  365. this stripping must be disabled.
  366. Depending on the build system used by the software being built,
  367. disabling this stripping could be as easy as specifying an additional
  368. configure option. If not, disabling stripping might involve patching
  369. the build scripts. In the latter case, look for references to "strip"
  370. or "STRIP", or the "-s" or "-S" command-line options being specified
  371. on the linker command line (possibly through the compiler command
  372. line if preceded with "-Wl,").
  373. .. note::
  374. Disabling stripping here does not mean that the final packaged
  375. binaries will be unstripped. Once the OpenEmbedded build system
  376. splits out debug symbols to the ``-dbg`` package, it will then
  377. strip the symbols from the binaries.
  378.  
  379. .. _qa-check-packages-list:
  380. - ``<packagename> is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]``
  381. Package names must appear only once in the
  382. :term:`PACKAGES` variable. You might receive this
  383. error if you are attempting to add a package to :term:`PACKAGES` that is
  384. already in the variable's value.
  385.  
  386. .. _qa-check-files-invalid:
  387. - ``FILES variable for package <packagename> contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid]``
  388. The string "//" is invalid in a Unix path. Correct all occurrences
  389. where this string appears in a :term:`FILES` variable so
  390. that there is only a single "/".
  391.  
  392. .. _qa-check-installed-vs-shipped:
  393. - ``<recipename>: Files/directories were installed but not shipped in any package [installed-vs-shipped]``
  394. Files have been installed within the
  395. :ref:`ref-tasks-install` task but have not been
  396. included in any package by way of the :term:`FILES`
  397. variable. Files that do not appear in any package cannot be present
  398. in an image later on in the build process. You need to do one of the
  399. following:
  400. - Add the files to :term:`FILES` for the package you want them to appear
  401. in (e.g. ``FILES:${``\ :term:`PN`\ ``}`` for the main
  402. package).
  403. - Delete the files at the end of the :ref:`ref-tasks-install` task if the
  404. files are not needed in any package.
  405.  
  406. - ``<oldpackage>-<oldpkgversion> was registered as shlib provider for <library>, changing it to <newpackage>-<newpkgversion> because it was built later``
  407. This message means that both ``<oldpackage>`` and ``<newpackage>``
  408. provide the specified shared library. You can expect this message
  409. when a recipe has been renamed. However, if that is not the case, the
  410. message might indicate that a private version of a library is being
  411. erroneously picked up as the provider for a common library. If that
  412. is the case, you should add the library's ``.so`` filename to
  413. :term:`PRIVATE_LIBS` in the recipe that provides
  414. the private version of the library.
  415. .. _qa-check-unlisted-pkg-lics:
  416. - ``LICENSE:<packagename> includes licenses (<licenses>) that are not listed in LICENSE [unlisted-pkg-lics]``
  417. The :term:`LICENSE` of the recipe should be a superset
  418. of all the licenses of all packages produced by this recipe. In other
  419. words, any license in ``LICENSE:*`` should also appear in
  420. :term:`LICENSE`.
  421. .. _qa-check-configure-gettext:
  422. - ``AM_GNU_GETTEXT used but no inherit gettext [configure-gettext]``
  423. If a recipe is building something that uses automake and the automake
  424. files contain an ``AM_GNU_GETTEXT`` directive then this check will fail
  425. if there is no ``inherit gettext`` statement in the recipe to ensure
  426. that gettext is available during the build. Add ``inherit gettext`` to
  427. remove the warning.
  428. .. _qa-check-mime:
  429. - ``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]``
  430. The specified package contains mime type files (``.xml`` files in
  431. ``${datadir}/mime/packages``) and yet does not inherit the
  432. :ref:`ref-classes-mime` class which will ensure that these get
  433. properly installed. Either add ``inherit mime`` to the recipe or remove the
  434. files at the :ref:`ref-tasks-install` step if they are not needed.
  435. .. _qa-check-mime-xdg:
  436. - ``package contains desktop file with key 'MimeType' but does not inhert mime-xdg: <packagename> path '<file>' [mime-xdg]``
  437. The specified package contains a .desktop file with a 'MimeType' key
  438. present, but does not inherit the :ref:`ref-classes-mime-xdg`
  439. class that is required in order for that to be activated. Either add
  440. ``inherit mime`` to the recipe or remove the files at the
  441. :ref:`ref-tasks-install` step if they are not needed.
  442. .. _qa-check-src-uri-bad:
  443. - ``<recipename>: SRC_URI uses unstable GitHub archives [src-uri-bad]``
  444. GitHub provides "archive" tarballs, however these can be re-generated
  445. on the fly and thus the file's signature will not necessarily match that
  446. in the :term:`SRC_URI` checksums in future leading to build failures. It is
  447. recommended that you use an official release tarball or switch to
  448. pulling the corresponding revision in the actual git repository instead.
  449. - ``SRC_URI uses PN not BPN [src-uri-bad]``
  450. If some part of :term:`SRC_URI` needs to reference the recipe name, it should do
  451. so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change
  452. for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND`
  453. or multilib are being used. This check will fail if a reference to ``${PN}``
  454. is found within the :term:`SRC_URI` value --- change it to ``${BPN}`` instead.
  455. .. _qa-check-unhandled-features-check:
  456. - ``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]``
  457. This check ensures that if one of the variables that the
  458. :ref:`ref-classes-features_check` class supports (e.g.
  459. :term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe
  460. inherits :ref:`ref-classes-features_check` in order for
  461. the requirement to actually work. If you are seeing this message, either
  462. add ``inherit features_check`` to your recipe or remove the reference to
  463. the variable if it is not needed.
  464. .. _qa-check-missing-update-alternatives:
  465. - ``<recipename>: recipe defines ALTERNATIVE:<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]``
  466. This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the
  467. recipe also inherits :ref:`ref-classes-update-alternatives` such
  468. that the alternative will be correctly set up. If you are seeing this message, either
  469. add ``inherit update-alternatives`` to your recipe or remove the reference to the variable
  470. if it is not needed.
  471. .. _qa-check-shebang-size:
  472. - ``<packagename>: <file> maximum shebang size exceeded, the maximum size is 128. [shebang-size]``
  473. This check ensures that the shebang line (``#!`` in the first line) for a script
  474. is not longer than 128 characters, which can cause an error at runtime depending
  475. on the operating system. If you are seeing this message then the specified script
  476. may need to be patched to have a shorter in order to avoid runtime problems.
  477. .. _qa-check-perllocalpod:
  478. - ``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]``
  479. ``perllocal.pod`` is an index file of locally installed modules and so shouldn't be
  480. installed by any distribution packages. The :ref:`ref-classes-cpan` class
  481. already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes,
  482. but if a recipe is using ``MakeMaker`` directly then they might not be doing this
  483. correctly. This check ensures that perllocal.pod is not in any package in order to
  484. avoid multiple packages shipping this file and thus their packages conflicting
  485. if installed together.
  486. .. _qa-check-usrmerge:
  487. - ``<packagename> package is not obeying usrmerge distro feature. /<path> should be relocated to /usr. [usrmerge]``
  488. If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package
  489. installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this
  490. message, it indicates that the :ref:`ref-tasks-install` step (or perhaps the build process that
  491. :ref:`ref-tasks-install` is calling into, e.g. ``make install`` is using hardcoded paths instead
  492. of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be
  493. changed so that it does.
  494. .. _qa-check-patch-fuzz:
  495. - ``Fuzz detected: <patch output> [patch-fuzz]``
  496. This check looks for evidence of "fuzz" when applying patches within the :ref:`ref-tasks-patch`
  497. task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context
  498. lines in order to apply the patch. Consider this example:
  499. Patch to be applied::
  500. --- filename
  501. +++ filename
  502. context line 1
  503. context line 2
  504. context line 3
  505. +newly added line
  506. context line 4
  507. context line 5
  508. context line 6
  509. Original source code::
  510. different context line 1
  511. different context line 2
  512. context line 3
  513. context line 4
  514. different context line 5
  515. different context line 6
  516. Outcome (after applying patch with fuzz)::
  517. different context line 1
  518. different context line 2
  519. context line 3
  520. newly added line
  521. context line 4
  522. different context line 5
  523. different context line 6
  524. Chances are, the newly added line was actually added in a completely
  525. wrong location, or it was already in the original source and was added
  526. for the second time. This is especially possible if the context line 3
  527. and 4 are blank or have only generic things in them, such as ``#endif`` or ``}``.
  528. Depending on the patched code, it is entirely possible for an incorrectly
  529. patched file to still compile without errors.
  530. *How to eliminate patch fuzz warnings*
  531. Use the ``devtool`` command as explained by the warning. First, unpack the
  532. source into devtool workspace::
  533. devtool modify <recipe>
  534. This will apply all of the patches, and create new commits out of them in
  535. the workspace --- with the patch context updated.
  536. Then, replace the patches in the recipe layer::
  537. devtool finish --force-patch-refresh <recipe> <layer_path>
  538. The patch updates then need be reviewed (preferably with a side-by-side diff
  539. tool) to ensure they are indeed doing the right thing i.e.:
  540. #. they are applied in the correct location within the file;
  541. #. they do not introduce duplicate lines, or otherwise do things that
  542. are no longer necessary.
  543. To confirm these things, you can also review the patched source code in
  544. devtool's workspace, typically in ``<build_dir>/workspace/sources/<recipe>/``
  545. Once the review is done, you can create and publish a layer commit with
  546. the patch updates that modify the context. Devtool may also refresh
  547. other things in the patches, those can be discarded.
  548. .. _qa-check-patch-status:
  549. - ``Missing Upstream-Status in patch <patchfile> Please add according to <url> [patch-status]``
  550. The ``Upstream-Status`` value is missing in the specified patch file's header.
  551. This value is intended to track whether or not the patch has been sent
  552. upstream, whether or not it has been merged, etc.
  553. For more information, see the
  554. ":ref:`contributor-guide/recipe-style-guide:patch upstream status`"
  555. section in the Yocto Project and OpenEmbedded Contributor Guide.
  556. - ``Malformed Upstream-Status in patch <patchfile> Please correct according to <url> [patch-status]``
  557. The ``Upstream-Status`` value in the specified patch file's header is invalid -
  558. it must be a specific format. See the "Missing Upstream-Status" entry above
  559. for more information.
  560. .. _qa-check-buildpaths:
  561. - ``File <filename> in package <packagename> contains reference to TMPDIR [buildpaths]``
  562. This check ensures that build system paths (including :term:`TMPDIR`) do not
  563. appear in output files, which not only leaks build system configuration into
  564. the target, but also hinders binary reproducibility as the output will change
  565. if the build system configuration changes.
  566. Typically these paths will enter the output through some mechanism in the
  567. configuration or compilation of the software being built by the recipe. To
  568. resolve this issue you will need to determine how the detected path is
  569. entering the output. Sometimes it may require adjusting scripts or code to
  570. use a relative path rather than an absolute one, or to pick up the path from
  571. runtime configuration or environment variables.
  572. .. _qa-check-unimplemented-ptest:
  573. - ``<tool> tests detected [unimplemented-ptest]``
  574. This check will detect if the source of the package contains some
  575. upstream-provided tests and, if so, that ptests are implemented for this
  576. recipe. See the ":ref:`test-manual/ptest:testing packages with ptest`"
  577. section in the Yocto Project Development Tasks Manual. See also the
  578. ":ref:`ref-classes-ptest`" section.
  579. .. _qa-check-virtual-slash:
  580. - ``<variable> is set to <value> but the substring 'virtual/' holds no meaning in this context. It only works for build time dependencies, not runtime ones. It is suggested to use 'VIRTUAL-RUNTIME_' variables instead.``
  581. ``virtual/`` is a convention intended for use in the build context
  582. (i.e. :term:`PROVIDES` and :term:`DEPENDS`) rather than the runtime
  583. context (i.e. :term:`RPROVIDES` and :term:`RDEPENDS`). Use
  584. :term:`VIRTUAL-RUNTIME` variables instead for the latter.
  585. Configuring and Disabling QA Checks
  586. ===================================
  587. You can configure the QA checks globally so that specific check failures
  588. either raise a warning or an error message, using the
  589. :term:`WARN_QA` and :term:`ERROR_QA`
  590. variables, respectively. You can also disable checks within a particular
  591. recipe using :term:`INSANE_SKIP`. For information on
  592. how to work with the QA checks, see the
  593. ":ref:`ref-classes-insane`" section.
  594. .. note::
  595. Please keep in mind that the QA checks are meant to detect real
  596. or potential problems in the packaged output. So exercise caution
  597. when disabling these checks.