Skip to content

Commit 1abbdba

Browse files
projectgusdpgeorge
authored andcommitted
esp32: Add IDF Component Lockfiles to git repo.
This is recommended by Espressif, and it's the only way to ensure everyone builds the same set of component versions. The awkward part is that updating the ESP-IDF version will churn a line in each of these files (and possibly other changes). Adds a build-time check for lock file changes, which is either a warning or a hard error depending on the value of MICROPY_MAINTAINER_BUILD flag (introduced in previous commit). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent ad22089 commit 1abbdba

File tree

11 files changed

+234
-5
lines changed

11 files changed

+234
-5
lines changed

ports/esp32/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
dependencies.lock
21
managed_components/

ports/esp32/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,21 @@ set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined)
6161
# Include main IDF cmake file.
6262
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6363

64+
# Generate individual dependencies.lock files based on chip target
65+
idf_build_set_property(DEPENDENCIES_LOCK lockfiles/dependencies.lock.${IDF_TARGET})
66+
6467
# Define the project.
6568
project(micropython)
69+
70+
# Check for lockfile changes and either warn or error depending on build type
71+
message("Checking lockfile contents...")
72+
execute_process(COMMAND git diff --exit-code lockfiles/ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
73+
RESULT_VARIABLE RES)
74+
if (RES)
75+
# Maintainer builds (CI or autobuild runs) should fail if this has happened
76+
if($ENV{MICROPY_MAINTAINER_BUILD})
77+
message(FATAL_ERROR "Failing build as lockfiles are dirty (see above). Check that ESP-IDF versions match.")
78+
else()
79+
message(WARNING "Component lockfile contents have changed (see above). This may be due to building with a different ESP-IDF version. Please mention this output if reporting an issue with MicroPython.")
80+
endif()
81+
endif()

ports/esp32/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ framework, aka SDK). The ESP-IDF includes the libraries and RTOS needed to
3030
manage the ESP32 microcontroller, as well as a way to manage the required
3131
build environment and toolchains needed to build the firmware.
3232

33-
The ESP-IDF changes quickly and MicroPython only supports certain versions.
34-
Currently MicroPython supports v5.2, v5.2.2, v5.3, v5.4, v5.4.1 and v5.4.2.
33+
The ESP-IDF changes quickly and MicroPython only supports certain versions. The
34+
current recommended version of ESP-IDF for MicroPython is v5.4.2. MicroPython
35+
also supports v5.2, v5.2.2, v5.3, v5.4 and v5.4.1.
3536

3637
To install the ESP-IDF the full instructions can be found at the
3738
[Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation-step-by-step).

