diff --git a/reference/conanfile/attributes.rst b/reference/conanfile/attributes.rst index fd3e1994324b..d05a626b43b5 100644 --- a/reference/conanfile/attributes.rst +++ b/reference/conanfile/attributes.rst @@ -126,6 +126,7 @@ recipe or the package, then it is possible to exclude them from the check with t configuration, which is a list of patterns (fnmatch) to exclude. +.. _upload_policy_attribute: upload_policy ------------- diff --git a/reference/tools/gnu/pkgconfig.rst b/reference/tools/gnu/pkgconfig.rst index f21c877f052f..43bcdb350728 100644 --- a/reference/tools/gnu/pkgconfig.rst +++ b/reference/tools/gnu/pkgconfig.rst @@ -42,12 +42,12 @@ However, ``PkgConfig`` will invoke the ``pkg-config`` executable to extract the The ``pkg-config`` executable must be available in the system path for this case, otherwise, it will fail when installing the consumed package. -Using pkg-config from Conan package instead of system ------------------------------------------------------ +Using pkg-config from Conan tool_requires instead of system +----------------------------------------------------------- .. include:: ../../../common/experimental_warning.inc -In case of not having ``pkg-config`` available in the system, it is possible to use the ``pkg-config`` executable provided by a Conan package: +In case of not having ``pkg-config`` available in the system, it is possible to use the ``pkg-config`` executable provided by Conan ``tool_requires`` instead.: .. code-block:: python @@ -80,9 +80,12 @@ when consuming the package. .. warning:: - It's not recommended to use this approach when creating a "system" package recipe, as the packaged information may not be compatible with the host system, + It's forbidden to upload or reuse this approach when creating a package, as the information may not be compatible with the host system, resulting in errors when consuming the package. + When using this approach for wrapping system packages, it is recommended to use ``upload_policy = "skip"`` + (see :ref:`upload_policy_attribute`) in the package recipe to avoid uploading the package. + Reference ---------