Skip to content

Commit 22c0da4

Browse files
committed
Forward port changes from v0.6 release branch
This merges a number of fixes introduced after v0.6.4, but most importantly it changes partitioning schema on ESP32 and it makes Elixir really usable.
2 parents 5c41ac8 + 67a8ae1 commit 22c0da4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1762
-91
lines changed

.github/workflows/build-docs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ jobs:
9191
repository: ${{ vars.GITHUB_REPOSITORY }}
9292
fetch-depth: 0
9393

94+
- name: Track all branches
95+
shell: bash
96+
run: |
97+
git config --global --add safe.directory /__w/AtomVM/AtomVM
98+
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}"`; do
99+
git branch --track ${branch#remotes/origin/} $branch
100+
done
101+
94102
- name: Build Site
95103
shell: bash
96104
run: |

.github/workflows/esp32-build.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ on:
1313
- 'CMakeLists.txt'
1414
- 'libs/**'
1515
- 'src/platforms/esp32/**'
16+
- 'src/platforms/esp32/**/**'
1617
- 'src/libAtomVM/**'
1718
- 'tools/packbeam/**'
1819
pull_request:
1920
paths:
2021
- '.github/workflows/esp32-build.yaml'
2122
- 'src/platforms/esp32/**'
23+
- 'src/platforms/esp32/**/**'
2224
- 'src/libAtomVM/**'
2325

2426
concurrency:
@@ -36,17 +38,14 @@ jobs:
3638
matrix:
3739
esp-idf-target: ["esp32", "esp32c3"]
3840
idf-version:
39-
- 'v4.4.7'
40-
- 'v5.0.6'
41+
- 'v5.0.7'
4142
- 'v5.1.4'
4243
- 'v5.2.2'
43-
- 'v5.3-rc1'
44+
- 'v5.3.1'
4445

4546
exclude:
4647
- esp-idf-target: "esp32c3"
47-
idf-version: 'v4.4.7'
48-
- esp-idf-target: "esp32c3"
49-
idf-version: 'v5.0.6'
48+
idf-version: 'v5.0.7'
5049
- esp-idf-target: "esp32c3"
5150
idf-version: 'v5.1.4'
5251
steps:

.github/workflows/esp32-mkimage.yaml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ on:
1313
- 'CMakeLists.txt'
1414
- 'libs/**'
1515
- 'src/platforms/esp32/**'
16+
- 'src/platforms/esp32/**/**'
1617
- 'src/libAtomVM/**'
1718
- 'tools/packbeam/**'
1819
pull_request:
1920
paths:
2021
- '.github/workflows/esp32-mkimage.yaml'
2122
- 'src/platforms/esp32/**'
23+
- 'src/platforms/esp32/**/**'
2224
- 'src/libAtomVM/**'
2325

2426
permissions:
@@ -30,26 +32,27 @@ concurrency:
3032

3133
jobs:
3234
esp32-release:
33-
runs-on: ubuntu-latest
35+
runs-on: ubuntu-22.04
3436
container: espressif/idf:v${{ matrix.idf-version }}
3537

3638
strategy:
3739
matrix:
38-
idf-version: ["5.1.4"]
39-
cc: ["clang-10"]
40-
cxx: ["clang++-10"]
40+
idf-version: ["5.3.1"]
41+
cc: ["clang-14"]
42+
cxx: ["clang++-14"]
4143
cflags: ["-O3"]
4244
otp: ["27"]
4345
elixir_version: ["1.17"]
44-
compiler_pkgs: ["clang-10"]
46+
compiler_pkgs: ["clang-14"]
4547
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2"]
48+
flavor: ["", "-elixir"]
4649

4750
env:
4851
CC: ${{ matrix.cc }}
4952
CXX: ${{ matrix.cxx }}
5053
CFLAGS: ${{ matrix.cflags }}
5154
CXXFLAGS: ${{ matrix.cflags }}
52-
ImageOS: "ubuntu20"
55+
ImageOS: "ubuntu22"
5356

5457
steps:
5558
- name: Checkout repo
@@ -117,36 +120,48 @@ jobs:
117120
run: |
118121
cp sdkconfig.release-defaults sdkconfig.defaults
119122
120-
- name: "Build ${{ matrix.soc }} with idf.py"
123+
- name: "Build ${{ matrix.soc }}${{ matrix.flavor }} with idf.py"
121124
shell: bash
122125
working-directory: ./src/platforms/esp32/
123126
run: |
124127
rm -rf build
125128
. $IDF_PATH/export.sh
129+
if [ ! -z "${{ matrix.flavor }}" ]
130+
then
131+
mv partitions${{ matrix.flavor }}.csv partitions.csv
132+
fi
126133
idf.py set-target ${{ matrix.soc }}
127134
idf.py reconfigure
128135
idf.py build
129136
130-
- name: "Create a ${{ matrix.soc }} image"
137+
- name: "Create a ${{ matrix.soc }}${{ matrix.flavor }} image"
131138
working-directory: ./src/platforms/esp32/build
132139
run: |
133-
./mkimage.sh
140+
if [ -z "${{ matrix.flavor }}" ]
141+
then
142+
./mkimage.sh
143+
else
144+
FLAVOR_SUFFIX=$(echo "${{ matrix.flavor }}" | sed 's/-//g')
145+
BOOT_FILE="build/libs/esp32boot/${FLAVOR_SUFFIX}_esp32boot.avm"
146+
./mkimage.sh --boot="$BOOT_FILE"
147+
mv atomvm-${{ matrix.soc }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
148+
fi
134149
ls -l *.img
135150
136151
- name: "Upload ${{ matrix.soc }} artifacts"
137152
uses: actions/upload-artifact@v4
138153
with:
139-
name: atomvm-${{ matrix.soc }}-image
140-
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}.img
154+
name: atomvm-${{ matrix.soc }}${{ matrix.flavor }}-image
155+
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
141156
if-no-files-found: error
142157

143158
- name: "Rename and write sha256sum"
144159
if: startsWith(github.ref, 'refs/tags/')
145160
shell: bash
146161
working-directory: src/platforms/esp32/build
147162
run: |
148-
ATOMVM_IMG="AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img"
149-
mv atomvm-${{ matrix.soc }}.img "${ATOMVM_IMG}"
163+
ATOMVM_IMG="AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img"
164+
mv atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img "${ATOMVM_IMG}"
150165
sha256sum "${ATOMVM_IMG}" > "${ATOMVM_IMG}.sha256"
151166
152167
- name: Release
@@ -156,5 +171,5 @@ jobs:
156171
draft: true
157172
fail_on_unmatched_files: true
158173
files: |
159-
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img
160-
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256
174+
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img
175+
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img.sha256

.github/workflows/publish-docs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ jobs:
9898
ref: Production
9999
path: /home/runner/work/AtomVM/AtomVM/www
100100

101+
- name: Track all branches
102+
shell: bash
103+
run: |
104+
git config --global --add safe.directory /__w/AtomVM/AtomVM
105+
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}" `; do
106+
git branch --track ${branch#remotes/origin/} $branch
107+
done
108+
101109
- name: Build Site
102110
shell: bash
103111
run: |

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Added a limited implementation of the OTP `ets` interface
1111
- Added `code:all_loaded/0` and `code:all_available/0`
1212

13+
## [0.6.5] - Unreleased
14+
15+
### Added
16+
17+
- ESP32: add a new Elixir release "flavor" with a bigger boot.avm partition that has room for
18+
Elixir standard library modules
19+
- ESP32: `--boot` option to mkimage.sh tool
20+
- Add `erlang:atom_to_binary/1` that is equivalent to `erlang:atom_to_binary(Atom, utf8)`
21+
- Support for Elixir `String.Chars` protocol, now functions such as `Enum.join` are able to take
22+
also non string parameters (e.g. `Enum.join([1, 2], ",")`
23+
- Support for Elixir `Enum.at/3`
24+
- Add support for `is_bitstring/1` construct which is used in Elixir protocols runtime.
25+
- Add support to Elixir `Enumerable` protocol also for `Enum.all?`, `Enum.any?`, `Enum.each`,
26+
`Enum.filter`, `Enum.flat_map`, `Enum.reject`, `Enum.chunk_by` and `Enum.chunk_while`
27+
- Support for `maps:merge_with/3`
28+
- Support for `lists:last/1` and `lists:mapfoldl/3`
29+
- Add support to Elixir for `Process.send/2` `Process.send_after/3/4` and `Process.cancel_timer/1`
30+
- Add support for `handle_continue` callback in `gen_server`
31+
- Support for Elixir `List.Chars` protocol
32+
- Support for `gen_server:start_monitor/3,4`
33+
34+
### Changed
35+
36+
- ESP32: Elixir library is not shipped anymore with `esp32boot.avm`. Use `elixir_esp32boot.avm`
37+
instead
38+
- `Enum.find_index` and `Enum.find_value` support Enumerable and not just lists
39+
40+
### Fixed
41+
42+
- ESP32: content of `boot.avm` partition is not truncated anymore
43+
- ESP32: `Fixed gpio:set_int` to accept any pin, not only pin 2
44+
- Fix memory corruption in `unicode:characters_to_binary`
45+
- Fix handling of large literal indexes
46+
- `unicode:characters_to_list`: fixed bogus out_of_memory error on some platforms such as ESP32
47+
- Fix crash in Elixir library when doing `inspect(:atom)`
48+
- General inspect() compliance with Elixir behavior (but there are still some minor differences)
49+
1350
## [0.6.4] - 2024-08-18
1451

1552
### Added

UPDATING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
# AtomVM Update Instructions
88

9+
## v0.6.4 -> v0.6.5
10+
11+
- ESP32: `esp32boot.avm` doesn't contain anymore Elixir standard library, use instead
12+
`elixir_esp32boot.avm`, or the Elixir release flavor when using an image.
13+
- ESP32: partitioning schema for Elixir flavor is different, so app offset has been changed for
14+
Elixir images. Make sure to use `0x250000` as offset in your mix.exs or when performing manual
15+
flashing.
16+
917
## v0.6.0-beta.1 -> v0.6.0-rc.0
1018

1119
- Drivers that send messages from Esp32 callbacks should use new functions

doc/conf.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ for tag in tag_list:
171171
versions.append(tag.name)
172172
release_list.append(tag.name)
173173

174-
omit_branch_list = ('release-0.5')
174+
omit_branch_list = [ 'release-0.5' ]
175175
branch_list = sorted(repo.branches, key=lambda t: t.commit.committed_datetime)
176176
for branch in branch_list:
177177
if branch.name not in omit_branch_list:

doc/release-notes.md.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ AtomVM currently supports the following versions of ESP-IDF:
6767

6868
| IDF SDK supported versions | AtomVM support |
6969
|------------------------------|----------------|
70-
| ESP-IDF [v4.4](https://docs.espressif.com/projects/esp-idf/en/v4.4.7/esp32/get-started/index.html) | ✅ |
71-
| ESP-IDF [v5.0](https://docs.espressif.com/projects/esp-idf/en/v5.0.6/esp32/get-started/index.html) | ✅ |
70+
| ESP-IDF [v5.0](https://docs.espressif.com/projects/esp-idf/en/v5.0.7/esp32/get-started/index.html) | ✅ |
7271
| ESP-IDF [v5.1](https://docs.espressif.com/projects/esp-idf/en/v5.1.4/esp32/get-started/index.html) | ✅ |
7372
| ESP-IDF [v5.2](https://docs.espressif.com/projects/esp-idf/en/v5.2.2/esp32/get-started/index.html) | ✅ |
73+
| ESP-IDF [v5.3](https://docs.espressif.com/projects/esp-idf/en/v5.3/esp32/get-started/index.html) | ✅ |
7474

7575
Building the AtomVM virtual machine for ESP32 is optional. In most cases, you can simply download a release image from the AtomVM [release](https://github.com/atomvm/AtomVM/releases) repository. If you wish to work on development of the VM or use one on the additional drivers that are available in the [AtomVM repositories](https://github.com/atomvm) you will to build AtomVM from source. See the [Build Instructions](build-instructions.md) for information about how to build AtomVM from source code. We recommend you to use the latest subminor (patch) versions for source builds. You can check the current version used for testing in the [esp32-build.yaml](https://github.com/atomvm/AtomVM/actions/workflows/esp32-build.yaml) workflow.
7676

libs/esp32boot/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ project(esp32boot)
2323
include(BuildErlang)
2424

2525
if (Elixir_FOUND)
26-
pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp exavmlib)
27-
else()
28-
pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp)
26+
pack_runnable(elixir_esp32boot esp32init esp32devmode eavmlib estdlib alisp exavmlib)
2927
endif()
28+
29+
pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp)

0 commit comments

Comments
 (0)