wasm: Add revamped tracked JavaScript values API #7619
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Copyright 2017-2022 Davide Bettio <davide@uninstall.it> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
| # | |
| name: Build and Test on macOS | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'src/platforms/emscripten/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/stm32/**' | |
| - 'doc/**' | |
| - 'LICENSES/**' | |
| - '*.Md' | |
| - '*.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'src/platforms/emscripten/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/stm32/**' | |
| - 'doc/**' | |
| - 'LICENSES/**' | |
| - '*.Md' | |
| - '*.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["macos-14", "macos-15", "macos-15-intel", "macos-26"] | |
| otp: ["26", "27", "28"] | |
| mbedtls: ["mbedtls@3"] | |
| cmake_opts_other: [""] | |
| include: | |
| - os: "macos-15-intel" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| - os: "macos-14" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| - os: "macos-15" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| # JIT + DWARF build (macOS aarch64) | |
| - os: "macos-26" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF -DAVM_DISABLE_JIT_DWARF=OFF" | |
| steps: | |
| # Setup | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| rebar3-version: ${{ fromJSON('{"26":"3.25.1","27":"3.25.1","28":"3.26"}')[matrix.otp] || '3' }} | |
| gleam-version: "1.15.2" | |
| hexpm-mirrors: | | |
| https://builds.hex.pm | |
| https://repo.hex.pm | |
| https://cdn.jsdelivr.net/hex | |
| - name: "Install deps" | |
| run: brew update && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install coreutils gperf doxygen socat ${{ matrix.mbedtls }} | |
| - name: "Workaround for nxdomain random issues" | |
| run: | | |
| # https://github.com/actions/runner-images/issues/8649#issuecomment-2231240347 | |
| for host in "$(hostname)" "$(hostname -f)"; do | |
| echo -e "$(ipconfig getifaddr en0) $(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts | |
| dscacheutil -q host -a name $(hostname -f) | |
| done | |
| - name: "Setup mbedtls@3 environment" | |
| if: matrix.mbedtls == 'mbedtls@3' | |
| run: | | |
| # Detect Homebrew prefix (Apple Silicon vs Intel) | |
| if [ -d "/opt/homebrew/opt/mbedtls@3" ]; then | |
| MBEDTLS_PREFIX="/opt/homebrew/opt/mbedtls@3" | |
| elif [ -d "/usr/local/opt/mbedtls@3" ]; then | |
| MBEDTLS_PREFIX="/usr/local/opt/mbedtls@3" | |
| else | |
| echo "Error: mbedtls@3 not found in expected locations" | |
| exit 1 | |
| fi | |
| echo "MBEDTLS_PREFIX=${MBEDTLS_PREFIX}" >> $GITHUB_ENV | |
| echo "LDFLAGS=-L${MBEDTLS_PREFIX}/lib" >> $GITHUB_ENV | |
| echo "CPPFLAGS=-I${MBEDTLS_PREFIX}/include" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=${MBEDTLS_PREFIX}/lib/pkgconfig" >> $GITHUB_ENV | |
| # Builder info | |
| - name: "System info" | |
| run: | | |
| echo "**uname:**" | |
| uname -a | |
| echo "**C Compiler version:**" | |
| clang --version | |
| clang++ --version | |
| echo "**CMake version:**" | |
| cmake --version | |
| # Build | |
| - name: "Build: create build dir" | |
| run: mkdir build | |
| - name: "Build: run cmake" | |
| working-directory: build | |
| run: | | |
| cmake -DAVM_WARNINGS_ARE_ERRORS=ON ${MBEDTLS_PREFIX:+-DCMAKE_PREFIX_PATH="$MBEDTLS_PREFIX"} ${{ matrix.cmake_opts_other }} -G Ninja .. | |
| - name: "Build: run ninja" | |
| working-directory: build | |
| run: ninja | |
| - name: "Build: run dialyzer" | |
| working-directory: build | |
| run: ninja dialyzer | |
| # Test | |
| - name: "Test: test-erlang" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./tests/test-erlang | |
| - name: "Test: dwarf (test_executable_line)" | |
| if: matrix.cmake_opts_other == '-DAVM_DISABLE_JIT=OFF -DAVM_DISABLE_JIT_DWARF=OFF' | |
| timeout-minutes: 4 | |
| working-directory: build | |
| env: | |
| # Apple lldb < 2100 hangs forever resolving pending source-line | |
| # breakpoints against JIT-emitted DWARF on macOS 26 (the active | |
| # Xcode 26.2 lldb is 1703.x). The CommandLineTools lldb is at | |
| # 2100 and works. | |
| LLDB: /Library/Developer/CommandLineTools/usr/bin/lldb | |
| run: | | |
| [ -x "$LLDB" ] || { echo "FAIL: $LLDB not executable"; exit 1; } | |
| echo "## using $LLDB" | |
| "$LLDB" --version | head -2 | |
| LOG=/tmp/lldb-test_executable_line.log | |
| set +e | |
| gtimeout --foreground -k 30 120 "$LLDB" -b \ | |
| -o "log enable -f /tmp/lldb-jit-loader.log lldb jit" \ | |
| -o "log enable -f /tmp/lldb-gdb-test.log gdb-remote packets" \ | |
| -o "settings set plugin.jit-loader.gdb.enable on" \ | |
| -o "breakpoint set -f test_executable_line.erl -l 49" \ | |
| -o "breakpoint set -f test_executable_line.erl -l 52" \ | |
| -o "run" \ | |
| -o "print term_to_int(ctx->x[0])" \ | |
| -o "c" \ | |
| -o "print term_to_int(ctx->x[0])" \ | |
| -o "quit" \ | |
| -- ./tests/test-erlang test_executable_line 2>&1 | tee "$LOG" | |
| LLDB_RC=${PIPESTATUS[0]} | |
| set -e | |
| if [ "$LLDB_RC" -eq 124 ] || [ "$LLDB_RC" -eq 137 ]; then | |
| echo "FAIL: lldb timed out (rc=$LLDB_RC)" | |
| [ -f /tmp/lldb-jit-loader.log ] && { echo "## jit log"; head -200 /tmp/lldb-jit-loader.log; } | |
| [ -f /tmp/lldb-gdb-test.log ] && { echo "## gdb-remote packets (tail)"; tail -120 /tmp/lldb-gdb-test.log; } | |
| exit 1 | |
| fi | |
| VALUES=$(sed -n 's/^(\(avm_int_t\)) \(-\{0,1\}[0-9][0-9]*\).*/\2/p' "$LOG") | |
| FIRST=$(echo "$VALUES" | sed -n '1p') | |
| SECOND=$(echo "$VALUES" | sed -n '2p') | |
| if [ "$FIRST" != "42" ]; then | |
| echo "FAIL: expected 42 at line 49, got '$FIRST'" | |
| exit 1 | |
| fi | |
| if [ "$SECOND" != "2" ]; then | |
| echo "FAIL: expected 2 at line 52, got '$SECOND'" | |
| exit 1 | |
| fi | |
| echo "PASS: test_executable_line dwarf test" | |
| - name: "Test: dwarf (test_debug_line)" | |
| if: matrix.cmake_opts_other == '-DAVM_DISABLE_JIT=OFF -DAVM_DISABLE_JIT_DWARF=OFF' | |
| timeout-minutes: 6 | |
| working-directory: build | |
| env: | |
| LLDB: /Library/Developer/CommandLineTools/usr/bin/lldb | |
| run: | | |
| [ -x "$LLDB" ] || { echo "FAIL: $LLDB not executable"; exit 1; } | |
| LOG=/tmp/lldb-test_debug_line.log | |
| set +e | |
| gtimeout --foreground -k 30 240 "$LLDB" -b \ | |
| -o "settings set plugin.jit-loader.gdb.enable on" \ | |
| -o "breakpoint set -f test_debug_line.erl -l 49" \ | |
| -o "breakpoint set -f test_debug_line.erl -l 52" \ | |
| -o "run" \ | |
| -o "print term_to_int(N)" \ | |
| -o "c" \ | |
| -o "print term_to_int(Z)" \ | |
| -o "quit" \ | |
| -- ./tests/test-erlang test_debug_line 2>&1 | tee "$LOG" | |
| LLDB_RC=${PIPESTATUS[0]} | |
| set -e | |
| if [ "$LLDB_RC" -eq 124 ] || [ "$LLDB_RC" -eq 137 ]; then | |
| echo "FAIL: lldb timed out (rc=$LLDB_RC)" | |
| exit 1 | |
| fi | |
| VALUES=$(sed -n 's/^(\(avm_int_t\)) \(-\{0,1\}[0-9][0-9]*\).*/\2/p' "$LOG") | |
| FIRST=$(echo "$VALUES" | sed -n '1p') | |
| SECOND=$(echo "$VALUES" | sed -n '2p') | |
| if [ "$FIRST" != "42" ]; then | |
| echo "FAIL: expected 42 at line 49, got '$FIRST'" | |
| exit 1 | |
| fi | |
| if [ "$SECOND" != "2" ]; then | |
| echo "FAIL: expected 2 at line 52, got '$SECOND'" | |
| exit 1 | |
| fi | |
| echo "PASS: test_debug_line dwarf test" | |
| - name: "Test: test-enif" | |
| working-directory: build | |
| run: | | |
| ./tests/test-enif | |
| - name: "Test: test-heap" | |
| working-directory: build | |
| run: | | |
| ./tests/test-heap | |
| - name: "Test: test-mailbox" | |
| working-directory: build | |
| run: | | |
| ./tests/test-mailbox | |
| - name: "Test: test-structs" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./tests/test-structs | |
| - name: "Test: test-term" | |
| working-directory: build | |
| run: | | |
| ./tests/test-term | |
| - name: "Test: test_etest.avm" | |
| timeout-minutes: 5 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/etest/test_etest.avm | |
| - name: "Test: test_estdlib.avm" | |
| timeout-minutes: 20 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm | |
| - name: "Test: test_eavmlib.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm | |
| - name: "Test: test_jit.avm" | |
| timeout-minutes: 20 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM tests/libs/jit/test_jit.avm | |
| - name: "Test: test_alisp.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/alisp/test_alisp.avm | |
| - name: "Install and smoke test" | |
| working-directory: build | |
| run: | | |
| sudo ninja install | |
| atomvm examples/erlang/hello_world.avm | |
| atomvm -v | |
| atomvm -h |