From c8e218c0aedd37d2d9a509952be4c1045f012d47 Mon Sep 17 00:00:00 2001 From: Marek Fiala Date: Thu, 23 Nov 2023 13:11:30 +0100 Subject: [PATCH] docs(tools): Add example and resctriction note to setting IDF_TOOLS_PATH Closes https://github.com/espressif/esp-idf/issues/12539 --- docs/en/get-started/linux-macos-setup.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/en/get-started/linux-macos-setup.rst b/docs/en/get-started/linux-macos-setup.rst index ccfba88fbb..0213a0c903 100644 --- a/docs/en/get-started/linux-macos-setup.rst +++ b/docs/en/get-started/linux-macos-setup.rst @@ -216,9 +216,19 @@ To prefer the Espressif download server when installing tools, use the following Customizing the Tools Installation Path ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The scripts introduced in this step install compilation tools required by ESP-IDF inside the user home directory: ``$HOME/.espressif`` on Linux. If you wish to install the tools into a different directory, set the environment variable ``IDF_TOOLS_PATH`` before running the installation scripts. Make sure that your user account has sufficient permissions to read and write this path. +The scripts introduced in this step install compilation tools required by ESP-IDF inside the user home directory: ``$HOME/.espressif`` on Linux. If you wish to install the tools into a different directory, **export the environment variable ``IDF_TOOLS_PATH`` before running the installation scripts**. Make sure that your user account has sufficient permissions to read and write this path. -If changing the ``IDF_TOOLS_PATH``, make sure it is set to the same value every time the Install script (``install.bat``, ``install.ps1`` or ``install.sh``) and an Export script (``export.bat``, ``export.ps1`` or ``export.sh``) are executed. +.. code-block:: bash + + export IDF_TOOLS_PATH="$HOME/required_idf_tools_path" + ./install.sh + + . ./export.sh + +If changing the ``IDF_TOOLS_PATH``, make sure it is exported in the environment before running any ESP-IDF tools or scripts. + +.. note:: + Using ``IDF_TOOLS_PATH`` in variable assignement, e.g. ``IDF_TOOLS_PATH="$HOME/required_idf_tools_path" ./install.sh``, without prior exporting, will not work in most shells because the variable assignment will not affect the current execution environment, even if it's exported/changed in the sourced script. .. _get-started-set-up-env: