Skip to content

Commit 05102fe

Browse files
authored
docs(lib-builder): Improve UI and Docker image sections (#10535)
* docs(lib-builder): Improve UI and Docker image sections * docs(lib-builder): Apply review suggestions
1 parent d47771f commit 05102fe

File tree

1 file changed

+63
-9
lines changed

1 file changed

+63
-9
lines changed

docs/en/lib_builder.rst

+63-9
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,50 @@ You can then run the UI using the following command:
204204
205205
./tools/config_editor/app.py
206206
207+
Pre-Configuring the UI
208+
**********************
209+
210+
The UI can be pre-configured using command line arguments. The following arguments are available:
211+
212+
- ``-t, --target <target>``: Comma-separated list of targets to be compiled.
213+
Choose from: *all*, *esp32*, *esp32s2*, *esp32s3*, *esp32c2*, *esp32c3*, *esp32c6*, *esp32h2*. Default: all except *esp32c2*;
214+
- ``--copy, --no-copy``: Enable/disable copying the compiled libraries to ``arduino-esp32``. Enabled by default;
215+
- ``-c, --arduino-path <path>``: Path to ``arduino-esp32`` directory. Default: OS dependent;
216+
- ``-A, --arduino-branch <branch>``: Branch of the ``arduino-esp32`` repository to be used. Default: set by the build script;
217+
- ``-I, --idf-branch <branch>``: Branch of the ``ESP-IDF`` repository to be used. Default: set by the build script;
218+
- ``-i, --idf-commit <commit>``: Commit of the ``ESP-IDF`` repository to be used. Default: set by the build script;
219+
- ``-D, --debug-level <level>``: Debug level to be set in ``ESP-IDF``.
220+
Choose from: *default*, *none*, *error*, *warning*, *info*, *debug*, *verbose*. Default: *default*.
221+
222+
Please note that all these options can be changed in the UI itself and are only used for automation purposes.
223+
224+
Screens
225+
*******
226+
227+
There are many screens in the UI that are used to configure the libraries to be compiled.
228+
Note that in all screens you can also use the shortcut keys shown in the footer bar to navigate.
229+
230+
The UI consists of the following screens:
231+
232+
- **Main Menu**: The main screen shows buttons to navigate to the other screens.
233+
- **Compile Screen**: The compile screen shows the output of the compilation process and any errors that may have occurred.
234+
- **Sdkconfig Editor**: The sdkconfig editor screen is a simple text editor that shows you the sdkconfig files that will be used for compilation.
235+
You can edit the files here to customize the generated libraries.
236+
- **Settings Screen**: The settings screen allows you to change the settings of the compilation process.
237+
Here you can change:
238+
239+
- The targets that the libraries will be compiled for. To save time, you can compile the libraries only for the target you are using;
240+
- Whether the compiled libraries will be copied to the ``arduino-esp32`` directory after compilation so that they can be used in the Arduino IDE;
241+
- The path to the ``arduino-esp32`` directory. This will be automatically set if the ``arduino-esp32`` repository is in one of the default locations.
242+
If not, you can set it manually here. If using the docker image, it should not be changed as the mount point is fixed;
243+
- The branch of the ``arduino-esp32`` repository to be used. This is useful if you want to compile the libraries for a
244+
specific branch or pull request of the ``arduino-esp32`` repository. Leave empty to use the default branch for this ``ESP-IDF`` version;
245+
- The branch of the ``ESP-IDF`` repository to be used. This is useful if you want to compile the libraries for a specific branch of the ``ESP-IDF`` repository.
246+
Leave empty to use the default branch for this IDF version;
247+
- The commit of the ``ESP-IDF`` repository to be used. This is useful if you want to compile the libraries for a specific commit on the selected branch.
248+
Leave empty to use the latest commit;
249+
- The debug level to be set in ``ESP-IDF``.
250+
207251
Docker Image
208252
------------
209253

@@ -224,8 +268,9 @@ Tags
224268

225269
Multiple tags of this image are maintained:
226270

227-
- ``latest``: tracks ``master`` branch of the Lib Builder
228-
- ``release-vX.Y``: tracks ``release/vX.Y`` branch of the Lib Builder
271+
- ``latest``: tracks ``master`` branch of the Lib Builder. Note that the ``latest`` tag is not recommended for use as, depending on the
272+
development stage of the Lib Builder, it might not be stable or might not contain the latest changes;
273+
- ``release-vX.Y``: tracks ``release/vX.Y`` branch of the Lib Builder.
229274

230275
.. note::
231276
Versions of Lib Builder released before this feature was introduced do not have corresponding Docker image versions.
@@ -234,7 +279,7 @@ Multiple tags of this image are maintained:
234279
Usage
235280
*****
236281

237-
Before using the ``espressif/esp32-arduino-lib-builder`` Docker image locally, make sure you have Docker installed.
282+
Before using the ``espressif/esp32-arduino-lib-builder`` Docker image locally, make sure you have Docker installed and running on your machine.
238283
Follow the instructions at https://docs.docker.com/install/, if it is not installed yet.
239284

240285
If using the image in a CI environment, consult the documentation of your CI service on how to specify the image used for the build process.
@@ -248,7 +293,7 @@ To run the Docker image manually, use the following command from the root of the
248293

249294
.. code-block:: bash
250295
251-
docker run --rm -it -v $PWD:/arduino-esp32 -e TERM=xterm-256color espressif/esp32-arduino-lib-builder
296+
docker run --rm -it -v $PWD:/arduino-esp32 -e TERM=xterm-256color espressif/esp32-arduino-lib-builder:release-v5.1
252297
253298
This will start the Lib Builder UI for compiling the libraries. The above command explained:
254299

@@ -258,7 +303,8 @@ This will start the Lib Builder UI for compiling the libraries. The above comman
258303
- ``-t`` Allocate a pseudo-TTY;
259304
- ``-e TERM=xterm-256color``: Optional. Sets the terminal type to ``xterm-256color`` to display colors correctly;
260305
- ``-v $PWD:/arduino-esp32``: Optional. Mounts the current folder at ``/arduino-esp32`` inside the container. If not provided, the container will not copy the compiled libraries to the host machine;
261-
- ``espressif/esp32-arduino-lib-builder``: uses Docker image ``espressif/esp32-arduino-lib-builder`` with tag ``latest``. The ``latest`` tag is implicitly added by Docker when no tag is specified.
306+
- ``espressif/esp32-arduino-lib-builder:release-v5.1``: uses Docker image ``espressif/esp32-arduino-lib-builder`` with tag ``release-v5.1``.
307+
The ``latest`` tag is implicitly added by Docker when no tag is specified. It is recommended to use a specific version tag to ensure reproducibility of the build process.
262308

263309
.. warning::
264310
The ``-v`` option is used to mount a folder from the host machine to the container. Make sure the folder already exists on the host machine before running the command.
@@ -278,24 +324,32 @@ For example, to run a terminal inside the container, you can run:
278324

279325
.. code-block:: bash
280326
281-
docker run -it espressif/esp32-arduino-lib-builder:latest /bin/bash
327+
docker run -it espressif/esp32-arduino-lib-builder:release-v5.1 /bin/bash
282328
283329
Running the Docker image using the provided run script will depend on the host OS.
284-
Use the following command from the root of the ``arduino-esp32`` repository to execute the image in a Linux or macOS environment:
330+
Use the following command from the root of the ``arduino-esp32`` repository to execute the image in a Linux or macOS environment for
331+
the ``release-v5.1`` tag:
285332

286333
.. code-block:: bash
287334
288-
curl -LJO https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/master/tools/docker/run.sh
335+
curl -LJO https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/refs/heads/release/v5.1/tools/docker/run.sh
289336
chmod +x run.sh
290337
./run.sh $PWD
291338
292339
For Windows, use the following command in PowerShell from the root of the ``arduino-esp32`` repository:
293340

294341
.. code-block:: powershell
295342
296-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/master/tools/docker/run.ps1" -OutFile "run.ps1"
343+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/refs/heads/release/v5.1/tools/docker/run.ps1" -OutFile "run.ps1"
297344
.\run.ps1 $pwd
298345
346+
As the script is unsigned, you may need to change the execution policy of the current session before running the script.
347+
To do so, run the following command in PowerShell:
348+
349+
.. code-block:: powershell
350+
351+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
352+
299353
.. warning::
300354
It is always a good practice to understand what the script does before running it.
301355
Make sure to analyze the content of the script to ensure it is safe to run and won't cause any harm to your system.

0 commit comments

Comments
 (0)