Skip to content

Commit 5c41ac8

Browse files
committed
Forward port changes from v0.6 release branch
Merge v0.6.4 into main.
2 parents 47271c8 + 00ff986 commit 5c41ac8

Some content is hidden

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

67 files changed

+3828
-60
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,16 @@ jobs:
379379
./src/AtomVM ./tests/libs/alisp/test_alisp.avm
380380
valgrind ./src/AtomVM ./tests/libs/alisp/test_alisp.avm
381381
382+
- name: "Test: Tests.avm (Elixir)"
383+
timeout-minutes: 10
384+
working-directory: build
385+
run: |
386+
if command -v elixirc &> /dev/null
387+
then
388+
./src/AtomVM ./tests/libs/exavmlib/Tests.avm
389+
valgrind ./src/AtomVM ./tests/libs/exavmlib/Tests.avm
390+
fi
391+
382392
- name: "Install and smoke test"
383393
working-directory: build
384394
run: |

.github/workflows/build-docs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ jobs:
7777
python3 -m pip install breathe
7878
python3 -m pip install pygments
7979
80+
- name: Set docs target name
81+
shell: bash
82+
run: |
83+
if [[ ${{ github.ref_name }} == *"/merge" ]]; then
84+
echo "AVM_DOCS_NAME=${{github.event.pull_request.base.ref}}" >> "$GITHUB_ENV";
85+
else
86+
echo "AVM_DOCS_NAME=${{ github.ref_name }}" >> "$GITHUB_ENV";
87+
fi
88+
8089
- uses: actions/checkout@v4
8190
with:
8291
repository: ${{ vars.GITHUB_REPOSITORY }}

.github/workflows/publish-docs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
# The type of runner that the job will run on
3939
runs-on: ubuntu-latest
4040

41+
env:
42+
AVM_DOCS_NAME: ${{ github.ref_name }}
43+
4144
# Steps represent a sequence of tasks that will be executed as part of the job
4245
steps:
4346
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,27 @@ 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.4] - Unreleased
13+
## [0.6.4] - 2024-08-18
1414

1515
### Added
1616

1717
- Implement `gpio:init/1` on esp32 to initialize pins for GPIO usage, which some pins
1818
require depending on default function and bootloader code
19-
20-
## [0.6.3] - 20-07-2024
19+
- Implement missing opcode 161 (raw_raise), that looks more likely to be generated with Elixir code
20+
- Support for Elixir `Map.replace/3` and `Map.replace!/3`
21+
- Support for Elixir `Kernel.struct` and `Kernel.struct!`
22+
- Support for Elixir `IO.iodata_to_binary/1`
23+
- Support for Elixir exceptions: `Exception` module and the other error related modules such as
24+
`ArgumentError`, `UndefinedFunctionError`, etc...
25+
- Support for Elixir `Enumerable` and `Collectable` protocol
26+
- Support for Elixir `Enum` functions: `split_with`, `join`, `map_join`, `into`, `reverse`,
27+
`slice` and `to_list`
28+
- Support for Elixir `MapSet` module
29+
- Support for Elixir `Range` module
30+
- Support for Elixir `Kernel.min` and `Kernel.max`
31+
- Support (as stub) for `erlang:error/3` (that is required from Elixir code)
32+
33+
## [0.6.3] - 2024-07-20
2134

2235
### Added
2336

