Skip to content

Commit 2af5885

Browse files
committed
docs(lib-builder): Improve UI and Docker image sections
1 parent 74e4a74 commit 2af5885

File tree

1 file changed

+61
-9
lines changed

1 file changed

+61
-9
lines changed

Diff for: docs/en/lib_builder.rst

+61-9
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,48 @@ 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+
The UI consists of the following screens:
230+
231+
- **Main Menu**: The main screen shows buttons to navigate to the other screens.
232+
- **Compile Screen**: The compile screen shows the output of the compilation process and any errors that may have occurred.
233+
- **Sdkconfig Editor**: The sdkconfig editor screen is a simple text editor that shows you the sdkconfig files that will be used for compilation.
234+
You can edit the files here to customize the generated libraries.
235+
- **Settings Screen**: The settings screen allows you to change the settings of the compilation process. Here you can change:
236+
237+
- The targets that the libraries will be compiled for. To save time, you can compile the libraries only for the target you are using;
238+
- Whether the compiled libraries will be copied to the ``arduino-esp32`` directory after compilation so that they can be used in the Arduino IDE;
239+
- The path to the ``arduino-esp32`` directory. This will be automatically set if the ``arduino-esp32`` repository is in one of the default locations.
240+
If not, you can set it manually here. If using the docker image, it should not be changed as the mount point is fixed;
241+
- The branch of the ``arduino-esp32`` repository to be used. This is useful if you want to compile the libraries for a
242+
specific branch or pull request of the ``arduino-esp32`` repository. Leave empty to use the default branch for this ``ESP-IDF`` version;
243+
- 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.
244+
Leave empty to use the default branch for this IDF version;
245+
- 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.
246+
Leave empty to use the latest commit;
247+
- The debug level to be set in ``ESP-IDF``.
248+
207249
Docker Image
208250
------------
209251

@@ -224,8 +266,9 @@ Tags
224266

225267
Multiple tags of this image are maintained:
226268

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

230273
.. note::
231274
Versions of Lib Builder released before this feature was introduced do not have corresponding Docker image versions.
@@ -234,7 +277,7 @@ Multiple tags of this image are maintained:
234277
Usage
235278
*****
236279

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

240283
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 +291,7 @@ To run the Docker image manually, use the following command from the root of the
248291

249292
.. code-block:: bash
250293
251-
docker run --rm -it -v $PWD:/arduino-esp32 -e TERM=xterm-256color espressif/esp32-arduino-lib-builder
294+
docker run --rm -it -v $PWD:/arduino-esp32 -e TERM=xterm-256color espressif/esp32-arduino-lib-builder:release-v5.1
252295
253296
This will start the Lib Builder UI for compiling the libraries. The above command explained:
254297

@@ -258,7 +301,8 @@ This will start the Lib Builder UI for compiling the libraries. The above comman
258301
- ``-t`` Allocate a pseudo-TTY;
259302
- ``-e TERM=xterm-256color``: Optional. Sets the terminal type to ``xterm-256color`` to display colors correctly;
260303
- ``-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.
304+
- ``espressif/esp32-arduino-lib-builder:release-v5.1``: uses Docker image ``espressif/esp32-arduino-lib-builder`` with tag ``release-v5.1``.
305+
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.
262306

263307
.. warning::
264308
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 +322,32 @@ For example, to run a terminal inside the container, you can run:
278322

279323
.. code-block:: bash
280324
281-
docker run -it espressif/esp32-arduino-lib-builder:latest /bin/bash
325+
docker run -it espressif/esp32-arduino-lib-builder:release-v5.1 /bin/bash
282326
283327
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:
328+
Use the following command from the root of the ``arduino-esp32`` repository to execute the image in a Linux or macOS environment for
329+
the ``release-v5.1`` tag:
285330

286331
.. code-block:: bash
287332
288-
curl -LJO https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/master/tools/docker/run.sh
333+
curl -LJO https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/refs/heads/release/v5.1/tools/docker/run.sh
289334
chmod +x run.sh
290335
./run.sh $PWD
291336
292337
For Windows, use the following command in PowerShell from the root of the ``arduino-esp32`` repository:
293338

294339
.. code-block:: powershell
295340
296-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/master/tools/docker/run.ps1" -OutFile "run.ps1"
341+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/espressif/esp32-arduino-lib-builder/refs/heads/release/v5.1/tools/docker/run.ps1" -OutFile "run.ps1"
297342
.\run.ps1 $pwd
298343
344+
As the script is unsigned, you may need to change the execution policy of the current session before running the script.
345+
To do so, run the following command in PowerShell:
346+
347+
.. code-block:: powershell
348+
349+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
350+
299351
.. warning::
300352
It is always a good practice to understand what the script does before running it.
301353
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)