Skip to content

Commit 28b4693

Browse files
authored
Profile rendering root_profile_name (#4350)
1 parent c77bbca commit 28b4693

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

reference/config_files/profiles.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,11 @@ Some of the capabilities of the profile templates are:
677677
compiler={{ compiler }}
678678
compiler.version={{ compiler_version }}
679679
680+
If you want to use the original profile file name, instead of the current profile name, for example,
681+
if the current profile file is called ``common``, and another profile called ``windows-arm`` was doing
682+
an ``include(common)``, then the ``root_profile_name`` variable will be equal to ``windows-arm``, even
683+
inside the ``common`` file.
684+
680685
- Executing external commands and using their output. The ``subprocess`` module is added to the
681686
context, so you can use it to execute commands and capture their output.
682687
Note that Conan startup times for some commands can be affected if the command takes a long
@@ -731,6 +736,19 @@ Some of the capabilities of the profile templates are:
731736
would be useful to define custom per-package settings or options for multiple packages
732737
in a large dependency graph.
733738

739+
740+
As a summary, this is the rendering context for profile files (all the items Conan injects):
741+
742+
- ``platform``, ``os``, ``subprocess``: The Python ``platform``, ``os`` and ``subprocess`` modules
743+
- ``profile_dir``: The folder where the current profile file is located
744+
- ``profile_name``: The current profile file filename
745+
- ``root_profile_name``: The initial profile that was loaded. It is different of the current ``profile_name`` when there is an ``include(otherprofile)``
746+
- ``conan_version``: The current Conan version
747+
- ``detect_api``: This is a full automatic detection API, see below
748+
- ``context``: The current Conan context, can be ``host``, ``build`` or be ``None``
749+
750+
751+
734752
.. _reference_config_files_profiles_detect_api:
735753

736754
**Profile Rendering with ``detect_api``**

0 commit comments

Comments
 (0)