doc/CMakeLists.txt

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/edoc/edown_dep DESTINATION ${CMAKE_CURRENT
3535

3636
# Configure libAtomVM restucturedtext skeleton.
3737
file(GLOB SOURCE_FILES LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR}/src/libAtomVM/ ${CMAKE_SOURCE_DIR}/src/libAtomVM/*.c ${CMAKE_SOURCE_DIR}/src/libAtomVM/*.h)
38+
set(OMIT_FILES
39+
"defaultatoms.c"
40+
"opcodesswitch.h"
41+
"scheduler.c"
42+
"tempstack.h"
43+
)
3844
foreach(SOURCE_FILE ${SOURCE_FILES})
3945
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/apidocs/libatomvm/file.rst.in ${CMAKE_CURRENT_BINARY_DIR}/src/apidocs/libatomvm/src/${SOURCE_FILE}.rst @ONLY)
4046
endforeach(SOURCE_FILE)
47+
foreach(OMIT ${OMIT_FILES})
48+
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/src/apidocs/libatomvm/src/${OMIT}.rst)
49+
endforeach(OMIT)
4150

4251
# Support for edoc -> markdown.
4352
add_custom_target(edown-escript
@@ -46,11 +55,21 @@ add_custom_target(edown-escript
4655
COMMENT "Preparing edown escript" VERBATIM
4756
)
4857

49-
# Get the version tree name, tag if this is a tagged commit, otherwise main.
50-
execute_process(COMMAND "bash" "-c" "tag=$(git for-each-ref --points-at=HEAD --format='%(refname:lstrip=2)' refs/tags); ( [ $tag ] && echo $tag ) || echo 'main'"
51-
OUTPUT_VARIABLE
52-
DOC_TREE_VERSION
53-
OUTPUT_STRIP_TRAILING_WHITESPACE )
58+
# Get the version tree name, tag if this is a tagged commit, otherwise get the current branch name.
59+
if ($ENV{CI})
60+
set(DOC_TREE_VERSION $ENV{AVM_DOCS_NAME})
61+
message("CI building documentation for target branch ${DOC_TREE_VERSION}")
62+
else()
63+
execute_process(COMMAND "bash" "-c" "tag=$(git for-each-ref --points-at=HEAD --format='%(refname:lstrip=2)' refs/tags); ( [ $tag ] && echo $tag )|| git branch --show-current"
64+
OUTPUT_VARIABLE
65+
DOC_TREE_VERSION
66+
OUTPUT_STRIP_TRAILING_WHITESPACE )
67+
message("Local documentation test build on ${DOC_TREE_VERSION}")
68+
endif($ENV{CI})
69+
70+
71+
## conf.py.in must be configured after DOC_TREE_VERSION is defined
72+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
5473

5574
##
5675
## Erlang API documentation
@@ -108,7 +127,6 @@ endif()
108127
find_package(Sphinx)
109128
if(SPHINX_FOUND)
110129
message("Sphinx found: ${SPHINX_BUILD_EXECUTABLE}")
111-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
112130
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
113131
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pdf_stylesheet.rts DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
114132
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pdf_template.rtt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)

doc/Doxyfile.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ EXTRACT_PACKAGE = NO
465465
# included in the documentation.
466466
# The default value is: NO.
467467

468-
EXTRACT_STATIC = NO
468+
EXTRACT_STATIC = YES
469469

470470
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
471471
# locally in source files will be included in the documentation. If set to NO,
@@ -520,7 +520,7 @@ HIDE_FRIEND_COMPOUNDS = NO
520520
# blocks will be appended to the function's detailed documentation block.
521521
# The default value is: NO.
522522

523-
HIDE_IN_BODY_DOCS = NO
523+
HIDE_IN_BODY_DOCS = YES
524524

525525
# The INTERNAL_DOCS tag determines if documentation that is typed after a
526526
# \internal command is included. If the tag is set to NO then the documentation
@@ -692,7 +692,7 @@ SHOW_FILES = YES
692692
# Folder Tree View (if specified).
693693
# The default value is: YES.
694694

695-
SHOW_NAMESPACES = YES
695+
SHOW_NAMESPACES = NO
696696

697697
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
698698
# doxygen should invoke to get the current version for each file (typically from
@@ -769,7 +769,7 @@ WARN_IF_DOC_ERROR = YES
769769
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
770770
# The default value is: NO.
771771

772-
WARN_NO_PARAMDOC = NO
772+
WARN_NO_PARAMDOC = YES
773773

774774
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
775775
# a warning is encountered.
@@ -903,7 +903,7 @@ EXCLUDE_SYMLINKS = NO
903903
# Note that the wildcards are matched against the file with absolute path, so to
904904
# exclude all test directories for example use the pattern */test/*
905905

906-
EXCLUDE_PATTERNS = */libAtomVM/opcodesswitch.h
906+
EXCLUDE_PATTERNS = */defaultatoms.c */opcodesswitch.h */scheduler.c */tempstack.h
907907

908908
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
909909
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -1015,7 +1015,7 @@ SOURCE_BROWSER = YES
10151015
# classes and enums directly into the documentation.
10161016
# The default value is: NO.
10171017

1018-
INLINE_SOURCES = NO
1018+
INLINE_SOURCES = YES
10191019

10201020
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
10211021
# special comment blocks from generated source code fragments. Normal C, C++ and
@@ -2030,7 +2030,7 @@ ENABLE_PREPROCESSING = YES
20302030
# The default value is: NO.
20312031
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
20322032

2033-
MACRO_EXPANSION = NO
2033+
MACRO_EXPANSION = YES
20342034

20352035
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
20362036
# the macro expansion is limited to the macros specified with the PREDEFINED and
@@ -2070,7 +2070,7 @@ INCLUDE_FILE_PATTERNS =
20702070
# recursively expanded use the := operator instead of the = operator.
20712071
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
20722072

2073-
PREDEFINED = DOXYGEN_SKIP_SECTION
2073+
PREDEFINED = DOXYGEN_SKIP_SECTION AVM_TASK_DRIVER_ENABLED ENABLE_ADVANCED_TRACE OTP_SOCKET_LWIP
20742074

20752075
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
20762076
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2316,7 +2316,7 @@ DOT_IMAGE_FORMAT = png
23162316
# The default value is: NO.
23172317
# This tag requires that the tag HAVE_DOT is set to YES.
23182318

2319-
INTERACTIVE_SVG = NO
2319+
INTERACTIVE_SVG = YES
23202320

23212321
# The DOT_PATH tag can be used to specify the path where the dot tool can be
23222322
# found. If left blank, it is assumed the dot tool can be found in the path.

doc/_templates/versions.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
{# Add rst-badge after rst-versions for small badge style. #}
1212
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
1313
<span class="rst-current-version" data-toggle="rst-current-version">
14-
<span class="fa fa-book">AtomVM Docs</span>
15-
v: {{ current_version }}
14+
<span class="fa fa-download"></span><span class="fa fa-book"> AtomVM Docs version:</span>
15+
{{ current_version }}
1616
<span class="fa fa-caret-down"></span>
1717
</span>
1818
<div class="rst-other-versions">
1919
{% if versions|length >= 1 %}
2020
<dl>
21-
<dt>{{ _('Versions') }}</dt>
21+
<dt><span class="fa fa-book">{{ _(' Versions') }}</span></dt>
2222
{% for slug, url in versions %}
2323
{% if slug == current_version %} <strong> {% endif %}
2424
<dd><a href="{{ url }}">{{ slug }}</a></dd>
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% if downloads|length >= 1 %}
3030
<dl>
31-
<dt>{{ _('Downloads') }}</dt>
31+
<dt><span class="fa fa-download">{{ _(' Downloads') }}</span></dt>
3232
{% for type, url in downloads %}
3333
<dd><a href="{{ url }}">{{ type }}</a></dd>
3434
{% endfor %}

doc/conf.py.in

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ extensions = [
6363
suppress_warnings = [
6464
'epub.unknown_project_files',
6565
'misc.highlighting_failure',
66-
'toc.excluded'
66+
'toc.excluded',
67+
'myst.*',
68+
'breathe.*'
6769
]
6870

6971
# Add any paths that contain templates here, relative to this directory.
@@ -164,14 +166,26 @@ repo = Repo( search_parent_directories=True )
164166
tag_list = sorted(repo.tags, key=lambda t: t.commit.committed_datetime)
165167
latest_tag = tag_list[-1]
166168
versions = list()
169+
release_list = list()
167170
for tag in tag_list:
168171
versions.append(tag.name)
172+
release_list.append(tag.name)
173+
174+
omit_branch_list = ('release-0.5')
175+
branch_list = sorted(repo.branches, key=lambda t: t.commit.committed_datetime)
176+
for branch in branch_list:
177+
if branch.name not in omit_branch_list:
178+
versions.append(branch.name)
169179

170-
versions.append('main')
171180
if ((repo.head.object.hexsha) == (latest_tag.commit.hexsha)):
172181
current_version = latest_tag.name
182+
download_version = current_version
173183
else:
174-
current_version = 'main'
184+
download_version = '@DOC_TREE_VERSION@'
185+
if ((download_version) == ('main')):
186+
current_version = download_version + ' branch (unstable)'
187+
else:
188+
current_version = download_version + ' branch (unreleased)'
175189

176190
print("Sphinx config found documentation candidates: %r." % (versions))
177191
print("Sphinx config current version: %r." % (current_version))
@@ -184,7 +198,13 @@ html_context['version'] = current_version
184198
# POPULATE LINKS TO OTHER VERSIONS
185199
html_context['versions'] = list()
186200
for version in versions:
187-
html_context['versions'].append( (version, '/doc/' +version+ '/') )
201+
if ((version) == ('main')):
202+
html_context['versions'].append( (version + ' branch (unstable)', '/doc/' +version+ '/') )
203+
else:
204+
if (version not in release_list):
205+
html_context['versions'].append( (version + ' branch (unreleased)', '/doc/' +version+ '/') )
206+
else:
207+
html_context['versions'].append( (version, '/doc/' +version+ '/') )
188208

189209
html_sidebars = {
190210
'**': [
@@ -194,14 +214,14 @@ html_sidebars = {
194214

195215
# POPULATE LINKS TO OTHER FORMATS/DOWNLOADS
196216
html_context['downloads'] = list()
197-
html_context['downloads'].append( ('pdf', '/doc/' +current_version+ '/pdf/' +project+ '-' +current_version+ '.pdf') )
198-
html_context['downloads'].append( ('epub', '/doc/' +current_version+ '/epub/' +project+ '-' +current_version+ '.epub') )
217+
html_context['downloads'].append( ('pdf', '/doc/' +download_version+ '/pdf/' +project+ '-' +download_version+ '.pdf') )
218+
html_context['downloads'].append( ('epub', '/doc/' +download_version+ '/epub/' +project+ '-' +download_version+ '.epub') )
199219

200220
# -- Options for PDF output -------------------------------------------------
201221

202222
rinoh_documents = [dict(
203223
doc=master_doc,
204-
target=project+ '-' +current_version,
224+
target=project+ '-' +download_version,
205225
logo='@CMAKE_CURRENT_SOURCE_DIR@/src/_static/AtomVM-logo.png',
206226
template='pdf_template.rtt'
207227
)]
@@ -212,4 +232,4 @@ today_fmt = "%B %d, %Y"
212232

213233
epub_tocdepth = 3
214234
epub_show_urls = 'no'
215-
epub_basename = project+ '-' +current_version
235+
epub_basename = project+ '-' +download_version

doc/pdf_stylesheet.rts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ base = sphinx
88

99
[linked reference]
1010
type = custom
11+
12+
[chapter]
13+
page_break = any

0 commit comments

Comments
 (0)