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

exports conf #3703

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions reference/conanfile/methods/export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ There are 2 files that are always exported to the cache, without being explicitl
**Best practices**

- The recipe files must be configuration independent. Those files are common for all configurations, thus it is not possible to do conditional ``export()`` to different settings, options, or platforms. Do not try to do any kind of conditional export. If necessary export all the files necessary for all configurations at once.
- The ``export()`` method does not receive any information from profiles, not even ``conf``. Only the ``global.conf`` will be available, and in any case it is not possible to use that ``conf`` to define conditionals.
- Keep the ``export()`` method simple. Its intention is to copy files from the user folder to the cache to store those files together with the recipe.
- The exported files must be small. Exporting big files with the recipe will make the resolution of dependencies much slower the resolution.
- Only files that are necessary for the evaluation of the ``conanfile.py`` recipe must be exported with this method. Files necessary for building from sources should be exported with the ``exports_sources`` attribute or the :ref:`export_source()<reference_conanfile_methods_export_sources>` method.
7 changes: 3 additions & 4 deletions reference/conanfile/methods/export_sources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ in the ``conandata.yml`` file, which could be later applied with ``apply_conanda

**Best practices**

The recipe sources must be configuration independent. Those sources are common for all configurations,
thus it is not possible to do conditional ``export_sources()`` to different settings, options, or
platforms. Do not try to do any kind of conditional export. If necessary export all the files necessary for
all configurations at once.
- The recipe sources must be configuration independent. Those sources are common for all configurations, thus it is not possible to do conditional ``export_sources()`` to different settings, options, or platforms. Do not try to do any kind of conditional export. If necessary export all the files necessary for all configurations at once.
- The ``export_sources()`` method does not receive any information from profiles, not even ``conf``. Only the ``global.conf`` will be available, and in any case it is not possible to use that ``conf`` to define conditionals.
- Keep the ``export_source()`` method simple. Its intention is to copy files from the user folder to the cache to store those files together with the recipe.