Skip to content

Commit

Permalink
build_policy=never for conan export-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded committed May 31, 2021
1 parent f022920 commit ee2cac1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions mastering/policies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ With the ``build_policy`` attribute in the `conanfile.py` the package creator ca
- ``missing``: If no binary package is found, Conan will build it without the need to invoke Conan install with :command:`--build missing`
option.
- ``always``: The package will be built always, **retrieving each time the source code** executing the "source" method.
- ``never``: (experimental) Never builds this package from source, this package can only be created with a ``conan export-pkg`` command.


.. code-block:: python
Expand Down
6 changes: 6 additions & 0 deletions reference/commands/creator/export-pkg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ There are different scenarios where this command could look like useful:
:ref:`How to package existing binaries <existing_binaries>`.


Packages created with ``conan export-pkg`` cannot be rebuilt from sources in the cache with the ``--build``
command line argument. It is possible to specify the class attribute ``build_policy="never"`` in this recipes
(this is an experimental feature) to avoid the ``--build=*`` or ``--build`` argument to try to rebuild them from sources
as part of a dependency graph.


.. note::

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

0 comments on commit ee2cac1

Please sign in to comment.