Skip to content

Commit ad42ed2

Browse files
authored
Merge pull request #2106 from memsharded/feature/build_policy_never
build_policy=never for conan export-pkg
2 parents 8634d99 + e050972 commit ad42ed2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mastering/policies.rst

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ With the ``build_policy`` attribute in the `conanfile.py` the package creator ca
2121
- ``missing``: If no binary package is found, Conan will build it without the need to invoke Conan install with :command:`--build missing`
2222
option.
2323
- ``always``: The package will be built always, **retrieving each time the source code** executing the "source" method.
24+
- ``never``: (experimental, available from Conan 1.37) Never builds this package from source, this package can only be created with a ``conan export-pkg`` command.
2425

2526

2627
.. code-block:: python

reference/commands/creator/export-pkg.rst

+6
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ There are different scenarios where this command could look like useful:
137137
:ref:`How to package existing binaries <existing_binaries>`.
138138

139139

140+
Packages created with ``conan export-pkg`` cannot be rebuilt from sources in the cache with the ``--build``
141+
command line argument. It is possible to specify the class attribute ``build_policy="never"`` in this recipes
142+
(this is an experimental feature, available from Conan 1.37) to avoid the ``--build=*`` or ``--build`` argument to try to rebuild them from sources
143+
as part of a dependency graph.
144+
145+
140146
.. note::
141147

142148
Note that if :command:`--profile`, settings or options are not provided to :command:`export-pkg`,

0 commit comments

Comments
 (0)