diff --git a/.github/examples-manifest.yml b/.github/examples-manifest.yml index 78b21df1..328e0ce1 100644 --- a/.github/examples-manifest.yml +++ b/.github/examples-manifest.yml @@ -1720,19 +1720,8 @@ examples: path: mynewt mode: skip reason: >- - The full newt build (native bsp sim + TLS run) is a follow-up: jenkins.sh - here has been unrun since 2018 and pulls the whole Apache Mynewt RTOS, which - is a lot of unproven CI surface. What IS covered now: the wolfSSL Mynewt - PORT compiles. Found by wiring this up, it did not -- settings.h set - XMALLOC_USER (for user-provided FUNCTIONS) yet defined XFREE as a MACRO, so - types.h's "extern void XFREE(void *p, ...)" under the XMALLOC_USER branch had - the macro expand into it: "expected identifier". Fixed on wolfSSL master - 2026-07-20 (XMALLOC_USER -> XMALLOC_OVERRIDE); v5.9.2-stable still has it. - mynewt.yml compiles that exact header path on both refs (patching the ones - that predate the fix) via ci-compile-check.sh, so the bug cannot come back - unseen. Un-skip for the full newt build once stable carries the fix. (Also - fixed here: client-tls-mn.c cast pointers through int, which -Werror rejects - on the 64-bit native BSP.) + Kept for reference only. wolfSSL removed Apache Mynewt support after + v5.9.4-stable, so this cannot build against the wolfSSL refs CI tests. - id: picotcp path: picotcp diff --git a/.github/workflows/mynewt.yml b/.github/workflows/mynewt.yml deleted file mode 100644 index 825abc6e..00000000 --- a/.github/workflows/mynewt.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Mynewt - -on: - push: - branches: [master] - paths: - - 'mynewt/**' - - '.github/workflows/mynewt.yml' - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths: - - 'mynewt/**' - - '.github/workflows/mynewt.yml' - # No cron: nightly.yml calls this, so the nightly stays one run and one triage writer - workflow_call: - inputs: - caller_run_id: - description: 'run id of the calling workflow; keeps a called run in its own concurrency group' - type: string - default: '' - workflow_dispatch: - -# github.workflow is the CALLER's name in a called workflow, so hardcode ours -concurrency: - group: ${{ inputs.caller_run_id && format('mynewt-call-{0}', inputs.caller_run_id) || format('mynewt-{0}', github.ref) }} - cancel-in-progress: ${{ !inputs.caller_run_id }} - -permissions: - contents: read - -jobs: - resolve: - uses: ./.github/workflows/_resolve-wolfssl.yml - with: - stable_count: 1 - - mynewt: - needs: resolve - name: Build / mynewt (wolfSSL port compiles) wolfSSL ${{ matrix.wolfssl_ref }} - if: github.event_name != 'pull_request' || github.event.pull_request.draft == false - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - wolfssl_ref: ${{ fromJson(needs.resolve.outputs.refs_json) }} - timeout-minutes: 15 - steps: - - uses: actions/checkout@v5 - - uses: ./.github/actions/apt-update - - name: Install build-essential - run: sudo apt-get install -y --no-install-recommends build-essential - - # A full newt build needs the Apache Mynewt RTOS; the port bug is entirely - # in wolfSSL's settings.h/types.h, so ci-compile-check.sh compiles just that - # header path with the RTOS headers stubbed -- the exact thing that was broken. - - name: Compile the wolfSSL Mynewt port header path - run: | - set -euo pipefail - bash "$GITHUB_WORKSPACE/.github/scripts/git-clone-retry.sh" -q --depth 1 --branch '${{ matrix.wolfssl_ref }}' \ - https://github.com/wolfSSL/wolfssl /tmp/wolfssl - ./mynewt/ci-compile-check.sh /tmp/wolfssl diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 36c618fc..24bf8c67 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -85,12 +85,6 @@ jobs: with: caller_run_id: ${{ github.run_id }} - mynewt: - needs: [refs] - uses: ./.github/workflows/mynewt.yml - with: - caller_run_id: ${{ github.run_id }} - cert-expiry: needs: [refs] uses: ./.github/workflows/cert-expiry.yml diff --git a/README.md b/README.md index f936bd3b..840511f2 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,8 @@ usage and details. #### mynewt (Apache Mynewt Examples) This directory contains examples that demonstrate using wolfSSL with Apache -Mynewt OS. +Mynewt OS. Requires wolfSSL v5.9.4-stable or earlier; Apache Mynewt support +was removed from later wolfSSL versions. Please see the [mynewt/README.md](mynewt/README.md) for further usage and details. diff --git a/mynewt/README.md b/mynewt/README.md index 9baec02f..42476020 100644 --- a/mynewt/README.md +++ b/mynewt/README.md @@ -4,6 +4,9 @@ [Mynewt](https://mynewt.apache.org) is a security-oriented OS for IoT. +NOTE: Apache Mynewt support was removed from wolfSSL after v5.9.4-stable. These +examples require wolfSSL v5.9.4-stable or earlier. + WolfSSL integration with the Mynewt OS may be found in the `/IDE/mynewt` directory in the `wolfssl` source-tree. Support includes the wolfCrypt test application which demonstrates the cryptography provided by the wolfCrypt diff --git a/mynewt/ci-compile-check.sh b/mynewt/ci-compile-check.sh deleted file mode 100755 index 59257afa..00000000 --- a/mynewt/ci-compile-check.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Compile the wolfSSL Mynewt header path against $1 (a wolfSSL source tree). -# A full newt build needs the Apache Mynewt RTOS; the port bug is entirely in -# wolfSSL's settings.h/types.h, so we compile just that path with the RTOS -# headers it pulls in stubbed. The bug: the Mynewt block sets XMALLOC_USER yet -# defines XFREE as a macro, so types.h's "extern void XFREE(...)" has the macro -# expand into it. Fix: XMALLOC_USER -> XMALLOC_OVERRIDE. -set -eu - -WOLFSSL="$1" -d=$(mktemp -d) -trap 'rm -rf "$d"' EXIT - -mkdir -p "$d/os" "$d/mn_socket" "$d/fs" -cat > "$d/os/os_malloc.h" <<'EOF' -#ifndef OS_MALLOC_H -#define OS_MALLOC_H -#include -static inline void* os_malloc(size_t n){ return malloc(n); } -static inline void* os_realloc(void* p, size_t n){ return realloc(p, n); } -static inline void os_free(void* p){ free(p); } -#endif -EOF -printf '#ifndef OS_TIME_H\n#define OS_TIME_H\n#endif\n' > "$d/os/os_time.h" -printf '#ifndef MN_SOCKET_H\n#define MN_SOCKET_H\n#endif\n' > "$d/mn_socket/mn_socket.h" -printf '#ifndef FS_H\n#define FS_H\n#endif\n' > "$d/fs/fs.h" -: > "$d/user_settings.h" -cat > "$d/probe.c" <<'EOF' -#define WOLFSSL_APACHE_MYNEWT -#include -#include -int main(void){ char* p = (char*)XMALLOC(8, NULL, 0); XFREE(p, NULL, 0); return 0; } -EOF - -# Fixed on wolfSSL master 2026-07-20; refs predating that (e.g. v5.9.2-stable) -# still carry the bug, so patch them. The sed is idempotent -- a no-op once a -# ref has the fix -- so this whole script drops out when the pinned stable bumps. -if gcc -I"$d" -I"$WOLFSSL" -c "$d/probe.c" -o /dev/null 2>/dev/null; then - echo "this ref already has the upstream XMALLOC_OVERRIDE fix" -else - echo "this ref predates the upstream fix; applying XMALLOC_OVERRIDE" - perl -0pi -e 's/(#define NO_ERROR_STRINGS\n\s*)#define XMALLOC_USER(\s*\n\s*#define XMALLOC\(sz, heap, type\)\s+\(\(void\)\(heap\), \(void\)\(type\), os_malloc)/${1}#define XMALLOC_OVERRIDE${2}/' \ - "$WOLFSSL/wolfssl/wolfcrypt/settings.h" - grep -q XMALLOC_OVERRIDE "$WOLFSSL/wolfssl/wolfcrypt/settings.h" -fi - -gcc -I"$d" -I"$WOLFSSL" -c "$d/probe.c" -o /dev/null -echo "PASS: wolfSSL Mynewt port header path compiles" diff --git a/mynewt/jenkins.sh b/mynewt/jenkins.sh index d02532a8..b200b837 100755 --- a/mynewt/jenkins.sh +++ b/mynewt/jenkins.sh @@ -4,7 +4,7 @@ BASEDIR=`cd $BASEDIR && pwd -P` # Resolve local WOLFSSL_REPO to absolute path. WOLFSSL_REPO=${WOLFSSL_REPO:-https://github.com/wolfSSL/wolfssl.git} -WOLFSSL_BRANCH=${WOLFSSL_BRANCH:-master} +WOLFSSL_BRANCH=${WOLFSSL_BRANCH:-v5.9.4-stable} if [ -d "$WOLFSSL_REPO" ]; then WOLFSSL_REPO=$(cd "$WOLFSSL_REPO" && pwd -P) fi