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 1 commit
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])
tools.get(**self.conan_data["sources"][self.version])
danimtb marked this conversation as resolved.
Show resolved Hide resolved

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

Boolean attribute to opt-out from using tool requires in the `source()` method.
danimtb marked this conversation as resolved.
Show resolved Hide resolved

Setting this attribute to `False` (default value `True`) will prevent Conan from inyecting the VirtualBuildEnv generated environment from tool requires
danimtb marked this conversation as resolved.
Show resolved Hide resolved
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):
tools.get(**self.conan_data["sources"][self.version])
danimtb marked this conversation as resolved.
Show resolved Hide resolved
self.run("7z x *.zip -o*") ## Error! tool require not available