Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new skip confs #3883

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reference/conanfile/methods/build_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ For simple cases the attribute syntax can be enough, like ``tool_requires = "cma

The ``tool_requires`` and ``test_requires`` methods are just a specialized instance of ``requires`` with some predefined trait values. See the :ref:`requires() reference<reference_conanfile_methods_requirements>` for more information about traits.

There are 2 **experimental** ``confs`` that can be used to avoid the expansion of these type of requirements:
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved

- ``tools.graph:skip_build`` allows to skip ``tool_requires`` dependencies completely. This can be done if two conditions are met: the packages requiring these tools do not need to be built from sources, and the tool requirements do not affect the consumers ``package_id``. If this happens, Conan will raise an error.
- ``tools.graph:skip_test`` allows to skip ``test_requires`` dependencies completely. If these dependencies are skipped, but then some package needs to be built from source and ``tools.build:skip_test`` was not activated, it will fail to locate the ``test_requires``. So in most cases, the ``tools.build:skip_test`` should also be defined.

Note that if tool and/or test requirements are skipped they will not be part of the dependency graph, and they will not become part of possible generated lockfiles or package lists, with a potential impact on future reproducibility. Also, in most cases, Conan is able to mark tool and test requirements as unnecessary (``Skip``), avoiding the download of the heavy binaries, just downloading the recipe which is usually very fast. That means that in most cases these ``confs`` are not necessary and the Conan defaults are good, please use them being aware of the tradeoffs.


.. _reference_conanfile_methods_build_requirements_tool_requires:

tool_requires()
Expand Down