ports/esp32/lockfiles/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ESP-IDF Component Lockfiles
2+
3+
This directory contains the exact versions of ESP-IDF components that have been
4+
used to build MicroPython. It is updated by the [component version
5+
solver](https://docs.espressif.com/projects/idf-component-manager/en/latest/guides/version_solver.html).
6+
7+
Unless you change the `main/idf_component.yml` file for MicroPython ESP32, files
8+
in this directory should only change contents if you build using a different
9+
ESP-IDF version to the last time the file was updated.
10+
11+
*Please do not commit changes to these files and submit PRs unless the PR needs
12+
to change versions of components or ESP-IDF.*
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
dependencies:
2+
espressif/lan867x:
3+
component_hash: 0ff9dae3affeff53811e7c8283e67c6d36dc0c03e3bc5102c0fba629e08bf6c4
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.3'
8+
source:
9+
registry_url: https://components.espressif.com/
10+
type: service
11+
targets:
12+
- esp32
13+
- esp32p4
14+
version: 1.0.3
15+
espressif/mdns:
16+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
17+
dependencies:
18+
- name: idf
19+
require: private
20+
version: '>=5.0'
21+
source:
22+
registry_url: https://components.espressif.com/
23+
type: service
24+
version: 1.1.0
25+
idf:
26+
source:
27+
type: idf
28+
version: 5.4.2
29+
direct_dependencies:
30+
- espressif/lan867x
31+
- espressif/mdns
32+
- idf
33+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
34+
target: esp32
35+
version: 2.0.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dependencies:
2+
espressif/mdns:
3+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.0'
8+
source:
9+
registry_url: https://components.espressif.com/
10+
type: service
11+
version: 1.1.0
12+
idf:
13+
source:
14+
type: idf
15+
version: 5.4.2
16+
direct_dependencies:
17+
- espressif/mdns
18+
- idf
19+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
20+
target: esp32c2
21+
version: 2.0.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dependencies:
2+
espressif/mdns:
3+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.0'
8+
source:
9+
registry_url: https://components.espressif.com/
10+
type: service
11+
version: 1.1.0
12+
idf:
13+
source:
14+
type: idf
15+
version: 5.4.2
16+
direct_dependencies:
17+
- espressif/mdns
18+
- idf
19+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
20+
target: esp32c3
21+
version: 2.0.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dependencies:
2+
espressif/mdns:
3+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.0'
8+
source:
9+
registry_url: https://components.espressif.com/
10+
type: service
11+
version: 1.1.0
12+
idf:
13+
source:
14+
type: idf
15+
version: 5.4.2
16+
direct_dependencies:
17+
- espressif/mdns
18+
- idf
19+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
20+
target: esp32c6
21+
version: 2.0.0
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
dependencies:
2+
espressif/esp_tinyusb:
3+
component_hash: 96d232ced7afe1976119b62f7fbf1944a2a78b36228ff6f7b9318394ac1153cc
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.0'
8+
- name: espressif/tinyusb
9+
registry_url: https://components.espressif.com
10+
require: public
11+
version: '>=0.14.2'
12+
source:
13+
registry_url: https://components.espressif.com/
14+
type: service
15+
version: 1.7.6~1
16+
espressif/mdns:
17+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
18+
dependencies:
19+
- name: idf
20+
require: private
21+
version: '>=5.0'
22+
source:
23+
registry_url: https://components.espressif.com/
24+
type: service
25+
version: 1.1.0
26+
espressif/tinyusb:
27+
component_hash: aa65639878f27a44d349044afd9c3fc134a92bd560874fdac1d836019b5c07ca
28+
dependencies:
29+
- name: idf
30+
require: private
31+
version: '>=5.0'
32+
source:
33+
registry_url: https://components.espressif.com
34+
type: service
35+
targets:
36+
- esp32s2
37+
- esp32s3
38+
- esp32p4
39+
version: 0.18.0~4
40+
idf:
41+
source:
42+
type: idf
43+
version: 5.4.2
44+
direct_dependencies:
45+
- espressif/esp_tinyusb
46+
- espressif/mdns
47+
- idf
48+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
49+
target: esp32s2
50+
version: 2.0.0
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
dependencies:
2+
espressif/esp_tinyusb:
3+
component_hash: 96d232ced7afe1976119b62f7fbf1944a2a78b36228ff6f7b9318394ac1153cc
4+
dependencies:
5+
- name: idf
6+
require: private
7+
version: '>=5.0'
8+
- name: espressif/tinyusb
9+
registry_url: https://components.espressif.com
10+
require: public
11+
version: '>=0.14.2'
12+
source:
13+
registry_url: https://components.espressif.com/
14+
type: service
15+
version: 1.7.6~1
16+
espressif/mdns:
17+
component_hash: 46ee81d32fbf850462d8af1e83303389602f6a6a9eddd2a55104cb4c063858ed
18+
dependencies:
19+
- name: idf
20+
require: private
21+
version: '>=5.0'
22+
source:
23+
registry_url: https://components.espressif.com/
24+
type: service
25+
version: 1.1.0
26+
espressif/tinyusb:
27+
component_hash: aa65639878f27a44d349044afd9c3fc134a92bd560874fdac1d836019b5c07ca
28+
dependencies:
29+
- name: idf
30+
require: private
31+
version: '>=5.0'
32+
source:
33+
registry_url: https://components.espressif.com
34+
type: service
35+
targets:
36+
- esp32s2
37+
- esp32s3
38+
- esp32p4
39+
version: 0.18.0~4
40+
idf:
41+
source:
42+
type: idf
43+
version: 5.4.2
44+
direct_dependencies:
45+
- espressif/esp_tinyusb
46+
- espressif/mdns
47+
- idf
48+
manifest_hash: 3b18b5bbac91c9fe5098d3759a37c84ed0828546d8cbc92e26e4c1698e689c8a
49+
target: esp32s3
50+
version: 2.0.0

0 commit comments

Comments
 (0)