Skip to content

Commit 9a8bc73

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 9d340e3 commit 9a8bc73

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
@@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7070
- ESP32 Elixir support is determined automatically from the offset of `boot.avm` in the partiton
7171
table.
7272
- ESP32 ports now flash a complete working image using the `idf.py flash` task.
73+
- ESP32 platform now uses reproducable builds.
7374

7475
### Fixed
7576

doc/src/programmers-guide.md

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

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

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

176192
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.
@@ -1590,7 +1606,7 @@ The read options take the form of a proplist, if the key `raw` is true (`{raw, t
15901606
15911607
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`.
15921608
1593-
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`.
1609+
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`.
15941610
15951611
```{warning}
15961612
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)