summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/classes.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/ref-manual/classes.rst')
-rw-r--r--documentation/ref-manual/classes.rst317
1 files changed, 2 insertions, 315 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index c0d7373c79..ee583fe9ba 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1345,321 +1345,8 @@ are meant to detect real or potential problems in the packaged
1345output. So exercise caution when disabling these checks. 1345output. So exercise caution when disabling these checks.
1346 1346
1347The tests you can list with the :term:`WARN_QA` and 1347The tests you can list with the :term:`WARN_QA` and
1348:term:`ERROR_QA` variables are: 1348:term:`ERROR_QA` variables are documented in the :doc:`/ref-manual/qa-checks`
1349 1349document of the Yocto Project Reference Manual.
1350- ``already-stripped:`` Checks that produced binaries have not
1351 already been stripped prior to the build system extracting debug
1352 symbols. It is common for upstream software projects to default to
1353 stripping debug symbols for output binaries. In order for debugging
1354 to work on the target using ``-dbg`` packages, this stripping must be
1355 disabled.
1356
1357- ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit
1358 size, and endianness of any binaries to ensure they match the target
1359 architecture. This test fails if any binaries do not match the type
1360 since there would be an incompatibility. The test could indicate that
1361 the wrong compiler or compiler options have been used. Sometimes
1362 software, like bootloaders, might need to bypass this check.
1363
1364- ``buildpaths:`` Checks for paths to locations on the build host
1365 inside the output files. Not only can these leak information about
1366 the build environment, they also hinder binary reproducibility.
1367
1368- ``build-deps:`` Determines if a build-time dependency that is
1369 specified through :term:`DEPENDS`, explicit
1370 :term:`RDEPENDS`, or task-level dependencies exists
1371 to match any runtime dependency. This determination is particularly
1372 useful to discover where runtime dependencies are detected and added
1373 during packaging. If no explicit dependency has been specified within
1374 the metadata, at the packaging stage it is too late to ensure that
1375 the dependency is built, and thus you can end up with an error when
1376 the package is installed into the image during the
1377 :ref:`ref-tasks-rootfs` task because the auto-detected
1378 dependency was not satisfied. An example of this would be where the
1379 :ref:`ref-classes-update-rc.d` class automatically
1380 adds a dependency on the ``initscripts-functions`` package to
1381 packages that install an initscript that refers to
1382 ``/etc/init.d/functions``. The recipe should really have an explicit
1383 :term:`RDEPENDS` for the package in question on ``initscripts-functions``
1384 so that the OpenEmbedded build system is able to ensure that the
1385 ``initscripts`` recipe is actually built and thus the
1386 ``initscripts-functions`` package is made available.
1387
1388- ``configure-gettext:`` Checks that if a recipe is building something
1389 that uses automake and the automake files contain an ``AM_GNU_GETTEXT``
1390 directive, that the recipe also inherits the :ref:`ref-classes-gettext`
1391 class to ensure that gettext is available during the build.
1392
1393- ``debug-deps:`` Checks that all packages except ``-dbg`` packages
1394 do not depend on ``-dbg`` packages, which would cause a packaging
1395 bug.
1396
1397- ``debug-files:`` Checks for ``.debug`` directories in anything but
1398 the ``-dbg`` package. The debug files should all be in the ``-dbg``
1399 package. Thus, anything packaged elsewhere is incorrect packaging.
1400
1401- ``dep-cmp:`` Checks for invalid version comparison statements in
1402 runtime dependency relationships between packages (i.e. in
1403 :term:`RDEPENDS`,
1404 :term:`RRECOMMENDS`,
1405 :term:`RSUGGESTS`,
1406 :term:`RPROVIDES`,
1407 :term:`RREPLACES`, and
1408 :term:`RCONFLICTS` variable values). Any invalid
1409 comparisons might trigger failures or undesirable behavior when
1410 passed to the package manager.
1411
1412- ``desktop:`` Runs the ``desktop-file-validate`` program against any
1413 ``.desktop`` files to validate their contents against the
1414 specification for ``.desktop`` files.
1415
1416- ``dev-deps:`` Checks that all packages except ``-dev`` or
1417 ``-staticdev`` packages do not depend on ``-dev`` packages, which
1418 would be a packaging bug.
1419
1420- ``dev-so:`` Checks that the ``.so`` symbolic links are in the
1421 ``-dev`` package and not in any of the other packages. In general,
1422 these symlinks are only useful for development purposes. Thus, the
1423 ``-dev`` package is the correct location for them. In very rare
1424 cases, such as dynamically loaded modules, these symlinks
1425 are needed instead in the main package.
1426
1427- ``empty-dirs:`` Checks that packages are not installing files to
1428 directories that are normally expected to be empty (such as ``/tmp``)
1429 The list of directories that are checked is specified by the
1430 :term:`QA_EMPTY_DIRS` variable.
1431
1432- ``file-rdeps:`` Checks that file-level dependencies identified by
1433 the OpenEmbedded build system at packaging time are satisfied. For
1434 example, a shell script might start with the line ``#!/bin/bash``.
1435 This line would translate to a file dependency on ``/bin/bash``. Of
1436 the three package managers that the OpenEmbedded build system
1437 supports, only RPM directly handles file-level dependencies,
1438 resolving them automatically to packages providing the files.
1439 However, the lack of that functionality in the other two package
1440 managers does not mean the dependencies do not still need resolving.
1441 This QA check attempts to ensure that explicitly declared
1442 :term:`RDEPENDS` exist to handle any file-level
1443 dependency detected in packaged files.
1444
1445- ``files-invalid:`` Checks for :term:`FILES` variable
1446 values that contain "//", which is invalid.
1447
1448- ``host-user-contaminated:`` Checks that no package produced by the
1449 recipe contains any files outside of ``/home`` with a user or group
1450 ID that matches the user running BitBake. A match usually indicates
1451 that the files are being installed with an incorrect UID/GID, since
1452 target IDs are independent from host IDs. For additional information,
1453 see the section describing the
1454 :ref:`ref-tasks-install` task.
1455
1456- ``incompatible-license:`` Report when packages are excluded from
1457 being created due to being marked with a license that is in
1458 :term:`INCOMPATIBLE_LICENSE`.
1459
1460- ``installed-vs-shipped:`` Reports when files have been installed
1461 within :ref:`ref-tasks-install` but have not been included in any package by
1462 way of the :term:`FILES` variable. Files that do not
1463 appear in any package cannot be present in an image later on in the
1464 build process. Ideally, all installed files should be packaged or not
1465 installed at all. These files can be deleted at the end of
1466 :ref:`ref-tasks-install` if the files are not needed in any package.
1467
1468- ``invalid-chars:`` Checks that the recipe metadata variables
1469 :term:`DESCRIPTION`,
1470 :term:`SUMMARY`, :term:`LICENSE`, and
1471 :term:`SECTION` do not contain non-UTF-8 characters.
1472 Some package managers do not support such characters.
1473
1474- ``invalid-packageconfig:`` Checks that no undefined features are
1475 being added to :term:`PACKAGECONFIG`. For
1476 example, any name "foo" for which the following form does not exist::
1477
1478 PACKAGECONFIG[foo] = "..."
1479
1480- ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la``
1481 file containing these paths is incorrect since ``libtool`` adds the
1482 correct sysroot prefix when using the files automatically itself.
1483
1484- ``ldflags:`` Ensures that the binaries were linked with the
1485 :term:`LDFLAGS` options provided by the build system.
1486 If this test fails, check that the :term:`LDFLAGS` variable is being
1487 passed to the linker command.
1488
1489- ``libdir:`` Checks for libraries being installed into incorrect
1490 (possibly hardcoded) installation paths. For example, this test will
1491 catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
1492 "lib32". Another example is when recipes install
1493 ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib".
1494
1495- ``libexec:`` Checks if a package contains files in
1496 ``/usr/libexec``. This check is not performed if the ``libexecdir``
1497 variable has been set explicitly to ``/usr/libexec``.
1498
1499- ``mime:`` Check that if a package contains mime type files (``.xml``
1500 files in ``${datadir}/mime/packages``) that the recipe also inherits
1501 the :ref:`ref-classes-mime` class in order to ensure that these get
1502 properly installed.
1503
1504- ``mime-xdg:`` Checks that if a package contains a .desktop file with a
1505 'MimeType' key present, that the recipe inherits the
1506 :ref:`ref-classes-mime-xdg` class that is required in order for that
1507 to be activated.
1508
1509- ``missing-update-alternatives:`` Check that if a recipe sets the
1510 :term:`ALTERNATIVE` variable that the recipe also inherits
1511 :ref:`ref-classes-update-alternatives` such that the alternative will
1512 be correctly set up.
1513
1514- ``packages-list:`` Checks for the same package being listed
1515 multiple times through the :term:`PACKAGES` variable
1516 value. Installing the package in this manner can cause errors during
1517 packaging.
1518
1519- ``patch-fuzz:`` Checks for fuzz in patch files that may allow
1520 them to apply incorrectly if the underlying code changes.
1521
1522- ``patch-status:`` Checks that the ``Upstream-Status`` is specified and valid
1523 in the headers of patches for recipes.
1524
1525- ``pep517-backend:`` checks that a recipe inheriting
1526 :ref:`ref-classes-setuptools3` has a PEP517-compliant backend.
1527
1528- ``perllocalpod:`` Checks for ``perllocal.pod`` being erroneously
1529 installed and packaged by a recipe.
1530
1531- ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an
1532 invalid format.
1533
1534- ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an
1535 invalid format.
1536
1537- ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify
1538 'link' where the specified target already exists.
1539
1540- ``perms:`` Currently, this check is unused but reserved.
1541
1542- ``pkgconfig:`` Checks ``.pc`` files for any
1543 :term:`TMPDIR`/:term:`WORKDIR` paths.
1544 Any ``.pc`` file containing these paths is incorrect since
1545 ``pkg-config`` itself adds the correct sysroot prefix when the files
1546 are accessed.
1547
1548- ``pkgname:`` Checks that all packages in
1549 :term:`PACKAGES` have names that do not contain
1550 invalid characters (i.e. characters other than 0-9, a-z, ., +, and
1551 -).
1552
1553- ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is
1554 undefined during :ref:`ref-tasks-package`.
1555
1556- ``pkgvarcheck:`` Checks through the variables
1557 :term:`RDEPENDS`,
1558 :term:`RRECOMMENDS`,
1559 :term:`RSUGGESTS`,
1560 :term:`RCONFLICTS`,
1561 :term:`RPROVIDES`,
1562 :term:`RREPLACES`, :term:`FILES`,
1563 :term:`ALLOW_EMPTY`, ``pkg_preinst``,
1564 ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if
1565 there are variable sets that are not package-specific. Using these
1566 variables without a package suffix is bad practice, and might
1567 unnecessarily complicate dependencies of other packages within the
1568 same recipe or have other unintended consequences.
1569
1570- ``pn-overrides:`` Checks that a recipe does not have a name
1571 (:term:`PN`) value that appears in
1572 :term:`OVERRIDES`. If a recipe is named such that
1573 its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g.
1574 :term:`PN` happens to be the same as :term:`MACHINE` or
1575 :term:`DISTRO`), it can have unexpected consequences.
1576 For example, assignments such as ``FILES:${PN} = "xyz"`` effectively
1577 turn into ``FILES = "xyz"``.
1578
1579- ``recipe-naming:`` Checks that the recipe name and recipe class match, so
1580 that ``*-native`` recipes inherit :ref:`ref-classes-native` and
1581 ``nativesdk-*`` recipes inherit :ref:`ref-classes-nativesdk`.
1582
1583- ``rpaths:`` Checks for rpaths in the binaries that contain build
1584 system paths such as :term:`TMPDIR`. If this test fails, bad ``-rpath``
1585 options are being passed to the linker commands and your binaries
1586 have potential security issues.
1587
1588- ``shebang-size:`` Check that the shebang line (``#!`` in the first line)
1589 in a packaged script is not longer than 128 characters, which can cause
1590 an error at runtime depending on the operating system.
1591
1592- ``staticdev:`` Checks for static library files (``*.a``) in
1593 non-``staticdev`` packages.
1594
1595- ``src-uri-bad:`` Checks that the :term:`SRC_URI` value set by a recipe
1596 does not contain a reference to ``${PN}`` (instead of the correct
1597 ``${BPN}``) nor refers to unstable Github archive tarballs.
1598
1599- ``symlink-to-sysroot:`` Checks for symlinks in packages that point
1600 into :term:`TMPDIR` on the host. Such symlinks will
1601 work on the host, but are clearly invalid when running on the target.
1602
1603- ``textrel:`` Checks for ELF binaries that contain relocations in
1604 their ``.text`` sections, which can result in a performance impact at
1605 runtime. See the explanation for the ``ELF binary`` message in
1606 ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance
1607 issues.
1608
1609- ``unhandled-features-check:`` check that if one of the variables that
1610 the :ref:`ref-classes-features_check` class supports (e.g.
1611 :term:`REQUIRED_DISTRO_FEATURES`) is set by a recipe, then the recipe
1612 also inherits :ref:`ref-classes-features_check` in order for the
1613 requirement to actually work.
1614
1615- ``unimplemented-ptest:`` Checks that ptests are implemented for upstream
1616 tests.
1617
1618- ``unlisted-pkg-lics:`` Checks that all declared licenses applying
1619 for a package are also declared on the recipe level (i.e. any license
1620 in ``LICENSE:*`` should appear in :term:`LICENSE`).
1621
1622- ``useless-rpaths:`` Checks for dynamic library load paths (rpaths)
1623 in the binaries that by default on a standard system are searched by
1624 the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will
1625 not cause any breakage, they do waste space and are unnecessary.
1626
1627- ``usrmerge:`` If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this
1628 check will ensure that no package installs files to root (``/bin``,
1629 ``/sbin``, ``/lib``, ``/lib64``) directories.
1630
1631- ``var-undefined:`` Reports when variables fundamental to packaging
1632 (i.e. :term:`WORKDIR`,
1633 :term:`DEPLOY_DIR`, :term:`D`,
1634 :term:`PN`, and :term:`PKGD`) are undefined
1635 during :ref:`ref-tasks-package`.
1636
1637- ``version-going-backwards:`` If the :ref:`ref-classes-buildhistory`
1638 class is enabled, reports when a package being written out has a lower
1639 version than the previously written package under the same name. If
1640 you are placing output packages into a feed and upgrading packages on
1641 a target system using that feed, the version of a package going
1642 backwards can result in the target system not correctly upgrading to
1643 the "new" version of the package.
1644
1645 .. note::
1646
1647 This is only relevant when you are using runtime package management
1648 on your target system.
1649
1650- ``virtual-slash:`` Checks to see if ``virtual/`` is being used in
1651 :term:`RDEPENDS` or :term:`RPROVIDES`, which is not good practice ---
1652 ``virtual/`` is a convention intended for use in the build context
1653 (i.e. :term:`PROVIDES` and :term:`DEPENDS`) rather than the runtime
1654 context.
1655
1656- ``xorg-driver-abi:`` Checks that all packages containing Xorg
1657 drivers have ABI dependencies. The ``xserver-xorg`` recipe provides
1658 driver ABI names. All drivers should depend on the ABI versions that
1659 they have been built against. Driver recipes that include
1660 ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
1661 automatically get these versions. Consequently, you should only need
1662 to explicitly add dependencies to binary driver recipes.
1663 1350
1664.. _ref-classes-kernel: 1351.. _ref-classes-kernel:
1665 1352