You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/conanfile/methods/build_requirements.rst
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,19 @@ should the *requires* and *tool_requires* have different names. For instance:
110
110
If we want to also keep the same ``user`` and ``channel`` fields, we'd need to
111
111
specify it in the tool requirements reference as well, i.e., ``self.tool_requires("protobuf/<host_version>@mycompany/fork")``.
112
112
113
+
The ``<host_version>`` feature also works when the requirement is replaced using the :ref:`[replace_requires]<reference_config_files_profiles_replace_requires>`
114
+
section in your profile, so that the replaced version would be used in both contexts at once.
115
+
116
+
.. note::
117
+
118
+
If your ``[replace_requires]`` is replacing not only the version, but also the ``user``/``channel`` fields,
119
+
(so for example replacing ``protobuf/*: protobuf/3.18.1@mycompany/fork``)
120
+
and you would like to also use the same ``user`` and ``channel`` fields in the build context,
121
+
you should use the :ref:`[replace_tool_requires]<reference_config_files_profiles_replace_tool_requires>`
122
+
to replace it in the build context as well, otherwise the ``<host_version>`` will look for
123
+
``protobuf/3.18.1`` without the ``user`` and ``channel`` fields in the build context as explained in the previous warning,
0 commit comments