diff options
| author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2023-09-20 06:29:14 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-09-23 05:26:16 -1000 |
| commit | 870c6a73a732a474f307d7829b1947a5887e4d1d (patch) | |
| tree | 45779ad35ce7892ae74486686925618b711023ac | |
| parent | 131beeedb6f7b4e8dd2f4d929c222b19bc3ce3fa (diff) | |
| download | poky-870c6a73a732a474f307d7829b1947a5887e4d1d.tar.gz | |
ref-manual: qa-checks: align with master
(From yocto-docs rev: 56bbfab163a6b42aaa32d9350f30b2414a60fc75)
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | documentation/ref-manual/qa-checks.rst | 87 |
1 files changed, 64 insertions, 23 deletions
diff --git a/documentation/ref-manual/qa-checks.rst b/documentation/ref-manual/qa-checks.rst index 8c475d0f72..4a02e7206a 100644 --- a/documentation/ref-manual/qa-checks.rst +++ b/documentation/ref-manual/qa-checks.rst | |||
| @@ -162,7 +162,7 @@ Errors and Warnings | |||
| 162 | normally expected to be empty (such as ``/tmp``). These files may | 162 | normally expected to be empty (such as ``/tmp``). These files may |
| 163 | be more appropriately installed to a different location, or | 163 | be more appropriately installed to a different location, or |
| 164 | perhaps alternatively not installed at all, usually by updating the | 164 | perhaps alternatively not installed at all, usually by updating the |
| 165 | ``do_install`` task/function. | 165 | :ref:`ref-tasks-install` task/function. |
| 166 | 166 | ||
| 167 | .. _qa-check-arch: | 167 | .. _qa-check-arch: |
| 168 | 168 | ||
| @@ -536,7 +536,7 @@ Errors and Warnings | |||
| 536 | in (e.g. ``FILES:${``\ :term:`PN`\ ``}`` for the main | 536 | in (e.g. ``FILES:${``\ :term:`PN`\ ``}`` for the main |
| 537 | package). | 537 | package). |
| 538 | 538 | ||
| 539 | - Delete the files at the end of the ``do_install`` task if the | 539 | - Delete the files at the end of the :ref:`ref-tasks-install` task if the |
| 540 | files are not needed in any package. | 540 | files are not needed in any package. |
| 541 | 541 | ||
| 542 | 542 | ||
| @@ -579,10 +579,10 @@ Errors and Warnings | |||
| 579 | - ``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]`` | 579 | - ``package contains mime types but does not inherit mime: <packagename> path '<file>' [mime]`` |
| 580 | 580 | ||
| 581 | The specified package contains mime type files (``.xml`` files in | 581 | The specified package contains mime type files (``.xml`` files in |
| 582 | ``${datadir}/mime/packages``) and yet does not inherit the mime | 582 | ``${datadir}/mime/packages``) and yet does not inherit the |
| 583 | class which will ensure that these get properly installed. Either | 583 | :ref:`ref-classes-mime` class which will ensure that these get |
| 584 | add ``inherit mime`` to the recipe or remove the files at the | 584 | properly installed. Either add ``inherit mime`` to the recipe or remove the |
| 585 | ``do_install`` step if they are not needed. | 585 | files at the :ref:`ref-tasks-install` step if they are not needed. |
| 586 | 586 | ||
| 587 | 587 | ||
| 588 | .. _qa-check-mime-xdg: | 588 | .. _qa-check-mime-xdg: |
| @@ -590,10 +590,10 @@ Errors and Warnings | |||
| 590 | - ``package contains desktop file with key 'MimeType' but does not inhert mime-xdg: <packagename> path '<file>' [mime-xdg]`` | 590 | - ``package contains desktop file with key 'MimeType' but does not inhert mime-xdg: <packagename> path '<file>' [mime-xdg]`` |
| 591 | 591 | ||
| 592 | The specified package contains a .desktop file with a 'MimeType' key | 592 | The specified package contains a .desktop file with a 'MimeType' key |
| 593 | present, but does not inherit the mime-xdg class that is required in | 593 | present, but does not inherit the :ref:`ref-classes-mime-xdg` |
| 594 | order for that to be activated. Either add ``inherit mime`` to the | 594 | class that is required in order for that to be activated. Either add |
| 595 | recipe or remove the files at the ``do_install`` step if they are not | 595 | ``inherit mime`` to the recipe or remove the files at the |
| 596 | needed. | 596 | :ref:`ref-tasks-install` step if they are not needed. |
| 597 | 597 | ||
| 598 | 598 | ||
| 599 | .. _qa-check-src-uri-bad: | 599 | .. _qa-check-src-uri-bad: |
| @@ -602,7 +602,7 @@ Errors and Warnings | |||
| 602 | 602 | ||
| 603 | GitHub provides "archive" tarballs, however these can be re-generated | 603 | GitHub provides "archive" tarballs, however these can be re-generated |
| 604 | on the fly and thus the file's signature will not necessarily match that | 604 | on the fly and thus the file's signature will not necessarily match that |
| 605 | in the SRC_URI checksums in future leading to build failures. It is | 605 | in the :term:`SRC_URI` checksums in future leading to build failures. It is |
| 606 | recommended that you use an official release tarball or switch to | 606 | recommended that you use an official release tarball or switch to |
| 607 | pulling the corresponding revision in the actual git repository instead. | 607 | pulling the corresponding revision in the actual git repository instead. |
| 608 | 608 | ||
| @@ -613,18 +613,20 @@ Errors and Warnings | |||
| 613 | so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change | 613 | so using ${:term:`BPN`} rather than ${:term:`PN`} as the latter will change |
| 614 | for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND` | 614 | for different variants of the same recipe e.g. when :term:`BBCLASSEXTEND` |
| 615 | or multilib are being used. This check will fail if a reference to ``${PN}`` | 615 | or multilib are being used. This check will fail if a reference to ``${PN}`` |
| 616 | is found within the :term:`SRC_URI` value - change it to ``${BPN}`` instead. | 616 | is found within the :term:`SRC_URI` value --- change it to ``${BPN}`` instead. |
| 617 | 617 | ||
| 618 | 618 | ||
| 619 | .. _qa-check-unhandled-features-check: | 619 | .. _qa-check-unhandled-features-check: |
| 620 | 620 | ||
| 621 | - ``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]`` | 621 | - ``<recipename>: recipe doesn't inherit features_check [unhandled-features-check]`` |
| 622 | 622 | ||
| 623 | This check ensures that if one of the variables that the :ref:`features_check <ref-classes-features_check>` | 623 | This check ensures that if one of the variables that the |
| 624 | class supports (e.g. :term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe | 624 | :ref:`ref-classes-features_check` class supports (e.g. |
| 625 | inherits ``features_check`` in order for the requirement to actually work. If | 625 | :term:`REQUIRED_DISTRO_FEATURES`) is used, then the recipe |
| 626 | you are seeing this message, either add ``inherit features_check`` to your recipe | 626 | inherits :ref:`ref-classes-features_check` in order for |
| 627 | or remove the reference to the variable if it is not needed. | 627 | the requirement to actually work. If you are seeing this message, either |
| 628 | add ``inherit features_check`` to your recipe or remove the reference to | ||
| 629 | the variable if it is not needed. | ||
| 628 | 630 | ||
| 629 | 631 | ||
| 630 | .. _qa-check-missing-update-alternatives: | 632 | .. _qa-check-missing-update-alternatives: |
| @@ -632,7 +634,7 @@ Errors and Warnings | |||
| 632 | - ``<recipename>: recipe defines ALTERNATIVE:<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]`` | 634 | - ``<recipename>: recipe defines ALTERNATIVE:<packagename> but doesn't inherit update-alternatives. This might fail during do_rootfs later! [missing-update-alternatives]`` |
| 633 | 635 | ||
| 634 | This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the | 636 | This check ensures that if a recipe sets the :term:`ALTERNATIVE` variable that the |
| 635 | recipe also inherits :ref:`update-alternatives <ref-classes-update-alternatives>` such | 637 | recipe also inherits :ref:`ref-classes-update-alternatives` such |
| 636 | that the alternative will be correctly set up. If you are seeing this message, either | 638 | that the alternative will be correctly set up. If you are seeing this message, either |
| 637 | add ``inherit update-alternatives`` to your recipe or remove the reference to the variable | 639 | add ``inherit update-alternatives`` to your recipe or remove the reference to the variable |
| 638 | if it is not needed. | 640 | if it is not needed. |
| @@ -653,7 +655,7 @@ Errors and Warnings | |||
| 653 | - ``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]`` | 655 | - ``<packagename> contains perllocal.pod (<files>), should not be installed [perllocalpod]`` |
| 654 | 656 | ||
| 655 | ``perllocal.pod`` is an index file of locally installed modules and so shouldn't be | 657 | ``perllocal.pod`` is an index file of locally installed modules and so shouldn't be |
| 656 | installed by any distribution packages. The :ref:`cpan <ref-classes-cpan>` class | 658 | installed by any distribution packages. The :ref:`ref-classes-cpan` class |
| 657 | already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes, | 659 | already sets ``NO_PERLLOCAL`` to stop this file being generated by most Perl recipes, |
| 658 | but if a recipe is using ``MakeMaker`` directly then they might not be doing this | 660 | but if a recipe is using ``MakeMaker`` directly then they might not be doing this |
| 659 | correctly. This check ensures that perllocal.pod is not in any package in order to | 661 | correctly. This check ensures that perllocal.pod is not in any package in order to |
| @@ -667,8 +669,8 @@ Errors and Warnings | |||
| 667 | 669 | ||
| 668 | If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package | 670 | If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this check will ensure that no package |
| 669 | installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this | 671 | installs files to root (``/bin``, ``/sbin``, ``/lib``, ``/lib64``) directories. If you are seeing this |
| 670 | message, it indicates that the ``do_install`` step (or perhaps the build process that | 672 | message, it indicates that the :ref:`ref-tasks-install` step (or perhaps the build process that |
| 671 | ``do_install`` is calling into, e.g. ``make install`` is using hardcoded paths instead | 673 | :ref:`ref-tasks-install` is calling into, e.g. ``make install`` is using hardcoded paths instead |
| 672 | of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be | 674 | of the variables set up for this (``bindir``, ``sbindir``, etc.), and should be |
| 673 | changed so that it does. | 675 | changed so that it does. |
| 674 | 676 | ||
| @@ -677,7 +679,7 @@ Errors and Warnings | |||
| 677 | 679 | ||
| 678 | - ``Fuzz detected: <patch output> [patch-fuzz]`` | 680 | - ``Fuzz detected: <patch output> [patch-fuzz]`` |
| 679 | 681 | ||
| 680 | This check looks for evidence of "fuzz" when applying patches within the ``do_patch`` | 682 | This check looks for evidence of "fuzz" when applying patches within the :ref:`ref-tasks-patch` |
| 681 | task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context | 683 | task. Patch fuzz is a situation when the ``patch`` tool ignores some of the context |
| 682 | lines in order to apply the patch. Consider this example: | 684 | lines in order to apply the patch. Consider this example: |
| 683 | 685 | ||
| @@ -727,7 +729,7 @@ Errors and Warnings | |||
| 727 | devtool modify <recipe> | 729 | devtool modify <recipe> |
| 728 | 730 | ||
| 729 | This will apply all of the patches, and create new commits out of them in | 731 | This will apply all of the patches, and create new commits out of them in |
| 730 | the workspace - with the patch context updated. | 732 | the workspace --- with the patch context updated. |
| 731 | 733 | ||
| 732 | Then, replace the patches in the recipe layer:: | 734 | Then, replace the patches in the recipe layer:: |
| 733 | 735 | ||
| @@ -748,6 +750,45 @@ Errors and Warnings | |||
| 748 | other things in the patches, those can be discarded. | 750 | other things in the patches, those can be discarded. |
| 749 | 751 | ||
| 750 | 752 | ||
| 753 | .. _qa-check-patch-status: | ||
| 754 | |||
| 755 | - ``Missing Upstream-Status in patch <patchfile> Please add according to <url> [patch-status-core/patch-status-noncore]`` | ||
| 756 | |||
| 757 | The ``Upstream-Status`` value is missing in the specified patch file's header. | ||
| 758 | This value is intended to track whether or not the patch has been sent | ||
| 759 | upstream, whether or not it has been merged, etc. | ||
| 760 | |||
| 761 | There are two options for this same check - ``patch-status-core`` (for | ||
| 762 | recipes in OE-Core) and ``patch-status-noncore`` (for recipes in any other | ||
| 763 | layer). | ||
| 764 | |||
| 765 | For more information, see the | ||
| 766 | ":ref:`contributor-guide/recipe-style-guide:patch upstream status`" | ||
| 767 | section in the Yocto Project and OpenEmbedded Contributor Guide. | ||
| 768 | |||
| 769 | - ``Malformed Upstream-Status in patch <patchfile> Please correct according to <url> [patch-status-core/patch-status-noncore]`` | ||
| 770 | |||
| 771 | The ``Upstream-Status`` value in the specified patch file's header is invalid - | ||
| 772 | it must be a specific format. See the "Missing Upstream-Status" entry above | ||
| 773 | for more information. | ||
| 774 | |||
| 775 | |||
| 776 | .. _qa-check-buildpaths: | ||
| 777 | |||
| 778 | - ``File <filename> in package <packagename> contains reference to TMPDIR [buildpaths]`` | ||
| 779 | |||
| 780 | This check ensures that build system paths (including :term:`TMPDIR`) do not | ||
| 781 | appear in output files, which not only leaks build system configuration into | ||
| 782 | the target, but also hinders binary reproducibility as the output will change | ||
| 783 | if the build system configuration changes. | ||
| 784 | |||
| 785 | Typically these paths will enter the output through some mechanism in the | ||
| 786 | configuration or compilation of the software being built by the recipe. To | ||
| 787 | resolve this issue you will need to determine how the detected path is | ||
| 788 | entering the output. Sometimes it may require adjusting scripts or code to | ||
| 789 | use a relative path rather than an absolute one, or to pick up the path from | ||
| 790 | runtime configuration or environment variables. | ||
| 791 | |||
| 751 | 792 | ||
| 752 | Configuring and Disabling QA Checks | 793 | Configuring and Disabling QA Checks |
| 753 | =================================== | 794 | =================================== |
