diff --git a/reference/config_files/global_conf.rst b/reference/config_files/global_conf.rst index b0137a4efef..ce7f4393cc4 100644 --- a/reference/config_files/global_conf.rst +++ b/reference/config_files/global_conf.rst @@ -89,9 +89,21 @@ Conan also injects ``detect_api`` (non-stable, read the reference) to the jinja For more information on how to use it, please check :ref:`the detect_api section ` in the profiles reference. -The Python packages passed to render the template are ``os`` and ``platform`` for all platforms and ``distro`` in Linux platforms. +The Python packages passed to render the template are ``os``, ``platform`` and ``hashlib`` for all platforms and ``distro`` in Linux platforms. Additionally, the variables ``conan_version`` and ``conan_home_folder`` are also available. +The ``os``, ``platform`` and ``distro`` can be useful to perform different system checks, while the ``hashlib`` library can be convenient +to compute unique hashes based on the ``conan_home_folder`` to define unique strings, for example for unique shorter paths in Windows in +CI systems when sometimes the path length can be an issue, for example: + +.. code-block:: python + + # compute a unique hash based on the current home folder + {% set h = hashlib.new("sha256", conan_home_folder.encode(), + usedforsecurity=False).hexdigest() %} + # and use the first 6 characters to compose a short path for package storage + core.cache:storage_path=C:/conan_{{h[:6]}} + Configuration data types ------------------------