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