Skip to content

Commit 0792dba

Browse files
committed
Enable reproducible builds for ESP32 platform
Use reproducible builds for ESP32 platform so that locally build binaries will be an exact match of release binaries for the same tag. Error message line info will start from the source path, trimming any diectories leading up to it. SHA256 sums of binaries built from release tags should be an exact match of release binaries. Signed-off-by: Winford <[email protected]>
1 parent cf6d536 commit 0792dba

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ instead `badarg`.
8787
- ESP32 Elixir support is determined automatically from the offset of `boot.avm` in the partiton
8888
table.
8989
- ESP32 ports now flash a complete working image using the `idf.py flash` task.
90+
- ESP32 platform now uses reproducable builds.
9091

9192
### Fixed
9293

doc/src/programmers-guide.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ Deployment of the AtomVM virtual machine and an AtomVM application currently req
163163

164164
For more information about deploying the AtomVM image and AtomVM applications to your device, see the [Getting Started Guide](./getting-started-guide.md)
165165

166+
```note
167+
The ESP32 platform uses reproducible builds, this has an effect when doing advanced debugging with
168+
GDB because paths are altered to strip away leading paths that are substituted with the following
169+
placeholders:
170+
171+
* Path to ESP-IDF is replaced with /IDF
172+
* Path to the project is replaced with /IDF_PROJECT
173+
* Path to the build directory is replaced with /IDF_BUILD
174+
* Paths to components are replaced with /COMPONENT_NAME_DIR (where NAME is the name of the
175+
component)
176+
177+
For information on how to configure GDB for debugging reproducible builds consult the ESP-IDF
178+
documentation about
179+
[Reproducible Builds and Debugging](https://docs.espressif.com/projects/esp-idf/en/v5.5/esp32/api-guides/reproducible-builds.html#reproducible-builds-and-debugging).
180+
```
181+
166182
## Applications
167183

168184
An AtomVM application is a collection of BEAM files, aggregated into an AtomVM "Packbeam" (`.avm`) file, and typically deployed (flashed) to some device. These BEAM files be be compiled from Erlang, Elixir, or any other language that targets the Erlang VM.
@@ -1582,7 +1598,7 @@ The read options take the form of a proplist, if the key `raw` is true (`{raw, t
15821598
15831599
If the key `voltage` is true (or simply appears in the list as an atom), then a calibrated voltage value will be returned in millivolts in the second element of the returned tuple. Otherwise, this element will be the atom `undefined`.
15841600
1585-
You may specify the number of samples (1 - 100000) to be taken and averaged over using the tuple `{samples, Samples :: 1..100000}`, the default is `64`.
1601+
You may specify the number of samples (1 - 100000) to be taken and averaged over using the tuple `{samples, Samples :: 1..100000}`, the default is `64`.
15861602
15871603
```{warning}
15881604
Using a large number of samples can significantly increase the amount of time before a response, up to several seconds.

src/platforms/esp32/sdkconfig.defaults.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y
44
CONFIG_LWIP_IPV6=n
55
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="@AVM_PARTITION_TABLE_FILENAME@"
66
CONFIG_PARTITION_TABLE_FILENAME="@AVM_PARTITION_TABLE_FILENAME@"
7+
CONFIG_APP_REPRODUCIBLE_BUILD=y
8+

src/platforms/esp32/sdkconfig.release-defaults.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
66
CONFIG_LWIP_IPV6=n
77
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="@AVM_PARTITION_TABLE_FILENAME@"
88
CONFIG_PARTITION_TABLE_FILENAME="@AVM_PARTITION_TABLE_FILENAME@"
9+
CONFIG_APP_REPRODUCIBLE_BUILD=y

0 commit comments

Comments
 (0)