Skip to content

Commit

Permalink
Forward port changes from v0.6 release branch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bettio committed Sep 25, 2024
2 parents 5c41ac8 + 67a8ae1 commit 22c0da4
Show file tree
Hide file tree
Showing 46 changed files with 1,762 additions and 91 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ jobs:
repository: ${{ vars.GITHUB_REPOSITORY }}
fetch-depth: 0

- name: Track all branches
shell: bash
run: |
git config --global --add safe.directory /__w/AtomVM/AtomVM
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}"`; do
git branch --track ${branch#remotes/origin/} $branch
done
- name: Build Site
shell: bash
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/esp32-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ on:
- 'CMakeLists.txt'
- 'libs/**'
- 'src/platforms/esp32/**'
- 'src/platforms/esp32/**/**'
- 'src/libAtomVM/**'
- 'tools/packbeam/**'
pull_request:
paths:
- '.github/workflows/esp32-build.yaml'
- 'src/platforms/esp32/**'
- 'src/platforms/esp32/**/**'
- 'src/libAtomVM/**'

concurrency:
Expand All @@ -36,17 +38,14 @@ jobs:
matrix:
esp-idf-target: ["esp32", "esp32c3"]
idf-version:
- 'v4.4.7'
- 'v5.0.6'
- 'v5.0.7'
- 'v5.1.4'
- 'v5.2.2'
- 'v5.3-rc1'
- 'v5.3.1'

exclude:
- esp-idf-target: "esp32c3"
idf-version: 'v4.4.7'
- esp-idf-target: "esp32c3"
idf-version: 'v5.0.6'
idf-version: 'v5.0.7'
- esp-idf-target: "esp32c3"
idf-version: 'v5.1.4'
steps:
Expand Down
45 changes: 30 additions & 15 deletions .github/workflows/esp32-mkimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ on:
- 'CMakeLists.txt'
- 'libs/**'
- 'src/platforms/esp32/**'
- 'src/platforms/esp32/**/**'
- 'src/libAtomVM/**'
- 'tools/packbeam/**'
pull_request:
paths:
- '.github/workflows/esp32-mkimage.yaml'
- 'src/platforms/esp32/**'
- 'src/platforms/esp32/**/**'
- 'src/libAtomVM/**'

permissions:
Expand All @@ -30,26 +32,27 @@ concurrency:

jobs:
esp32-release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: espressif/idf:v${{ matrix.idf-version }}

strategy:
matrix:
idf-version: ["5.1.4"]
cc: ["clang-10"]
cxx: ["clang++-10"]
idf-version: ["5.3.1"]
cc: ["clang-14"]
cxx: ["clang++-14"]
cflags: ["-O3"]
otp: ["27"]
elixir_version: ["1.17"]
compiler_pkgs: ["clang-10"]
compiler_pkgs: ["clang-14"]
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2"]
flavor: ["", "-elixir"]

env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cflags }}
ImageOS: "ubuntu20"
ImageOS: "ubuntu22"

steps:
- name: Checkout repo
Expand Down Expand Up @@ -117,36 +120,48 @@ jobs:
run: |
cp sdkconfig.release-defaults sdkconfig.defaults
- name: "Build ${{ matrix.soc }} with idf.py"
- name: "Build ${{ matrix.soc }}${{ matrix.flavor }} with idf.py"
shell: bash
working-directory: ./src/platforms/esp32/
run: |
rm -rf build
. $IDF_PATH/export.sh
if [ ! -z "${{ matrix.flavor }}" ]
then
mv partitions${{ matrix.flavor }}.csv partitions.csv
fi
idf.py set-target ${{ matrix.soc }}
idf.py reconfigure
idf.py build
- name: "Create a ${{ matrix.soc }} image"
- name: "Create a ${{ matrix.soc }}${{ matrix.flavor }} image"
working-directory: ./src/platforms/esp32/build
run: |
./mkimage.sh
if [ -z "${{ matrix.flavor }}" ]
then
./mkimage.sh
else
FLAVOR_SUFFIX=$(echo "${{ matrix.flavor }}" | sed 's/-//g')
BOOT_FILE="build/libs/esp32boot/${FLAVOR_SUFFIX}_esp32boot.avm"
./mkimage.sh --boot="$BOOT_FILE"
mv atomvm-${{ matrix.soc }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
fi
ls -l *.img
- name: "Upload ${{ matrix.soc }} artifacts"
uses: actions/upload-artifact@v4
with:
name: atomvm-${{ matrix.soc }}-image
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}.img
name: atomvm-${{ matrix.soc }}${{ matrix.flavor }}-image
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
if-no-files-found: error

