summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/qa-checks.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/ref-manual/qa-checks.rst')
-rw-r--r--documentation/ref-manual/qa-checks.rst1249
1 files changed, 773 insertions, 476 deletions
diff --git a/documentation/ref-manual/qa-checks.rst b/documentation/ref-manual/qa-checks.rst
index 6cb767d934..9dfbbff02d 100644
--- a/documentation/ref-manual/qa-checks.rst
+++ b/documentation/ref-manual/qa-checks.rst
@@ -28,7 +28,7 @@ error form along with an explanation.
28.. note:: 28.. note::
29 29
30 - At the end of each message, the name of the associated QA test (as 30 - At the end of each message, the name of the associated QA test (as
31 listed in the ":ref:`insane.bbclass <ref-classes-insane>`" 31 listed in the ":ref:`ref-classes-insane`"
32 section) appears within square brackets. 32 section) appears within square brackets.
33 33
34 - As mentioned, this list of error and warning messages is for QA 34 - As mentioned, this list of error and warning messages is for QA
@@ -43,120 +43,39 @@ error form along with an explanation.
43Errors and Warnings 43Errors and Warnings
44=================== 44===================
45 45
46.. _qa-check-libexec: 46.. _qa-check-already-stripped:
47
48- ``<packagename>: <path> is using libexec please relocate to <libexecdir> [libexec]``
49
50 The specified package contains files in ``/usr/libexec`` when the
51 distro configuration uses a different path for ``<libexecdir>`` By
52 default, ``<libexecdir>`` is ``$prefix/libexec``. However, this
53 default can be changed (e.g. ``${libdir}``).
54
55  
56.. _qa-check-rpaths:
57
58- ``package <packagename> contains bad RPATH <rpath> in file <file> [rpaths]``
59
60 The specified binary produced by the recipe contains dynamic library
61 load paths (rpaths) that contain build system paths such as
62 :term:`TMPDIR`, which are incorrect for the target and
63 could potentially be a security issue. Check for bad ``-rpath``
64 options being passed to the linker in your
65 :ref:`ref-tasks-compile` log. Depending on the build
66 system used by the software being built, there might be a configure
67 option to disable rpath usage completely within the build of the
68 software.
69
70  
71.. _qa-check-useless-rpaths:
72
73- ``<packagename>: <file> contains probably-redundant RPATH <rpath> [useless-rpaths]``
74
75 The specified binary produced by the recipe contains dynamic library
76 load paths (rpaths) that on a standard system are searched by default
77 by the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths
78 will not cause any breakage, they do waste space and are unnecessary.
79 Depending on the build system used by the software being built, there
80 might be a configure option to disable rpath usage completely within
81 the build of the software.
82
83  
84.. _qa-check-file-rdeps:
85
86- ``<packagename> requires <files>, but no providers in its RDEPENDS [file-rdeps]``
87
88 A file-level dependency has been identified from the specified
89 package on the specified files, but there is no explicit
90 corresponding entry in :term:`RDEPENDS`. If
91 particular files are required at runtime then ``RDEPENDS`` should be
92 declared in the recipe to ensure the packages providing them are
93 built.
94
95  
96.. _qa-check-build-deps:
97
98- ``<packagename1> rdepends on <packagename2>, but it isn't a build dependency? [build-deps]``
99
100 A runtime dependency exists between the two specified packages, but
101 there is nothing explicit within the recipe to enable the
102 OpenEmbedded build system to ensure that dependency is satisfied.
103 This condition is usually triggered by an
104 :term:`RDEPENDS` value being added at the packaging
105 stage rather than up front, which is usually automatic based on the
106 contents of the package. In most cases, you should change the recipe
107 to add an explicit ``RDEPENDS`` for the dependency.
108
109  
110.. _qa-check-dev-so:
111
112- ``non -dev/-dbg/nativesdk- package contains symlink .so: <packagename> path '<path>' [dev-so]``
113
114 Symlink ``.so`` files are for development only, and should therefore
115 go into the ``-dev`` package. This situation might occur if you add
116 ``*.so*`` rather than ``*.so.*`` to a non-dev package. Change
117 :term:`FILES` (and possibly
118 :term:`PACKAGES`) such that the specified ``.so``
119 file goes into an appropriate ``-dev`` package.
120
121  
122.. _qa-check-staticdev:
123
124- ``non -staticdev package contains static .a library: <packagename> path '<path>' [staticdev]``
125 47
126 Static ``.a`` library files should go into a ``-staticdev`` package. 48``already-stripped``
127 Change :term:`FILES` (and possibly 49--------------------
128 :term:`PACKAGES`) such that the specified ``.a`` file
129 goes into an appropriate ``-staticdev`` package.
130 50
131   51``File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped]``
132.. _qa-check-libdir:
133 52
134- ``<packagename>: found library in wrong location [libdir]`` 53Produced binaries have already been stripped prior to the build
54system extracting debug symbols. It is common for upstream software
55projects to default to stripping debug symbols for output binaries.
56In order for debugging to work on the target using ``-dbg`` packages,
57this stripping must be disabled.
135 58
136 The specified file may have been installed into an incorrect 59Depending on the build system used by the software being built,
137 (possibly hardcoded) installation path. For example, this test will 60disabling this stripping could be as easy as specifying an additional
138 catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is 61configure option. If not, disabling stripping might involve patching
139 "lib32". Another example is when recipes install 62the build scripts. In the latter case, look for references to "strip"
140 ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib". False 63or "STRIP", or the "-s" or "-S" command-line options being specified
141 positives occasionally exist. For these cases add "libdir" to 64on the linker command line (possibly through the compiler command
142 :term:`INSANE_SKIP` for the package. 65line if preceded with "-Wl,").
143 66
144   67.. note::
145.. _qa-check-debug-files:
146
147- ``non debug package contains .debug directory: <packagename> path <path> [debug-files]``
148 68
149 The specified package contains a ``.debug`` directory, which should 69 Disabling stripping here does not mean that the final packaged
150 not appear in anything but the ``-dbg`` package. This situation might 70 binaries will be unstripped. Once the OpenEmbedded build system
151 occur if you add a path which contains a ``.debug`` directory and do 71 splits out debug symbols to the ``-dbg`` package, it will then
152 not explicitly add the ``.debug`` directory to the ``-dbg`` package. 72 strip the symbols from the binaries.
153 If this is the case, add the ``.debug`` directory explicitly to
154 ``FILES_${PN}-dbg``. See :term:`FILES` for additional
155 information on ``FILES``.
156 73
157  
158.. _qa-check-arch: 74.. _qa-check-arch:
159 75
76``arch``
77--------
78
160- ``Architecture did not match (<file_arch>, expected <machine_arch>) in <file> [arch]`` 79- ``Architecture did not match (<file_arch>, expected <machine_arch>) in <file> [arch]``
161 80
162 By default, the OpenEmbedded build system checks the Executable and 81 By default, the OpenEmbedded build system checks the Executable and
@@ -173,8 +92,6 @@ Errors and Warnings
173 option is to check the :ref:`ref-tasks-compile` log 92 option is to check the :ref:`ref-tasks-compile` log
174 and verify that the compiler options being used are correct. 93 and verify that the compiler options being used are correct.
175 94
176  
177
178- ``Bit size did not match (<file_bits>, expected <machine_bits>) in <file> [arch]`` 95- ``Bit size did not match (<file_bits>, expected <machine_bits>) in <file> [arch]``
179 96
180 By default, the OpenEmbedded build system checks the Executable and 97 By default, the OpenEmbedded build system checks the Executable and
@@ -191,8 +108,6 @@ Errors and Warnings
191 option is to check the :ref:`ref-tasks-compile` log 108 option is to check the :ref:`ref-tasks-compile` log
192 and verify that the compiler options being used are correct. 109 and verify that the compiler options being used are correct.
193 110
194  
195
196- ``Endianness did not match (<file_endianness>, expected <machine_endianness>) in <file> [arch]`` 111- ``Endianness did not match (<file_endianness>, expected <machine_endianness>) in <file> [arch]``
197 112
198 By default, the OpenEmbedded build system checks the Executable and 113 By default, the OpenEmbedded build system checks the Executable and
@@ -209,243 +124,593 @@ Errors and Warnings
209 option is to check the :ref:`ref-tasks-compile` log 124 option is to check the :ref:`ref-tasks-compile` log
210 and verify that the compiler options being used are correct. 125 and verify that the compiler options being used are correct.
211 126
212   127.. _qa-check-build-deps:
213.. _qa-check-textrel:
214 128
215- ``ELF binary '<file>' has relocations in .text [textrel]`` 129``build-deps``
130--------------
216 131
217 The specified ELF binary contains relocations in its ``.text`` 132``<packagename1> rdepends on <packagename2>, but it isn't a build dependency? [build-deps]``
218 sections. This situation can result in a performance impact at
219 runtime.
220 133
221 Typically, the way to solve this performance issue is to add "-fPIC" 134There is a runtime dependency between the two specified packages, but
222 or "-fpic" to the compiler command-line options. For example, given 135there is nothing explicit within the recipe to enable the
223 software that reads :term:`CFLAGS` when you build it, 136OpenEmbedded build system to ensure that dependency is satisfied.
224 you could add the following to your recipe: 137This condition is usually triggered by an
225 :: 138:term:`RDEPENDS` value being added at the packaging
139stage rather than up front, which is usually automatic based on the
140contents of the package. In most cases, you should change the recipe
141to add an explicit :term:`RDEPENDS` for the dependency.
226 142
227 CFLAGS_append = " -fPIC " 143.. _qa-check-buildpaths:
228 144
229 For more information on text relocations at runtime, see 145``buildpaths``
230 https://www.akkadia.org/drepper/textrelocs.html. 146--------------
231 147
232   148``File <filename> in package <packagename> contains reference to TMPDIR [buildpaths]``
233.. _qa-check-ldflags: 149
150This check ensures that build system paths (including :term:`TMPDIR`) do not
151appear in output files, which not only leaks build system configuration into
152the target, but also hinders binary reproducibility as the output will change
153if the build system configuration changes.
234 154
235- ``File '<file>' in package '<package>' doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]`` 155Typically these paths will enter the output through some mechanism in the
156configuration or compilation of the software being built by the recipe. To
157resolve this issue you will need to determine how the detected path is
158entering the output. Sometimes it may require adjusting scripts or code to
159use a relative path rather than an absolute one, or to pick up the path from
160runtime configuration or environment variables.
236 161
237 This indicates that binaries produced when building the recipe have 162.. _qa-check-configure-gettext:
238 not been linked with the :term:`LDFLAGS` options
239 provided by the build system. Check to be sure that the ``LDFLAGS``
240 variable is being passed to the linker command. A common workaround
241 for this situation is to pass in ``LDFLAGS`` using
242 :term:`TARGET_CC_ARCH` within the recipe as
243 follows:
244 ::
245 163
246 TARGET_CC_ARCH += "${LDFLAGS}" 164``configure-gettext``
165---------------------
247 166
248   167``AM_GNU_GETTEXT used but no inherit gettext [configure-gettext]``
249.. _qa-check-xorg-driver-abi: 168
169If a recipe is building something that uses automake and the automake
170files contain an ``AM_GNU_GETTEXT`` directive then this check will fail
171if there is no ``inherit gettext`` statement in the recipe to ensure
172that gettext is available during the build. Add ``inherit gettext`` to
173remove the warning.
174
175.. _qa-check-configure-unsafe:
176
177``configure-unsafe``
178--------------------
179
180``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]``
181
182The log for the :ref:`ref-tasks-configure` task
183indicates that paths on the host were searched for files, which is
184not appropriate when cross-compiling. Look for "is unsafe for
185cross-compilation" or "CROSS COMPILE Badness" in the specified log
186file.
187
188.. _qa-check-debug-deps:
189
190``debug-deps``
191--------------
192
193``<packagename> rdepends on <debug_packagename> [debug-deps]``
194
195There is a dependency between the specified non-dbg package (i.e. a
196package whose name does not end in ``-dbg``) and a package that is a
197``dbg`` package. The ``dbg`` packages contain debug symbols and are
198brought in using several different methods:
199
200- Using the ``dbg-pkgs``
201 :term:`IMAGE_FEATURES` value.
202
203- Using :term:`IMAGE_INSTALL`.
204
205- As a dependency of another ``dbg`` package that was brought in
206 using one of the above methods.
207
208The dependency might have been automatically added because the
209``dbg`` package erroneously contains files that it should not contain
210(e.g. a non-symlink ``.so`` file) or it might have been added
211manually (e.g. by adding to :term:`RDEPENDS`).
212
213.. _qa-check-debug-files:
250 214
251- ``Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi]`` 215``debug-files``
216---------------
252 217
253 The specified package contains an Xorg driver, but does not have a 218``non debug package contains .debug directory: <packagename> path <path> [debug-files]``
254 corresponding ABI package dependency. The xserver-xorg recipe 219
255 provides driver ABI names. All drivers should depend on the ABI 220The specified package contains a ``.debug`` directory, which should
256 versions that they have been built against. Driver recipes that 221not appear in anything but the ``-dbg`` package. This situation might
257 include ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will 222occur if you add a path which contains a ``.debug`` directory and do
258 automatically get these versions. Consequently, you should only need 223not explicitly add the ``.debug`` directory to the ``-dbg`` package.
259 to explicitly add dependencies to binary driver recipes. 224If this is the case, add the ``.debug`` directory explicitly to
225``FILES:${PN}-dbg``. See :term:`FILES` for additional
226information on :term:`FILES`.
227
228.. _qa-check-dep-cmp:
229
230``dep-cmp``
231-----------
232
233``<var>:<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp]``
234
235If you are adding a versioned dependency relationship to one of the
236dependency variables (:term:`RDEPENDS`,
237:term:`RRECOMMENDS`,
238:term:`RSUGGESTS`,
239:term:`RPROVIDES`,
240:term:`RREPLACES`, or
241:term:`RCONFLICTS`), you must only use the named
242comparison operators. Change the versioned dependency values you are
243adding to match those listed in the message.
244
245.. _qa-check-dev-deps:
246
247``dev-deps``
248------------
249
250``<packagename> rdepends on <dev_packagename> [dev-deps]``
251
252There is a dependency between the specified non-dev package (a package
253whose name does not end in ``-dev``) and a package that is a ``dev``
254package. The ``dev`` packages contain development headers and are
255usually brought in using several different methods:
256
257- Using the ``dev-pkgs``
258 :term:`IMAGE_FEATURES` value.
259
260- Using :term:`IMAGE_INSTALL`.
261
262- As a dependency of another ``dev`` package that was brought in
263 using one of the above methods.
264
265The dependency might have been automatically added (because the
266``dev`` package erroneously contains files that it should not have
267(e.g. a non-symlink ``.so`` file) or it might have been added
268manually (e.g. by adding to :term:`RDEPENDS`).
269
270.. _qa-check-desktop:
271
272``desktop``
273-----------
274
275``"Desktop file issue: ... [desktop]``
276
277Runs the ``desktop-file-validate`` program against any
278``.desktop`` files to validate their contents against the
279specification for ``.desktop`` files.
280
281.. _qa-check-dev-so:
282
283``dev-so``
284----------
285
286``non -dev/-dbg/nativesdk- package contains symlink .so: <packagename> path '<path>' [dev-so]``
287
288Symlink ``.so`` files are for development only, and should therefore
289go into the ``-dev`` package. This situation might occur if you add
290``*.so*`` rather than ``*.so.*`` to a non-dev package. Change
291:term:`FILES` (and possibly
292:term:`PACKAGES`) such that the specified ``.so``
293file goes into an appropriate ``-dev`` package.
294
295.. _qa-check-empty-dirs:
296
297``empty-dirs``
298--------------
299
300``<packagename> installs files in <path>, but it is expected to be empty [empty-dirs]``
301
302The specified package is installing files into a directory that is
303normally expected to be empty (such as ``/tmp``). These files may
304be more appropriately installed to a different location, or
305perhaps alternatively not installed at all, usually by updating the
306:ref:`ref-tasks-install` task/function.
307
308.. _qa-check-file-rdeps:
309
310``file-rdeps``
311--------------
312
313``<packagename> requires <files>, but no providers in its RDEPENDS [file-rdeps]``
314
315A file-level dependency has been identified from the specified
316package on the specified files, but there is no explicit
317corresponding entry in :term:`RDEPENDS`. If
318particular files are required at runtime then :term:`RDEPENDS` should be
319declared in the recipe to ensure the packages providing them are
320built.
321
322.. _qa-check-files-invalid:
323
324``files-invalid``
325-----------------
326
327``FILES variable for package <packagename> contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid]``
328
329The string "//" is invalid in a Unix path. Correct all occurrences
330where this string appears in a :term:`FILES` variable so
331that there is only a single "/".
332
333.. _qa-check-host-user-contaminated:
334
335``host-user-contaminated``
336--------------------------
337
338``<package name>: <path> is owned by gid/uid <gid/uid>, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]``
339
340Checks that no package produced by the
341recipe contains any files outside of ``/home`` with a user or group
342ID that matches the user running BitBake. A match usually indicates
343that the files are being installed with an incorrect UID/GID, since
344target IDs are independent from host IDs. For additional information,
345see the section describing the
346:ref:`ref-tasks-install` task.
260 347
261  
262.. _qa-check-infodir: 348.. _qa-check-infodir:
263 349
264- ``The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]`` 350``infodir``
351-----------
265 352
266 The ``/usr/share/info/dir`` should not be packaged. Add the following 353``The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]``
267 line to your :ref:`ref-tasks-install` task or to your
268 ``do_install_append`` within the recipe as follows:
269 ::
270 354
271 rm ${D}${infodir}/dir 355The ``/usr/share/info/dir`` should not be packaged. Add the following
272   356line to your :ref:`ref-tasks-install` task or to your
357``do_install:append`` within the recipe as follows::
273 358
274.. _qa-check-symlink-to-sysroot: 359 rm ${D}${infodir}/dir
360
361.. _qa-check-installed-vs-shipped:
362
363``installed-vs-shipped``
364------------------------
365
366``<recipename>: Files/directories were installed but not shipped in any package [installed-vs-shipped]``
367
368Files have been installed within the
369:ref:`ref-tasks-install` task but have not been
370included in any package by way of the :term:`FILES`
371variable. Files that do not appear in any package cannot be present
372in an image later on in the build process. You need to do one of the
373following:
374
375- Add the files to :term:`FILES` for the package you want them to appear
376 in (e.g. ``FILES:${``\ :term:`PN`\ ``}`` for the main
377 package).
378
379- Delete the files at the end of the :ref:`ref-tasks-install` task if the
380 files are not needed in any package.
381
382.. _qa-check-incompatible-license:
383
384``incompatible-license``
385------------------------
386
387``Excluding <package> from packaging as it has incompatible license(s): <license> [incompatible-license]``
388
389Report when packages are excluded from being created due to being marked with
390a license that is in :term:`INCOMPATIBLE_LICENSE`.
391
392.. _qa-check-invalid-chars:
393
394``invalid-chars``
395-----------------
275 396
276- ``Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot]`` 397``<variable> has non <envoding> characters [invalid-chars]``
277 398
278 The specified symlink points into :term:`TMPDIR` on the 399Checks that the recipe metadata variables :term:`DESCRIPTION`,
279 host. Such symlinks will work on the host. However, they are clearly 400:term:`SUMMARY`, :term:`LICENSE`, and :term:`SECTION` do not contain
280 invalid when running on the target. You should either correct the 401non-UTF-8 characters. Some package managers do not support such characters.
281 symlink to use a relative path or remove the symlink. 402
403.. _qa-check-invalid-packageconfig:
404
405``invalid-packageconfig``
406-------------------------
407
408``<package>: invalid PACKAGECONFIG(s): <configs> [invalid-packageconfig]``
409
410Checks that no undefined features are being added to :term:`PACKAGECONFIG`.
411For example, any name "foo" for which the following form does not exist::
412
413 PACKAGECONFIG[foo] = "..."
282 414
283  
284.. _qa-check-la: 415.. _qa-check-la:
285 416
286- ``<file> failed sanity test (workdir) in path <path> [la]`` 417``la``
418------
287 419
288 The specified ``.la`` file contains :term:`TMPDIR` 420``<file> failed sanity test (workdir) in path <path> [la]``
289 paths. Any ``.la`` file containing these paths is incorrect since
290 ``libtool`` adds the correct sysroot prefix when using the files
291 automatically itself.
292 421
293   422The specified ``.la`` file contains :term:`TMPDIR`
294.. _qa-check-pkgconfig: 423paths. Any ``.la`` file containing these paths is incorrect since
424``libtool`` adds the correct sysroot prefix when using the files
425automatically itself.
295 426
296- ``<file> failed sanity test (tmpdir) in path <path> [pkgconfig]`` 427.. _qa-check-ldflags:
297 428
298 The specified ``.pc`` file contains 429``ldflags``
299 :term:`TMPDIR`\ ``/``\ :term:`WORKDIR` 430-----------
300 paths. Any ``.pc`` file containing these paths is incorrect since
301 ``pkg-config`` itself adds the correct sysroot prefix when the files
302 are accessed.
303 431
304   432``File '<file>' in package '<package>' doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]``
305.. _qa-check-debug-deps:
306 433
307- ``<packagename> rdepends on <debug_packagename> [debug-deps]`` 434This indicates that binaries produced when building the recipe have
435not been linked with the :term:`LDFLAGS` options
436provided by the build system. Check to be sure that the :term:`LDFLAGS`
437variable is being passed to the linker command. A common workaround
438for this situation is to pass in :term:`LDFLAGS` using
439:term:`TARGET_CC_ARCH` within the recipe as
440follows::
308 441
309 A dependency exists between the specified non-dbg package (i.e. a 442 TARGET_CC_ARCH += "${LDFLAGS}"
310 package whose name does not end in ``-dbg``) and a package that is a
311 ``dbg`` package. The ``dbg`` packages contain debug symbols and are
312 brought in using several different methods:
313 443
314 - Using the ``dbg-pkgs`` 444.. _qa-check-libdir:
315 :term:`IMAGE_FEATURES` value.
316 445
317 - Using :term:`IMAGE_INSTALL`. 446``libdir``
447----------
318 448
319 - As a dependency of another ``dbg`` package that was brought in 449``<packagename>: found library in wrong location [libdir]``
320 using one of the above methods.
321 450
322 The dependency might have been automatically added because the 451The specified file may have been installed into an incorrect
323 ``dbg`` package erroneously contains files that it should not contain 452(possibly hardcoded) installation path. For example, this test will
324 (e.g. a non-symlink ``.so`` file) or it might have been added 453catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
325 manually (e.g. by adding to :term:`RDEPENDS`). 454"lib32". Another example is when recipes install
455``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib". False
456positives occasionally exist. For these cases add "libdir" to
457:term:`INSANE_SKIP` for the package.
326 458
327   459.. _qa-check-libexec:
328.. _qa-check-dev-deps:
329 460
330- ``<packagename> rdepends on <dev_packagename> [dev-deps]`` 461``libexec``
462-----------
331 463
332 A dependency exists between the specified non-dev package (a package 464``<packagename>: <path> is using libexec please relocate to <libexecdir> [libexec]``
333 whose name does not end in ``-dev``) and a package that is a ``dev``
334 package. The ``dev`` packages contain development headers and are
335 usually brought in using several different methods:
336 465
337 - Using the ``dev-pkgs`` 466The specified package contains files in ``/usr/libexec`` when the
338 :term:`IMAGE_FEATURES` value. 467distro configuration uses a different path for ``<libexecdir>`` By
468default, ``<libexecdir>`` is ``$prefix/libexec``. However, this
469default can be changed (e.g. ``${libdir}``).
339 470
340 - Using :term:`IMAGE_INSTALL`. 471.. _qa-check-mime:
341 472
342 - As a dependency of another ``dev`` package that was brought in 473``mime``
343 using one of the above methods. 474--------
344 475
345 The dependency might have been automatically added (because the 476``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]``
346 ``dev`` package erroneously contains files that it should not have
347 (e.g. a non-symlink ``.so`` file) or it might have been added
348 manually (e.g. by adding to :term:`RDEPENDS`).
349 477
350   478The specified package contains mime type files (``.xml`` files in
351.. _qa-check-dep-cmp: 479``${datadir}/mime/packages``) and yet does not inherit the
480:ref:`ref-classes-mime` class which will ensure that these get
481properly installed. Either add ``inherit mime`` to the recipe or remove the
482files at the :ref:`ref-tasks-install` step if they are not needed.
352 483
353- ``<var>_<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp]`` 484.. _qa-check-mime-xdg:
354 485
355 If you are adding a versioned dependency relationship to one of the 486``mime-xdg``
356 dependency variables (:term:`RDEPENDS`, 487------------
357 :term:`RRECOMMENDS`,
358 :term:`RSUGGESTS`,
359 :term:`RPROVIDES`,
360 :term:`RREPLACES`, or
361 :term:`RCONFLICTS`), you must only use the named
362 comparison operators. Change the versioned dependency values you are
363 adding to match those listed in the message.
364 488
365   489``package contains desktop file with key 'MimeType' but does not inherit mime-xdg: <packagename> path '<file>' [mime-xdg]``
366.. _qa-check-compile-host-path:
367 490
368- ``<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]`` 491The specified package contains a .desktop file with a 'MimeType' key
492present, but does not inherit the :ref:`ref-classes-mime-xdg`
493class that is required in order for that to be activated. Either add
494``inherit mime`` to the recipe or remove the files at the
495:ref:`ref-tasks-install` step if they are not needed.
369 496
370 The log for the :ref:`ref-tasks-compile` task 497.. _qa-check-missing-update-alternatives:
371 indicates that paths on the host were searched for files, which is
372 not appropriate when cross-compiling. Look for "is unsafe for
373 cross-compilation" or "CROSS COMPILE Badness" in the specified log
374 file.
375 498
376   499``missing-update-alternatives``
377.. _qa-check-install-host-path: 500-------------------------------
378 501
379- ``<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]`` 502``<recipename>: recipe defines ALTERNATIVE:<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]``
380 503
381 The log for the :ref:`ref-tasks-install` task 504This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the
382 indicates that paths on the host were searched for files, which is 505recipe also inherits :ref:`ref-classes-update-alternatives` such
383 not appropriate when cross-compiling. Look for "is unsafe for 506that the alternative will be correctly set up. If you are seeing this message, either
384 cross-compilation" or "CROSS COMPILE Badness" in the specified log 507add ``inherit update-alternatives`` to your recipe or remove the reference to the variable
385 file. 508if it is not needed.
386 509
387   510.. _qa-check-packages-list:
388.. _qa-check-configure-unsafe:
389 511
390- ``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]`` 512``packages-list``
513-----------------
391 514
392 The log for the :ref:`ref-tasks-configure` task 515``<packagename> is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]``
393 indicates that paths on the host were searched for files, which is
394 not appropriate when cross-compiling. Look for "is unsafe for
395 cross-compilation" or "CROSS COMPILE Badness" in the specified log
396 file.
397 516
398   517Package names must appear only once in the
399.. _qa-check-pkgname: 518:term:`PACKAGES` variable. You might receive this
519error if you are attempting to add a package to :term:`PACKAGES` that is
520already in the variable's value.
521
522.. _qa-check-patch-fuzz:
400 523
401- ``<packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname]`` 524``patch-fuzz``
525--------------
402 526
403 The convention within the OpenEmbedded build system (sometimes 527``Fuzz detected: <patch output> [patch-fuzz]``
404 enforced by the package manager itself) is to require that package
405 names are all lower case and to allow a restricted set of characters.
406 If your recipe name does not match this, or you add packages to
407 :term:`PACKAGES` that do not conform to the
408 convention, then you will receive this error. Rename your recipe. Or,
409 if you have added a non-conforming package name to ``PACKAGES``,
410 change the package name appropriately.
411 528
412   529This check looks for evidence of "fuzz" when applying patches within the :ref:`ref-tasks-patch`
413.. _qa-check-unknown-configure-option: 530task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context
531lines in order to apply the patch. Consider this example:
414 532
415- ``<recipe>: configure was passed unrecognized options: <options> [unknown-configure-option]`` 533Patch to be applied::
416 534
417 The configure script is reporting that the specified options are 535 --- filename
418 unrecognized. This situation could be because the options were 536 +++ filename
419 previously valid but have been removed from the configure script. Or, 537 context line 1
420 there was a mistake when the options were added and there is another 538 context line 2
421 option that should be used instead. If you are unsure, consult the 539 context line 3
422 upstream build documentation, the ``./configure --help`` output, and 540 +newly added line
423 the upstream change log or release notes. Once you have worked out 541 context line 4
424 what the appropriate change is, you can update 542 context line 5
425 :term:`EXTRA_OECONF`, 543 context line 6
426 :term:`PACKAGECONFIG_CONFARGS`, or the 544
427 individual :term:`PACKAGECONFIG` option values 545Original source code::
428 accordingly. 546
429 547 different context line 1
430   548 different context line 2
431.. _qa-check-pn-overrides: 549 context line 3
550 context line 4
551 different context line 5
552 different context line 6
553
554Outcome (after applying patch with fuzz)::
555
556 different context line 1
557 different context line 2
558 context line 3
559 newly added line
560 context line 4
561 different context line 5
562 different context line 6
563
564Chances are, the newly added line was actually added in a completely
565wrong location, or it was already in the original source and was added
566for the second time. This is especially possible if the context line 3
567and 4 are blank or have only generic things in them, such as ``#endif`` or ``}``.
568Depending on the patched code, it is entirely possible for an incorrectly
569patched file to still compile without errors.
570
571*How to eliminate patch fuzz warnings*
572
573Use the ``devtool`` command as explained by the warning. First, unpack the
574source into devtool workspace::
575
576 devtool modify <recipe>
577
578This will apply all of the patches, and create new commits out of them in
579the workspace --- with the patch context updated.
580
581Then, replace the patches in the recipe layer::
582
583 devtool finish --force-patch-refresh <recipe> <layer_path>
584
585The patch updates then need be reviewed (preferably with a side-by-side diff
586tool) to ensure they are indeed doing the right thing i.e.:
587
588#. they are applied in the correct location within the file;
589#. they do not introduce duplicate lines, or otherwise do things that
590 are no longer necessary.
591
592To confirm these things, you can also review the patched source code in
593devtool's workspace, typically in ``<build_dir>/workspace/sources/<recipe>/``
594
595Once the review is done, you can create and publish a layer commit with
596the patch updates that modify the context. Devtool may also refresh
597other things in the patches, those can be discarded.
598
599.. _qa-check-patch-status:
600
601``patch-status``
602----------------
603
604- ``Missing Upstream-Status in patch <patchfile> Please add according to <url> [patch-status]``
605
606 The ``Upstream-Status`` value is missing in the specified patch file's header.
607 This value is intended to track whether or not the patch has been sent
608 upstream, whether or not it has been merged, etc.
609
610 For more information, see the
611 ":ref:`contributor-guide/recipe-style-guide:patch upstream status`"
612 section in the Yocto Project and OpenEmbedded Contributor Guide.
613
614- ``Malformed Upstream-Status in patch <patchfile> Please correct according to <url> [patch-status]``
615
616 The ``Upstream-Status`` value in the specified patch file's header is invalid -
617 it must be a specific format. See the "Missing Upstream-Status" entry above
618 for more information.
619
620.. _qa-check-pep517-backend:
621
622``pep517-backend``
623------------------
624
625``inherits setuptools3 but has pyproject.toml with <build backend>, use the correct class [pep517-backend]``
626
627Checks that a recipe inheriting :ref:`ref-classes-setuptools3` has a
628PEP517-compliant backend.
629
630.. _qa-check-perllocalpod:
631
632``perllocalpod``
633----------------
634
635``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]``
636
637``perllocal.pod`` is an index file of locally installed modules and so shouldn't be
638installed by any distribution packages. The :ref:`ref-classes-cpan` class
639already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes,
640but if a recipe is using ``MakeMaker`` directly then they might not be doing this
641correctly. This check ensures that perllocal.pod is not in any package in order to
642avoid multiple packages shipping this file and thus their packages conflicting
643if installed together.
432 644
433- ``Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]`` 645.. _qa-check-perm-config:
434 646
435 The specified recipe has a name (:term:`PN`) value that 647``perm-config``
436 appears in :term:`OVERRIDES`. If a recipe is named 648---------------
437 such that its ``PN`` value matches something already in ``OVERRIDES`` 649
438 (e.g. ``PN`` happens to be the same as :term:`MACHINE` 650``Fixup Perms: invalid config line <line> [perm-config]``
439 or :term:`DISTRO`), it can have unexpected 651
440 consequences. For example, assignments such as 652Reports lines in ``fs-perms.txt`` that have an invalid format.
441 ``FILES_${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``. 653
442 Rename your recipe (or if ``PN`` is being set explicitly, change the 654.. _qa-check-perm-line:
443 ``PN`` value) so that the conflict does not occur. See 655
444 :term:`FILES` for additional information. 656``perm-line``
657-------------
658
659``Fixup perms: <config> invalid line: <line> [perm-line]``
660
661Reports lines in ``fs-perms.txt`` that have an invalid format.
662
663.. _qa-check-perm-link:
664
665``perm-link``
666-------------
667
668``Fixup Perms: Unable to correct directory link, target already exists: <directory> -> <target> [perm-link]``
669
670Reports lines in ``fs-perms.txt`` that specify 'link' where the specified
671target already exists.
672
673.. _qa-check-perms:
674
675``perms``
676---------
677
678Currently, this check is unused but reserved.
679
680.. _qa-check-pkgconfig:
681
682``pkgconfig``
683-------------
684
685``<file> failed sanity test (tmpdir) in path <path> [pkgconfig]``
686
687The specified ``.pc`` file contains
688:term:`TMPDIR`\ ``/``\ :term:`WORKDIR`
689paths. Any ``.pc`` file containing these paths is incorrect since
690``pkg-config`` itself adds the correct sysroot prefix when the files
691are accessed.
692
693.. _qa-check-pkgname:
694
695``pkgname``
696-----------
697
698``<packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname]``
699
700The convention within the OpenEmbedded build system (sometimes
701enforced by the package manager itself) is to require that package
702names are all lower case and to allow a restricted set of characters.
703If your recipe name does not match this, or you add packages to
704:term:`PACKAGES` that do not conform to the
705convention, then you will receive this error. Rename your recipe. Or,
706if you have added a non-conforming package name to :term:`PACKAGES`,
707change the package name appropriately.
445 708
446  
447.. _qa-check-pkgvarcheck: 709.. _qa-check-pkgvarcheck:
448 710
711``pkgvarcheck``
712---------------
713
449- ``<recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck]`` 714- ``<recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck]``
450 715
451 Certain variables (:term:`RDEPENDS`, 716 Certain variables (:term:`RDEPENDS`,
@@ -457,291 +722,323 @@ Errors and Warnings
457 ``pkg_preinst``, ``pkg_postinst``, ``pkg_prerm``, ``pkg_postrm``, and 722 ``pkg_preinst``, ``pkg_postinst``, ``pkg_prerm``, ``pkg_postrm``, and
458 :term:`ALLOW_EMPTY`) should always be set specific 723 :term:`ALLOW_EMPTY`) should always be set specific
459 to a package (i.e. they should be set with a package name override 724 to a package (i.e. they should be set with a package name override
460 such as ``RDEPENDS_${PN} = "value"`` rather than 725 such as ``RDEPENDS:${PN} = "value"`` rather than
461 ``RDEPENDS = "value"``). If you receive this error, correct any 726 ``RDEPENDS = "value"``). If you receive this error, correct any
462 assignments to these variables within your recipe. 727 assignments to these variables within your recipe.
463 728
464 729
465- ``recipe uses DEPENDS_${PN}, should use DEPENDS [pkgvarcheck]`` 730- ``recipe uses DEPENDS:${PN}, should use DEPENDS [pkgvarcheck]``
466 731
467 This check looks for instances of setting ``DEPENDS_${PN}`` 732 This check looks for instances of setting ``DEPENDS:${PN}``
468 which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus 733 which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus
469 it is not correct to specify it for a particular package, nor will such 734 it is not correct to specify it for a particular package, nor will such
470 an assignment actually work.) Set ``DEPENDS`` instead. 735 an assignment actually work.) Set :term:`DEPENDS` instead.
471 736
737.. _qa-check-pn-overrides:
472 738
473.. _qa-check-already-stripped: 739``pn-overrides``
740----------------
474 741
475- ``File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped]`` 742``Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]``
476 743
477 Produced binaries have already been stripped prior to the build 744The specified recipe has a name (:term:`PN`) value that
478 system extracting debug symbols. It is common for upstream software 745appears in :term:`OVERRIDES`. If a recipe is named
479 projects to default to stripping debug symbols for output binaries. 746such that its :term:`PN` value matches something already in :term:`OVERRIDES`
480 In order for debugging to work on the target using ``-dbg`` packages, 747(e.g. :term:`PN` happens to be the same as :term:`MACHINE`
481 this stripping must be disabled. 748or :term:`DISTRO`), it can have unexpected
749consequences. For example, assignments such as
750``FILES:${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``.
751Rename your recipe (or if :term:`PN` is being set explicitly, change the
752:term:`PN` value) so that the conflict does not occur. See
753:term:`FILES` for additional information.
482 754
483 Depending on the build system used by the software being built, 755.. _qa-check-shebang-size:
484 disabling this stripping could be as easy as specifying an additional
485 configure option. If not, disabling stripping might involve patching
486 the build scripts. In the latter case, look for references to "strip"
487 or "STRIP", or the "-s" or "-S" command-line options being specified
488 on the linker command line (possibly through the compiler command
489 line if preceded with "-Wl,").
490 756
491 .. note:: 757``shebang-size``
758----------------
492 759
493 Disabling stripping here does not mean that the final packaged 760``<packagename>: <file> maximum shebang size exceeded, the maximum size is 128. [shebang-size]``
494 binaries will be unstripped. Once the OpenEmbedded build system
495 splits out debug symbols to the ``-dbg`` package, it will then
496 strip the symbols from the binaries.
497 761
498   762This check ensures that the shebang line (``#!`` in the first line) for a script
499.. _qa-check-packages-list: 763is not longer than 128 characters, which can cause an error at runtime depending
764on the operating system. If you are seeing this message then the specified script
765may need to be patched to have a shorter in order to avoid runtime problems.
500 766
501- ``<packagename> is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]`` 767.. _qa-check-shlib-provider:
502 768
503 Package names must appear only once in the 769Shlib provider
504 :term:`PACKAGES` variable. You might receive this 770--------------
505 error if you are attempting to add a package to ``PACKAGES`` that is
506 already in the variable's value.
507 771
508   772``<oldpackage>-<oldpkgversion> was registered as shlib provider for <library>, changing it to <newpackage>-<newpkgversion> because it was built later``
509.. _qa-check-files-invalid:
510 773
511- ``FILES variable for package <packagename> contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid]`` 774This message means that both ``<oldpackage>`` and ``<newpackage>``
775provide the specified shared library. You can expect this message
776when a recipe has been renamed. However, if that is not the case, the
777message might indicate that a private version of a library is being
778erroneously picked up as the provider for a common library. If that
779is the case, you should add the library's ``.so`` filename to
780:term:`PRIVATE_LIBS` in the recipe that provides
781the private version of the library.
512 782
513 The string "//" is invalid in a Unix path. Correct all occurrences 783.. _qa-check-space-around-equal:
514 where this string appears in a :term:`FILES` variable so
515 that there is only a single "/".
516 784
517   785``space-around-equal``
518.. _qa-check-installed-vs-shipped: 786----------------------
519 787
520- ``<recipename>: Files/directories were installed but not shipped in any package [installed-vs-shipped]`` 788``<filename>:<line number> has a lack of whitespace around the assignment: '<assignment>'``
521 789
522 Files have been installed within the 790This warning indicated that there is missing spaces around an assignment.
523 :ref:`ref-tasks-install` task but have not been
524 included in any package by way of the :term:`FILES`
525 variable. Files that do not appear in any package cannot be present
526 in an image later on in the build process. You need to do one of the
527 following:
528 791
529 - Add the files to ``FILES`` for the package you want them to appear 792For example, the following assignments would print a warning::
530 in (e.g. ``FILES_${``\ :term:`PN`\ ``}`` for the main
531 package).
532 793
533 - Delete the files at the end of the ``do_install`` task if the 794 FOO="bar"
534 files are not needed in any package. 795 FOO= "bar"
796 FOO ="bar"
535 797
536   798These should be replaced by::
537 799
538- ``<oldpackage>-<oldpkgversion> was registered as shlib provider for <library>, changing it to <newpackage>-<newpkgversion> because it was built later`` 800 FOO = "bar"
539 801
540 This message means that both ``<oldpackage>`` and ``<newpackage>`` 802.. _qa-check-src-uri-bad:
541 provide the specified shared library. You can expect this message
542 when a recipe has been renamed. However, if that is not the case, the
543 message might indicate that a private version of a library is being
544 erroneously picked up as the provider for a common library. If that
545 is the case, you should add the library's ``.so`` file name to
546 :term:`PRIVATE_LIBS` in the recipe that provides
547 the private version of the library.
548 803
804``src-uri-bad``
805---------------
549 806
550.. _qa-check-unlisted-pkg-lics: 807- ``<recipename>: SRC_URI uses unstable GitHub archives [src-uri-bad]``
551 808
552- ``LICENSE_<packagename> includes licenses (<licenses>) that are not listed in LICENSE [unlisted-pkg-lics]`` 809 GitHub provides "archive" tarballs, however these can be re-generated
810 on the fly and thus the file's signature will not necessarily match that
811 in the :term:`SRC_URI` checksums in future leading to build failures. It is
812 recommended that you use an official release tarball or switch to
813 pulling the corresponding revision in the actual git repository instead.
553 814
554 The :term:`LICENSE` of the recipe should be a superset
555 of all the licenses of all packages produced by this recipe. In other
556 words, any license in ``LICENSE_*`` should also appear in
557 :term:`LICENSE`.
558 815
816- ``SRC_URI uses PN not BPN [src-uri-bad]``
559 817
560.. _qa-check-configure-gettext: 818 If some part of :term:`SRC_URI` needs to reference the recipe name, it should do
819 so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change
820 for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND`
821 or multilib are being used. This check will fail if a reference to ``${PN}``
822 is found within the :term:`SRC_URI` value --- change it to ``${BPN}`` instead.
561 823
562- ``AM_GNU_GETTEXT used but no inherit gettext [configure-gettext]`` 824.. _qa-check-staticdev:
563 825
564 If a recipe is building something that uses automake and the automake 826``staticdev``
565 files contain an ``AM_GNU_GETTEXT`` directive then this check will fail 827-------------
566 if there is no ``inherit gettext`` statement in the recipe to ensure
567 that gettext is available during the build. Add ``inherit gettext`` to
568 remove the warning.
569 828
829``non -staticdev package contains static .a library: <packagename> path '<path>' [staticdev]``
570 830
571.. _qa-check-mime: 831Static ``.a`` library files should go into a ``-staticdev`` package.
832Change :term:`FILES` (and possibly
833:term:`PACKAGES`) such that the specified ``.a`` file
834goes into an appropriate ``-staticdev`` package.
572 835
573- ``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]`` 836.. _qa-check-symlink-to-sysroot:
574 837
575 The specified package contains mime type files (``.xml`` files in 838``symlink-to-sysroot``
576 ``${datadir}/mime/packages``) and yet does not inherit the mime 839----------------------
577 class which will ensure that these get properly installed. Either
578 add ``inherit mime`` to the recipe or remove the files at the
579 ``do_install`` step if they are not needed.
580 840
841``Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot]``
581 842
582.. _qa-check-mime-xdg: 843The specified symlink points into :term:`TMPDIR` on the
844host. Such symlinks will work on the host. However, they are clearly
845invalid when running on the target. You should either correct the
846symlink to use a relative path or remove the symlink.
583 847
584- ``package contains desktop file with key 'MimeType' but does not inhert mime-xdg: <packagename> path '<file>' [mime-xdg]`` 848.. _qa-check-recipe-naming:
585 849
586 The specified package contains a .desktop file with a 'MimeType' key 850Recipe naming
587 present, but does not inherit the mime-xdg class that is required in 851-------------
588 order for that to be activated. Either add ``inherit mime`` to the
589 recipe or remove the files at the ``do_install`` step if they are not
590 needed.
591 852
853``Recipe <recipe> appears native/nativesdk but is not, should inherit native/nativesdk``
592 854
593.. _qa-check-src-uri-bad: 855Checks that the recipe name and recipe class match, so that ``*-native``
856recipes inherit :ref:`ref-classes-native` and ``nativesdk-*`` recipes
857inherit :ref:`ref-classes-nativesdk`.
858
859.. _qa-check-rpaths:
860
861``rpaths``
862----------
863
864``package <packagename> contains bad RPATH <rpath> in file <file> [rpaths]``
594 865
595- ``<recipename>: SRC_URI uses unstable GitHub archives [src-uri-bad]`` 866The specified binary produced by the recipe contains dynamic library
867load paths (rpaths) that contain build system paths such as
868:term:`TMPDIR`, which are incorrect for the target and
869could potentially be a security issue. Check for bad ``-rpath``
870options being passed to the linker in your
871:ref:`ref-tasks-compile` log. Depending on the build
872system used by the software being built, there might be a configure
873option to disable rpath usage completely within the build of the
874software.
596 875
597 GitHub provides "archive" tarballs, however these can be re-generated 876.. _qa-check-textrel:
598 on the fly and thus the file's signature will not necessarily match that 877
599 in the SRC_URI checksums in future leading to build failures. It is 878``textrel``
600 recommended that you use an official release tarball or switch to 879-----------
601 pulling the corresponding revision in the actual git repository instead.
602 880
881``ELF binary '<file>' has relocations in .text [textrel]``
603 882
604- ``SRC_URI uses PN not BPN [src-uri-bad]`` 883The specified ELF binary contains relocations in its ``.text``
884sections. This situation can result in a performance impact at
885runtime.
605 886
606 If some part of :term:`SRC_URI` needs to reference the recipe name, it should do 887Typically, the way to solve this performance issue is to add "-fPIC"
607 so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change 888or "-fpic" to the compiler command-line options. For example, given
608 for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND` 889software that reads :term:`CFLAGS` when you build it,
609 or multilib are being used. This check will fail if a reference to ``${PN}`` 890you could add the following to your recipe::
610 is found within the ``SRC_URI`` value - change it to ``${BPN}`` instead.
611 891
892 CFLAGS:append = " -fPIC "
893
894For more information on text relocations at runtime, see
895https://www.akkadia.org/drepper/textrelocs.html.
612 896
613.. _qa-check-unhandled-features-check: 897.. _qa-check-unhandled-features-check:
614 898
615- ``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]`` 899``unhandled-features-check``
900----------------------------
616 901
617 This check ensures that if one of the variables that the :ref:`features_check <ref-classes-features_check>` 902``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]``
618 class supports (e.g. :term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe
619 inherits ``features_check`` in order for the requirement to actually work. If
620 you are seeing this message, either add ``inherit features_check`` to your recipe
621 or remove the reference to the variable if it is not needed.
622 903
904This check ensures that if one of the variables that the
905:ref:`ref-classes-features_check` class supports (e.g.
906:term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe
907inherits :ref:`ref-classes-features_check` in order for
908the requirement to actually work. If you are seeing this message, either
909add ``inherit features_check`` to your recipe or remove the reference to
910the variable if it is not needed.
623 911
624.. _qa-check-missing-update-alternatives: 912.. _qa-check-unimplemented-ptest:
625 913
626- ``<recipename>: recipe defines ALTERNATIVE_<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]`` 914``unimplemented-ptest``
915-----------------------
627 916
628 This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the 917``<tool> tests detected [unimplemented-ptest]``
629 recipe also inherits :ref:`update-alternatives <ref-classes-update-alternatives>` such
630 that the alternative will be correctly set up. If you are seeing this message, either
631 add ``inherit update-alternatives`` to your recipe or remove the reference to the variable
632 if it is not needed.
633 918
919This check will detect if the source of the package contains some
920upstream-provided tests and, if so, that ptests are implemented for this
921recipe. See the ":ref:`test-manual/ptest:testing packages with ptest`"
922section in the Yocto Project Development Tasks Manual. See also the
923":ref:`ref-classes-ptest`" section.
634 924
635.. _qa-check-shebang-size: 925.. _qa-check-unknown-configure-option:
636 926
637- ``<packagename>: <file> maximum shebang size exceeded, the maximum size is 128. [shebang-size]`` 927``unknown-configure-option``
928----------------------------
638 929
639 This check ensures that the shebang line (``#!`` in the first line) for a script 930``<recipe>: configure was passed unrecognized options: <options> [unknown-configure-option]``
640 is not longer than 128 characters, which can cause an error at runtime depending
641 on the operating system. If you are seeing this message then the specified script
642 may need to be patched to have a shorter in order to avoid runtime problems.
643 931
932The configure script is reporting that the specified options are
933unrecognized. This situation could be because the options were
934previously valid but have been removed from the configure script. Or,
935there was a mistake when the options were added and there is another
936option that should be used instead. If you are unsure, consult the
937upstream build documentation, the ``./configure --help`` output, and
938the upstream change log or release notes. Once you have worked out
939what the appropriate change is, you can update
940:term:`EXTRA_OECONF`,
941:term:`PACKAGECONFIG_CONFARGS`, or the
942individual :term:`PACKAGECONFIG` option values
943accordingly.
644 944
645.. _qa-check-perllocalpod: 945.. _qa-check-unlisted-pkg-lics:
646 946
647- ``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]`` 947``unlisted-pkg-lics``
948---------------------
648 949
649 ``perllocal.pod`` is an index file of locally installed modules and so shouldn't be 950``LICENSE:<packagename> includes licenses (<licenses>) that are not listed in LICENSE [unlisted-pkg-lics]``
650 installed by any distribution packages. The :ref:`cpan <ref-classes-cpan>` class
651 already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes,
652 but if a recipe is using ``MakeMaker`` directly then they might not be doing this
653 correctly. This check ensures that perllocal.pod is not in any package in order to
654 avoid multiple packages shipping this file and thus their packages conflicting
655 if installed together.
656 951
952The :term:`LICENSE` of the recipe should be a superset
953of all the licenses of all packages produced by this recipe. In other
954words, any license in ``LICENSE:*`` should also appear in
955:term:`LICENSE`.
657 956
658.. _qa-check-usrmerge: 957.. _qa-check-useless-rpaths:
659 958
660- ``<packagename> package is not obeying usrmerge distro feature. /<path> should be relocated to /usr. [usrmerge]`` 959``useless-rpaths``
960------------------
661 961
662 If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package 962``<packagename>: <file> contains probably-redundant RPATH <rpath> [useless-rpaths]``
663 installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this
664 message, it indicates that the ``do_install`` step (or perhaps the build process that
665 ``do_install`` is calling into, e.g. ``make install`` is using hardcoded paths instead
666 of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be
667 changed so that it does.
668 963
964The specified binary produced by the recipe contains dynamic library
965load paths (rpaths) that on a standard system are searched by default
966by the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths
967will not cause any breakage, they do waste space and are unnecessary.
968Depending on the build system used by the software being built, there
969might be a configure option to disable rpath usage completely within
970the build of the software.
669 971
670.. _qa-check-patch-fuzz: 972.. _qa-check-usrmerge:
671 973
672- ``Fuzz detected: <patch output> [patch-fuzz]`` 974``usrmerge``
975------------
673 976
674 This check looks for evidence of "fuzz" when applying patches within the ``do_patch`` 977``<packagename> package is not obeying usrmerge distro feature. /<path> should be relocated to /usr. [usrmerge]``
675 task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context
676 lines in order to apply the patch. Consider this example:
677 978
678 Patch to be applied: :: 979If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package
980installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this
981message, it indicates that the :ref:`ref-tasks-install` step (or perhaps the build process that
982:ref:`ref-tasks-install` is calling into, e.g. ``make install`` is using hardcoded paths instead
983of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be
984changed so that it does.
679 985
680 --- filename 986.. _qa-check-var-undefined:
681 +++ filename
682 context line 1
683 context line 2
684 context line 3
685 +newly added line
686 context line 4
687 context line 5
688 context line 6
689 987
690 Original source code: :: 988``var-undefined``
989-----------------
691 990
692 different context line 1 991- ``WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package [var-undefined]``
693 different context line 2
694 context line 3
695 context line 4
696 different context line 5
697 different context line 6
698 992
699 Outcome (after applying patch with fuzz): :: 993 Reports when variables fundamental to packaging (i.e. :term:`WORKDIR`,
994 :term:`DEPLOY_DIR`, :term:`D`, :term:`PN`, and :term:`PKGD`) are undefined
995 during :ref:`ref-tasks-package`.
700 996
701 different context line 1 997.. _qa-check-version-going-backwards:
702 different context line 2
703 context line 3
704 newly added line
705 context line 4
706 different context line 5
707 different context line 6
708 998
709 Chances are, the newly added line was actually added in a completely 999``version-going-backwards``
710 wrong location, or it was already in the original source and was added 1000---------------------------
711 for the second time. This is especially possible if the context line 3
712 and 4 are blank or have only generic things in them, such as ``#endif`` or ``}``.
713 Depending on the patched code, it is entirely possible for an incorrectly
714 patched file to still compile without errors.
715 1001
716 *How to eliminate patch fuzz warnings* 1002``Package version for package <package> went backwards which would break package feeds (from <version2> to <version1>) [version-going-backwards]``
717 1003
718 Use the ``devtool`` command as explained by the warning. First, unpack the 1004If the :ref:`ref-classes-buildhistory` class is enabled, reports when a
719 source into devtool workspace: :: 1005package being written out has a lower version than the previously written
1006package under the same name. If you are placing output packages into a feed
1007and upgrading packages on a target system using that feed, the version of a
1008package going backwards can result in the target system not correctly
1009upgrading to the "new" version of the package.
720 1010
721 devtool modify <recipe> 1011.. note::
722 1012
723 This will apply all of the patches, and create new commits out of them in 1013 This is only relevant when you are using runtime package management
724 the workspace - with the patch context updated. 1014 on your target system.
725 1015
726 Then, replace the patches in the recipe layer: :: 1016.. _qa-check-virtual-slash:
727 1017
728 devtool finish --force-patch-refresh <recipe> <layer_path> 1018``virtual-slash``
1019-----------------
729 1020
730 The patch updates then need be reviewed (preferably with a side-by-side diff 1021``<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. [virtual-slash]``
731 tool) to ensure they are indeed doing the right thing i.e.:
732 1022
733 #. they are applied in the correct location within the file; 1023``virtual/`` is a convention intended for use in the build context
734 #. they do not introduce duplicate lines, or otherwise do things that 1024(i.e. :term:`PROVIDES` and :term:`DEPENDS`) rather than the runtime
735 are no longer necessary. 1025context (i.e. :term:`RPROVIDES` and :term:`RDEPENDS`). Use
1026:term:`VIRTUAL-RUNTIME` variables instead for the latter.
736 1027
737 To confirm these things, you can also review the patched source code in 1028.. _qa-check-xorg-driver-abi:
738 devtool's workspace, typically in ``<build_dir>/workspace/sources/<recipe>/``
739 1029
740 Once the review is done, you can create and publish a layer commit with 1030``xorg-driver-abi``
741 the patch updates that modify the context. Devtool may also refresh 1031-------------------
742 other things in the patches, those can be discarded.
743 1032
1033``Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi]``
744 1034
1035The specified package contains an Xorg driver, but does not have a
1036corresponding ABI package dependency. The xserver-xorg recipe
1037provides driver ABI names. All drivers should depend on the ABI
1038versions that they have been built against. Driver recipes that
1039include ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
1040automatically get these versions. Consequently, you should only need
1041to explicitly add dependencies to binary driver recipes.
745 1042
746Configuring and Disabling QA Checks 1043Configuring and Disabling QA Checks
747=================================== 1044===================================
@@ -752,10 +1049,10 @@ either raise a warning or an error message, using the
752variables, respectively. You can also disable checks within a particular 1049variables, respectively. You can also disable checks within a particular
753recipe using :term:`INSANE_SKIP`. For information on 1050recipe using :term:`INSANE_SKIP`. For information on
754how to work with the QA checks, see the 1051how to work with the QA checks, see the
755":ref:`insane.bbclass <ref-classes-insane>`" section. 1052":ref:`ref-classes-insane`" section.
756 1053
757.. note:: 1054.. note::
758 1055
759 Please keep in mind that the QA checks exist in order to detect real 1056 Please keep in mind that the QA checks are meant to detect real
760 or potential problems in the packaged output. So exercise caution 1057 or potential problems in the packaged output. So exercise caution
761 when disabling these checks. 1058 when disabling these checks.