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

Docs for source_buildenv #3493

Merged
merged 7 commits into from
Dec 19, 2023
Merged
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
23 changes: 22 additions & 1 deletion reference/conanfile/attributes/sources.inc
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,25 @@ For example, a *conandata.yml* with information about sources that looks like th
.. code-block:: python

def source(self):
tools.get(**self.conan_data["sources"][self.version])
get(self, **self.conan_data["sources"][self.version])

source_buildenv
---------------

Boolean attribute to opt-out from injecting the :ref:`VirtualBuildEnv<conan_tools_env_virtualbuildenv>` generated environment while running the `source()` method.

Setting this attribute to `False` (default value `True`) will prevent Conan from injecting the ``VirtualBuildEnv`` generated environment from tool requires
when executing the `source()` method.

.. code-block:: python
:emphasize-lines: 4,5,8

class MyConan:
name = "mylib"
version = "1.0.0"
source_buildenv = False
tool_requires = "7zip/1.2.0"

def source(self):
get(self, **self.conan_data["sources"][self.version])
self.run("7z x *.zip -o*") ## Error! tool require not available