- name: "Rename and write sha256sum"
if: startsWith(github.ref, 'refs/tags/')
shell: bash
working-directory: src/platforms/esp32/build
run: |
ATOMVM_IMG="AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img"
mv atomvm-${{ matrix.soc }}.img "${ATOMVM_IMG}"
ATOMVM_IMG="AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img"
mv atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img "${ATOMVM_IMG}"
sha256sum "${ATOMVM_IMG}" > "${ATOMVM_IMG}.sha256"
- name: Release
Expand All @@ -156,5 +171,5 @@ jobs:
draft: true
fail_on_unmatched_files: true
files: |
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img.sha256
8 changes: 8 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ jobs:
ref: Production
path: /home/runner/work/AtomVM/AtomVM/www

- name: Track all branches
shell: bash
run: |
git config --global --add safe.directory /__w/AtomVM/AtomVM
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}" `; do
git branch --track ${branch#remotes/origin/} $branch
done
- name: Build Site
shell: bash
run: |
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a limited implementation of the OTP `ets` interface
- Added `code:all_loaded/0` and `code:all_available/0`

## [0.6.5] - Unreleased

### Added

- ESP32: add a new Elixir release "flavor" with a bigger boot.avm partition that has room for
Elixir standard library modules
- ESP32: `--boot` option to mkimage.sh tool
- Add `erlang:atom_to_binary/1` that is equivalent to `erlang:atom_to_binary(Atom, utf8)`
- Support for Elixir `String.Chars` protocol, now functions such as `Enum.join` are able to take
also non string parameters (e.g. `Enum.join([1, 2], ",")`
- Support for Elixir `Enum.at/3`
- Add support for `is_bitstring/1` construct which is used in Elixir protocols runtime.
- Add support to Elixir `Enumerable` protocol also for `Enum.all?`, `Enum.any?`, `Enum.each`,
`Enum.filter`, `Enum.flat_map`, `Enum.reject`, `Enum.chunk_by` and `Enum.chunk_while`
- Support for `maps:merge_with/3`
- Support for `lists:last/1` and `lists:mapfoldl/3`
- Add support to Elixir for `Process.send/2` `Process.send_after/3/4` and `Process.cancel_timer/1`
- Add support for `handle_continue` callback in `gen_server`
- Support for Elixir `List.Chars` protocol
- Support for `gen_server:start_monitor/3,4`

### Changed

- ESP32: Elixir library is not shipped anymore with `esp32boot.avm`. Use `elixir_esp32boot.avm`
instead
- `Enum.find_index` and `Enum.find_value` support Enumerable and not just lists

### Fixed

- ESP32: content of `boot.avm` partition is not truncated anymore
- ESP32: `Fixed gpio:set_int` to accept any pin, not only pin 2
- Fix memory corruption in `unicode:characters_to_binary`
- Fix handling of large literal indexes
- `unicode:characters_to_list`: fixed bogus out_of_memory error on some platforms such as ESP32
- Fix crash in Elixir library when doing `inspect(:atom)`
- General inspect() compliance with Elixir behavior (but there are still some minor differences)

## [0.6.4] - 2024-08-18

### Added
Expand Down
8 changes: 8 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

# AtomVM Update Instructions

## v0.6.4 -> v0.6.5

- ESP32: `esp32boot.avm` doesn't contain anymore Elixir standard library, use instead
`elixir_esp32boot.avm`, or the Elixir release flavor when using an image.
- ESP32: partitioning schema for Elixir flavor is different, so app offset has been changed for
Elixir images. Make sure to use `0x250000` as offset in your mix.exs or when performing manual
flashing.

## v0.6.0-beta.1 -> v0.6.0-rc.0

- Drivers that send messages from Esp32 callbacks should use new functions
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ for tag in tag_list:
versions.append(tag.name)
release_list.append(tag.name)

omit_branch_list = ('release-0.5')
omit_branch_list = [ 'release-0.5' ]
branch_list = sorted(repo.branches, key=lambda t: t.commit.committed_datetime)
for branch in branch_list:
if branch.name not in omit_branch_list:
Expand Down
4 changes: 2 additions & 2 deletions doc/release-notes.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ AtomVM currently supports the following versions of ESP-IDF:

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

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.

Expand Down
6 changes: 3 additions & 3 deletions libs/esp32boot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ project(esp32boot)
include(BuildErlang)

if (Elixir_FOUND)
pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp exavmlib)
else()
pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp)
pack_runnable(elixir_esp32boot esp32init esp32devmode eavmlib estdlib alisp exavmlib)
endif()

pack_runnable(esp32boot esp32init esp32devmode eavmlib estdlib alisp)
Loading

0 comments on commit 22c0da4

Please sign in to comment.