From 96dea81cdd0645b82cca848840615ce88c034908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 13 Jun 2024 14:38:54 +0200 Subject: [PATCH] Add warning about not having conditional source methods --- reference/conanfile/methods/source.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/conanfile/methods/source.rst b/reference/conanfile/methods/source.rst index 8da62d1aa929..6adea805b516 100644 --- a/reference/conanfile/methods/source.rst +++ b/reference/conanfile/methods/source.rst @@ -14,6 +14,10 @@ The ``source()`` method can implement different strategies for retrieving the so - Executing a ``download()`` + ``unzip()`` or a combined ``get()`` (internally does download + unzip) to download a tarball, tgz, or zip archive. - Fetching the source code for itself, from its repository, whose coordinates have been captured in the ``conandata.yml`` file in the ``export()`` method. This is the strategy that would be used to manage the source code for packages in which the ``conanfile.py`` lives in the package itself, but that for some reason we don't want to put the source code in the recipe (like not distributing our source code, but being able to distribute our package binaries). +.. note:: + + The ``source()`` method _MUST NOT_ be conditional to any configuration, so it should be the same for all configurations. + Settings and options access is disallowed in this method, and recipes should not set any conditionals based on the platform either The ``source()`` method executes in the ``self.source_folder``, the current working directory will be equal to that folder (which value is derived from ``layout()`` method).