From 41d4aef02e3bcf9b1590dfa7ac9759f2a592b426 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 31 Jan 2026 02:41:52 +0000 Subject: [PATCH 01/33] Bump version to 0.1.0- [skip ci] --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6c6aa7c..a904a4c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.0- From 78737044ec9eb9a7b0e563314d5eb834745e9adf Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Fri, 30 Jan 2026 18:46:43 -0800 Subject: [PATCH 02/33] Fixing links for the various badges. --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index df175ca..0bd6d81 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,27 @@ | Platform | Status | | -------- | ------ | -| x86_64-pc-linux-gnu | [![x86_64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml) | -| aarch64-pc-linux-gnu | [![aarch64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml) | -| x86_64-apple-darwin | [![x86_64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml) | -| aarch64-apple-darwin | [![aarch64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml) | -| x86_64-pc-windows-msvc | [![x86_64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml) | -| aarch64-pc-windows-msvc | [![aarch64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml) | -| x86_64-pc-windows-gnu | [![x86_64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml) | -| aarch64-pc-windows-gnu | [![aarch64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml) | -| x86_64-unknown-linux-android | [![x86_64-unknown-linux-android](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml) | -| aarch64-apple-ios | [![aarch64-apple-ios](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml) | -| arm-unknown-linux-gnueabihf | [![arm-unknown-linux-gnueabihf](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml) | -| riscv64-unknown-linux-gnu | [![riscv64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml) | -| mipsel-unknown-linux-gnu | [![mipsel-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml) | -| mips64el-unknown-linux-gnuabi64 | [![mips64el-unknown-linux-gnuabi64](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml) | -| powerpc64le-unknown-linux-gnu | [![powerpc64le-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml) | -| s390x-ibm-linux-gnu | [![s390x-ibm-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml) | -| sparc64-unknown-linux-gnu | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | -| powerpc-unknown-linux-gnu | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | -| i386-unknown-linux-gnu | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | - -[![Coverage](https://libplctag.github.io/libyafl/coverage/coverage.svg)](https://libplctag.github.io/libyafl/coverage/index.html) +| x86_64-pc-linux-gnu | [![x86_64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml) | +| aarch64-pc-linux-gnu | [![aarch64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml) | +| x86_64-apple-darwin | [![x86_64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml) | +| aarch64-apple-darwin | [![aarch64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml) | +| x86_64-pc-windows-msvc | [![x86_64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml) | +| aarch64-pc-windows-msvc | [![aarch64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml) | +| x86_64-pc-windows-gnu | [![x86_64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml) | +| aarch64-pc-windows-gnu | [![aarch64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml) | +| x86_64-unknown-linux-android | [![x86_64-unknown-linux-android](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml) | +| aarch64-apple-ios | [![aarch64-apple-ios](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml) | +| arm-unknown-linux-gnueabihf | [![arm-unknown-linux-gnueabihf](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml) | +| riscv64-unknown-linux-gnu | [![riscv64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml) | +| mipsel-unknown-linux-gnu | [![mipsel-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml) | +| mips64el-unknown-linux-gnuabi64 | [![mips64el-unknown-linux-gnuabi64](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml) | +| powerpc64le-unknown-linux-gnu | [![powerpc64le-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml) | +| s390x-ibm-linux-gnu | [![s390x-ibm-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml) | +| sparc64-unknown-linux-gnu | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | +| powerpc-unknown-linux-gnu | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | +| i386-unknown-linux-gnu | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | + +[![Coverage](docs/coverage.svg)](docs/coverage/index.html) A portable, low-level C11 fiber/coroutine library derived from Boost.Context. From b2957326666c27a3722bd19d2f6779b28af01459 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 06:13:04 -0800 Subject: [PATCH 03/33] Splitting out the coverage report to prerelease and the tagging to the release branch. --- .github/workflows/coverage.yml | 9 +++++---- .github/workflows/release.yml | 19 ------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 36bb92b..2d04d3e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,8 +2,9 @@ name: coverage on: push: - branches: [release] + branches: [prerelease] pull_request: + branches: [prerelease] jobs: coverage: @@ -42,8 +43,8 @@ jobs: run: | touch docs/.nojekyll - - name: Commit and push coverage to repository - if: github.event_name == 'push' && github.ref == 'refs/heads/release' + - name: Commit and push coverage to prerelease + if: github.event_name == 'push' && github.ref == 'refs/heads/prerelease' run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" @@ -51,5 +52,5 @@ jobs: if git diff --quiet --cached; then echo "No coverage changes to commit" else - git commit -m "Update code coverage report" && git push origin release + git commit -m "Update code coverage report [skip ci]" && git push origin prerelease fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f15835b..839aea1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,22 +171,3 @@ jobs: target_commitish: ${{ github.event.workflow_run.head_sha }} draft: false prerelease: false - - - name: Update prerelease version - if: steps.check-all.outputs.ready == 'true' - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - - git fetch origin prerelease - git checkout prerelease - - # Increment version - chmod +x scripts/increment_version.sh - ./scripts/increment_version.sh - - # Commit and push - git add VERSION - NEW_VER=$(cat VERSION) - git commit -m "Bump version to $NEW_VER [skip ci]" - git push origin prerelease From 543f3b717450e9a6942405d0e19e6a64751921d5 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 06:38:17 -0800 Subject: [PATCH 04/33] The version format changed but the scripts that process it didn't. Oops. --- CMakeLists.txt | 12 +++++------ VERSION | 2 +- scripts/increment_version.sh | 40 ++++++++++++++++++++++++++++-------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd2fa91..f6d8797 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,21 +6,21 @@ cmake_minimum_required(VERSION 3.10) -# Read version from file -set(PROJECT_VERSION_FULL "0.0.0-0") +# Read version from file (format: major.minor.patch) +set(PROJECT_VERSION_FULL "0.1.0") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION") file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VER_FILE_CONTENT) if(VER_FILE_CONTENT) string(STRIP "${VER_FILE_CONTENT}" VER_FILE_CONTENT_STRIPPED) if(VER_FILE_CONTENT_STRIPPED) - set(PROJECT_VERSION_FULL "${VER_FILE_CONTENT_STRIPPED}") + # Extract only the numeric part (major.minor.patch) before any non-numeric suffix + string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" PROJECT_VERSION_FULL "${VER_FILE_CONTENT_STRIPPED}") endif() endif() endif() -# CMake project version must be numeric (major.minor.patch.tweak) -string(REPLACE "-" "." PROJECT_VERSION_CMAKE "${PROJECT_VERSION_FULL}") -project(yafl VERSION ${PROJECT_VERSION_CMAKE} LANGUAGES C) +# Use version directly with CMake project +project(yafl VERSION ${PROJECT_VERSION_FULL} LANGUAGES C) # ============================================================================ # Enforce Out-of-Source Builds diff --git a/VERSION b/VERSION index a904a4c..6e8bf73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0- +0.1.0 diff --git a/scripts/increment_version.sh b/scripts/increment_version.sh index 408440c..47ec57f 100644 --- a/scripts/increment_version.sh +++ b/scripts/increment_version.sh @@ -2,25 +2,49 @@ set -e VERSION_FILE="VERSION" +BUMP_TYPE="${1:-patch}" # patch, minor, or major (default: patch) if [ ! -f "$VERSION_FILE" ]; then echo "Error: $VERSION_FILE not found." exit 1 fi -CURRENT_VERSION=$(cat "$VERSION_FILE") +CURRENT_VERSION=$(cat "$VERSION_FILE" | xargs) # Strip whitespace -# Split into BASE (Boost version) and RELEASE (N) -BASE_VERSION=${CURRENT_VERSION%-*} -RELEASE_NUM=${CURRENT_VERSION##*-} +# Validate format (major.minor.patch) +if ! [[ $CURRENT_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: VERSION must be in format major.minor.patch, got: $CURRENT_VERSION" + exit 1 +fi + +# Split version into components +IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION" + +# Increment based on bump type +case "$BUMP_TYPE" in + major) + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + ;; + minor) + MINOR=$((MINOR + 1)) + PATCH=0 + ;; + patch) + PATCH=$((PATCH + 1)) + ;; + *) + echo "Error: BUMP_TYPE must be 'major', 'minor', or 'patch', got: $BUMP_TYPE" + exit 1 + ;; +esac -# Increment N -NEW_RELEASE_NUM=$((RELEASE_NUM + 1)) -NEW_VERSION="${BASE_VERSION}-${NEW_RELEASE_NUM}" +NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}" echo "$NEW_VERSION" > "$VERSION_FILE" -echo "Version bumped: $CURRENT_VERSION -> $NEW_VERSION" +echo "Version bumped: $CURRENT_VERSION -> $NEW_VERSION (type: $BUMP_TYPE)" if [ -n "$GITHUB_OUTPUT" ]; then echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" fi \ No newline at end of file From 17747b9100b926e1eeafb65ffca7544552668a12 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 31 Jan 2026 14:38:54 +0000 Subject: [PATCH 05/33] Update code coverage report [skip ci] --- docs/.nojekyll | 0 docs/coverage.svg | 20 + docs/coverage/amber.png | Bin 0 -> 141 bytes docs/coverage/cmd_line | 1 + docs/coverage/emerald.png | Bin 0 -> 141 bytes docs/coverage/gcov.css | 1073 +++++++++++++++++ docs/coverage/glass.png | Bin 0 -> 167 bytes docs/coverage/index-sort-f.html | 117 ++ docs/coverage/index-sort-l.html | 117 ++ docs/coverage/index.html | 117 ++ docs/coverage/ruby.png | Bin 0 -> 141 bytes docs/coverage/snow.png | Bin 0 -> 141 bytes docs/coverage/src/index-sort-f.html | 105 ++ docs/coverage/src/index-sort-l.html | 105 ++ docs/coverage/src/index.html | 105 ++ docs/coverage/src/yafl.c.func-c.html | 131 ++ docs/coverage/src/yafl.c.func.html | 131 ++ docs/coverage/src/yafl.c.gcov.html | 499 ++++++++ docs/coverage/tests/index-sort-f.html | 141 +++ docs/coverage/tests/index-sort-l.html | 141 +++ docs/coverage/tests/index.html | 141 +++ .../tests/test_yafl_basic.c.func-c.html | 166 +++ .../tests/test_yafl_basic.c.func.html | 166 +++ .../tests/test_yafl_basic.c.gcov.html | 403 +++++++ .../tests/test_yafl_guard.c.func-c.html | 103 ++ .../tests/test_yafl_guard.c.func.html | 103 ++ .../tests/test_yafl_guard.c.gcov.html | 290 +++++ .../tests/test_yafl_many.c.func-c.html | 89 ++ .../coverage/tests/test_yafl_many.c.func.html | 89 ++ .../coverage/tests/test_yafl_many.c.gcov.html | 206 ++++ .../test_yafl_suspend_resume.c.func-c.html | 152 +++ .../test_yafl_suspend_resume.c.func.html | 152 +++ .../test_yafl_suspend_resume.c.gcov.html | 290 +++++ docs/coverage/updown.png | Bin 0 -> 117 bytes 34 files changed, 5153 insertions(+) create mode 100644 docs/.nojekyll create mode 100644 docs/coverage.svg create mode 100644 docs/coverage/amber.png create mode 100644 docs/coverage/cmd_line create mode 100644 docs/coverage/emerald.png create mode 100644 docs/coverage/gcov.css create mode 100644 docs/coverage/glass.png create mode 100644 docs/coverage/index-sort-f.html create mode 100644 docs/coverage/index-sort-l.html create mode 100644 docs/coverage/index.html create mode 100644 docs/coverage/ruby.png create mode 100644 docs/coverage/snow.png create mode 100644 docs/coverage/src/index-sort-f.html create mode 100644 docs/coverage/src/index-sort-l.html create mode 100644 docs/coverage/src/index.html create mode 100644 docs/coverage/src/yafl.c.func-c.html create mode 100644 docs/coverage/src/yafl.c.func.html create mode 100644 docs/coverage/src/yafl.c.gcov.html create mode 100644 docs/coverage/tests/index-sort-f.html create mode 100644 docs/coverage/tests/index-sort-l.html create mode 100644 docs/coverage/tests/index.html create mode 100644 docs/coverage/tests/test_yafl_basic.c.func-c.html create mode 100644 docs/coverage/tests/test_yafl_basic.c.func.html create mode 100644 docs/coverage/tests/test_yafl_basic.c.gcov.html create mode 100644 docs/coverage/tests/test_yafl_guard.c.func-c.html create mode 100644 docs/coverage/tests/test_yafl_guard.c.func.html create mode 100644 docs/coverage/tests/test_yafl_guard.c.gcov.html create mode 100644 docs/coverage/tests/test_yafl_many.c.func-c.html create mode 100644 docs/coverage/tests/test_yafl_many.c.func.html create mode 100644 docs/coverage/tests/test_yafl_many.c.gcov.html create mode 100644 docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html create mode 100644 docs/coverage/tests/test_yafl_suspend_resume.c.func.html create mode 100644 docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html create mode 100644 docs/coverage/updown.png diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/coverage.svg b/docs/coverage.svg new file mode 100644 index 0000000..f737a95 --- /dev/null +++ b/docs/coverage.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + coverage + 86.1% + + diff --git a/docs/coverage/amber.png b/docs/coverage/amber.png new file mode 100644 index 0000000000000000000000000000000000000000..2cab170d8359081983a4e343848dfe06bc490f12 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^G2tW}LqE04T&+ z;1OBOz`!j8!i<;h*8KqrvZOouIx;Y9?C1WI$O`1M1^9%x{(levWG?NMQuI!iC1^Jb!lvI6;R0X`wF(yt=9xVZRt1vCRixIA4P dLn>}1Cji+@42)0J?}79&c)I$ztaD0e0sy@GAL0N2 literal 0 HcmV?d00001 diff --git a/docs/coverage/gcov.css b/docs/coverage/gcov.css new file mode 100644 index 0000000..f329042 --- /dev/null +++ b/docs/coverage/gcov.css @@ -0,0 +1,1073 @@ +/* All views: initial background and text color */ +body +{ + color: #000000; + background-color: #ffffff; +} + +/* All views: standard link format*/ +a:link +{ + color: #284fa8; + text-decoration: underline; +} + +/* All views: standard link - visited format */ +a:visited +{ + color: #00cb40; + text-decoration: underline; +} + +/* All views: standard link - activated format */ +a:active +{ + color: #ff0040; + text-decoration: underline; +} + +/* All views: main title format */ +td.title +{ + text-align: center; + padding-bottom: 10px; + font-family: sans-serif; + font-size: 20pt; + font-style: italic; + font-weight: bold; +} +/* "Line coverage date bins" leader */ +td.subTableHeader +{ + text-align: center; + padding-bottom: 6px; + font-family: sans-serif; + font-weight: bold; + vertical-align: center; +} + +/* All views: header item format */ +td.headerItem +{ + text-align: right; + padding-right: 6px; + font-family: sans-serif; + font-weight: bold; + vertical-align: top; + white-space: nowrap; +} + +/* All views: header item value format */ +td.headerValue +{ + text-align: left; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; +} + +/* All views: header item coverage table heading */ +td.headerCovTableHead +{ + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; +} + +/* All views: header item coverage table entry */ +td.headerCovTableEntry +{ + text-align: right; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #dae7fe; +} + +/* All views: header item coverage table entry for high coverage rate */ +td.headerCovTableEntryHi +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #a7fc9d; +} + +/* All views: header item coverage table entry for medium coverage rate */ +td.headerCovTableEntryMed +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ffea20; +} + +/* All views: header item coverage table entry for ow coverage rate */ +td.headerCovTableEntryLo +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ff0000; +} + +/* All views: header legend value for legend entry */ +td.headerValueLeg +{ + text-align: left; + color: #000000; + font-family: sans-serif; + font-size: 80%; + white-space: nowrap; + padding-top: 4px; +} + +/* All views: color of horizontal ruler */ +td.ruler +{ + background-color: #6688d4; +} + +/* All views: version string format */ +td.versionInfo +{ + text-align: center; + padding-top: 2px; + font-family: sans-serif; + font-style: italic; +} + +/* Directory view/File view (all)/Test case descriptions: + table headline format */ +td.tableHead +{ + text-align: center; + color: #ffffff; + background-color: #6688d4; + font-family: sans-serif; + font-size: 120%; + font-weight: bold; + white-space: nowrap; + padding-left: 4px; + padding-right: 4px; +} + +span.tableHeadSort +{ + padding-right: 4px; +} + +/* Directory view/File view (all): filename entry format */ +td.coverFile +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Directory view/File view (all): filename entry format */ +td.overallOwner +{ + text-align: center; + font-weight: bold; + font-family: sans-serif; + background-color: #dae7fe; + padding-right: 10px; + padding-left: 10px; +} + +/* Directory view/File view (all): filename entry format */ +td.ownerName +{ + text-align: right; + font-style: italic; + font-family: sans-serif; + background-color: #E5DBDB; + padding-right: 10px; + padding-left: 20px; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.coverBar +{ + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.owner_coverBar +{ + padding-left: 10px; + padding-right: 10px; + background-color: #E5DBDB; +} + +/* Directory view/File view (all): bar-graph outline color */ +td.coverBarOutline +{ + background-color: #000000; +} + +/* Directory view/File view (all): percentage entry for files with + high coverage rate */ +td.coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + font-weight: bold; + font-family: sans-serif; +} + +/* 'owner' entry: slightly lighter color than 'coverPerHi' */ +td.owner_coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #82E0AA; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry */ +td.coverNumDflt +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + white-space: nowrap; + font-family: sans-serif; +} + +/* td background color and font for the 'owner' section of the table */ +td.ownerTla +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #E5DBDB; + white-space: nowrap; + font-family: sans-serif; + font-style: italic; +} + +/* Directory view/File view (all): line count entry for files with + high coverage rate */ +td.coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #82E0AA; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + medium coverage rate */ +td.coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + font-weight: bold; + font-family: sans-serif; +} + +td.owner_coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #F9E79F; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + medium coverage rate */ +td.coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #F9E79F; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + low coverage rate */ +td.coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +td.owner_coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + low coverage rate */ +td.coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; + white-space: nowrap; + font-family: sans-serif; +} + +/* File view (all): "show/hide details" link format */ +a.detail:link +{ + color: #b8d0ff; + font-size:80%; +} + +/* File view (all): "show/hide details" link - visited format */ +a.detail:visited +{ + color: #b8d0ff; + font-size:80%; +} + +/* File view (all): "show/hide details" link - activated format */ +a.detail:active +{ + color: #ffffff; + font-size:80%; +} + +/* File view (detail): test name entry */ +td.testName +{ + text-align: right; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test percentage entry */ +td.testPer +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test lines count entry */ +td.testNum +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* Test case descriptions: test name format*/ +dt +{ + font-family: sans-serif; + font-weight: bold; +} + +/* Test case descriptions: description table body */ +td.testDescription +{ + padding-top: 10px; + padding-left: 30px; + padding-bottom: 10px; + padding-right: 30px; + background-color: #dae7fe; +} + +/* Source code view: function entry */ +td.coverFn +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: function entry nonzero count*/ +td.coverFnHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + font-family: sans-serif; +} + +td.coverFnAlias +{ + text-align: right; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + /* make this a slightly different color than the leader - otherwise, + otherwise the alias is hard to distinguish in the table */ + background-color: #E5DBDB; /* very light pale grey/blue */ + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnAliasLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; /* lighter red */ + font-family: sans-serif; +} + +/* Source code view: function entry nonzero count*/ +td.coverFnAliasHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: source code format */ +pre.source +{ + font-family: monospace; + white-space: pre; + margin-top: 2px; +} + +/* Source code view: line number format */ +span.lineNum +{ + background-color: #efe383; +} + +/* Source code view: format for Cov legend */ +span.coverLegendCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #cad7fe; +} + +/* Source code view: format for NoCov legend */ +span.coverLegendNoCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #ff6230; +} + +/* Source code view: format for the source code heading line */ +pre.sourceHeading +{ + white-space: pre; + font-family: monospace; + font-weight: bold; + margin: 0px; +} + +/* All views: header legend value for low rate */ +td.headerValueLegL +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 4px; + padding-right: 2px; + background-color: #ff0000; + font-size: 80%; +} + +/* All views: header legend value for med rate */ +td.headerValueLegM +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 2px; + background-color: #ffea20; + font-size: 80%; +} + +/* All views: header legend value for hi rate */ +td.headerValueLegH +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 4px; + background-color: #a7fc9d; + font-size: 80%; +} + +/* All views except source code view: legend format for low coverage */ +span.coverLegendCovLo +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ff0000; +} + +/* All views except source code view: legend format for med coverage */ +span.coverLegendCovMed +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ffea20; +} + +/* All views except source code view: legend format for hi coverage */ +span.coverLegendCovHi +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #a7fc9d; +} + +a.branchTla:link +{ + color: #000000; +} + +a.branchTla:visited +{ + color: #000000; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered New Code (+ => 0): +Newly added code is not tested" */ +td.tlaUNC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUNC { + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered New Code (+ => 0): +Newly added code is not tested" */ +span.tlaUNC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUNC { + background-color: #FF6230; +} +a.tlaBgUNC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUNC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Lost Baseline Coverage (1 => 0): +Unchanged code is no longer tested" */ +td.tlaLBC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgLBC { + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Lost Baseline Coverage (1 => 0): +Unchanged code is no longer tested" */ +span.tlaLBC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgLBC { + background-color: #FF6230; +} +a.tlaBgLBC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadLBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered Included Code (# => 0): +Previously unused code is untested" */ +td.tlaUIC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUIC { + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered Included Code (# => 0): +Previously unused code is untested" */ +span.tlaUIC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUIC { + background-color: #FF6230; +} +a.tlaBgUIC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUIC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered Baseline Code (0 => 0): +Unchanged code was untested before, is untested now" */ +td.tlaUBC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUBC { + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Uncovered Baseline Code (0 => 0): +Unchanged code was untested before, is untested now" */ +span.tlaUBC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUBC { + background-color: #FF6230; +} +a.tlaBgUBC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry backround: format for lines classified as "Gained Baseline Coverage (0 => 1): +Unchanged code is tested now" */ +td.tlaGBC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGBC { + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Gained Baseline Coverage (0 => 1): +Unchanged code is tested now" */ +span.tlaGBC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGBC { + background-color: #CAD7FE; +} +a.tlaBgGBC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Gained Included Coverage (# => 1): +Previously unused code is tested now" */ +td.tlaGIC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGIC { + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Gained Included Coverage (# => 1): +Previously unused code is tested now" */ +span.tlaGIC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGIC { + background-color: #CAD7FE; +} +a.tlaBgGIC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGIC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Gained New Coverage (+ => 1): +Newly added code is tested" */ +td.tlaGNC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGNC { + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Gained New Coverage (+ => 1): +Newly added code is tested" */ +span.tlaGNC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGNC { + background-color: #CAD7FE; +} +a.tlaBgGNC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGNC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Covered Baseline Code (1 => 1): +Unchanged code was tested before and is still tested" */ +td.tlaCBC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgCBC { + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Covered Baseline Code (1 => 1): +Unchanged code was tested before and is still tested" */ +span.tlaCBC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgCBC { + background-color: #CAD7FE; +} +a.tlaBgCBC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadCBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry backround: format for lines classified as "Excluded Uncovered Baseline (0 => #): +Previously untested code is unused now" */ +td.tlaEUB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgEUB { + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Excluded Uncovered Baseline (0 => #): +Previously untested code is unused now" */ +span.tlaEUB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgEUB { + background-color: #FFFFFF; +} +a.tlaBgEUB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadEUB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Excluded Covered Baseline (1 => #): +Previously tested code is unused now" */ +td.tlaECB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgECB { + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Excluded Covered Baseline (1 => #): +Previously tested code is unused now" */ +span.tlaECB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgECB { + background-color: #FFFFFF; +} +a.tlaBgECB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadECB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Deleted Uncovered Baseline (0 => -): +Previously untested code has been deleted" */ +td.tlaDUB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgDUB { + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Deleted Uncovered Baseline (0 => -): +Previously untested code has been deleted" */ +span.tlaDUB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgDUB { + background-color: #FFFFFF; +} +a.tlaBgDUB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadDUB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Deleted Covered Baseline (1 => -): +Previously tested code has been deleted" */ +td.tlaDCB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgDCB { + background-color: #FFFFFF; +} + +/* Source code view/table entry backround: format for lines classified as "Deleted Covered Baseline (1 => -): +Previously tested code has been deleted" */ +span.tlaDCB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgDCB { + background-color: #FFFFFF; +} +a.tlaBgDCB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadDCB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view: format for date/owner bin that is not hit */ +span.missBins +{ + background-color: #ff0000 /* red */ +} diff --git a/docs/coverage/glass.png b/docs/coverage/glass.png new file mode 100644 index 0000000000000000000000000000000000000000..e1abc00680a3093c49fdb775ae6bdb6764c95af2 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)gaEa{HEjtmSN`?>!lvI6;R0X`wF z|Ns97GD8ntt^-nxB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gf+eGhVt|_XjA* zUgGKN%6^Gmn4d%Ph(nkFP>9RZ#WAE}PI3Z}&BVayv3^M*kj3EX>gTe~DWM4f=_Dpv literal 0 HcmV?d00001 diff --git a/docs/coverage/index-sort-f.html b/docs/coverage/index-sort-f.html new file mode 100644 index 0000000..7fe2d54 --- /dev/null +++ b/docs/coverage/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - yafl Code Coverage + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:yafl Code CoverageLines:86.1 %539464
Test Date:2026-01-31 14:38:53Functions:89.5 %3834
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
src +
83.2%83.2%
+
83.2 %13711487.5 %87
tests +
87.1%87.1%
+
87.1 %40235090.0 %3027
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/index-sort-l.html b/docs/coverage/index-sort-l.html new file mode 100644 index 0000000..777c012 --- /dev/null +++ b/docs/coverage/index-sort-l.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - yafl Code Coverage + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:yafl Code CoverageLines:86.1 %539464
Test Date:2026-01-31 14:38:53Functions:89.5 %3834
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
src +
83.2%83.2%
+
83.2 %13711487.5 %87
tests +
87.1%87.1%
+
87.1 %40235090.0 %3027
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/index.html b/docs/coverage/index.html new file mode 100644 index 0000000..812f2e1 --- /dev/null +++ b/docs/coverage/index.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - yafl Code Coverage + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:yafl Code CoverageLines:86.1 %539464
Test Date:2026-01-31 14:38:53Functions:89.5 %3834
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
src +
83.2%83.2%
+
83.2 %13711487.5 %87
tests +
87.1%87.1%
+
87.1 %40235090.0 %3027
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/ruby.png b/docs/coverage/ruby.png new file mode 100644 index 0000000000000000000000000000000000000000..991b6d4ec9e78be165e3ef757eed1aada287364d GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^FceV#7`HfI^%F z9+AZi4BSE>%y{W;-5;PJOS+@4BLl<6e(pbstUx|nfKQ0)e^Y%R^MdiLxj>4`)5S5Q b;#P73kj=!v_*DHKNFRfztDnm{r-UW|iOwIS literal 0 HcmV?d00001 diff --git a/docs/coverage/snow.png b/docs/coverage/snow.png new file mode 100644 index 0000000000000000000000000000000000000000..2cdae107fceec6e7f02ac7acb4a34a82a540caa5 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^MM!lvI6;R0X`wF|Ns97GD8ntt^-nBo-U3d c6}OTTfNUlP#;5A{K>8RwUHx3vIVCg!071?oo&W#< literal 0 HcmV?d00001 diff --git a/docs/coverage/src/index-sort-f.html b/docs/coverage/src/index-sort-f.html new file mode 100644 index 0000000..4841c90 --- /dev/null +++ b/docs/coverage/src/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - yafl Code Coverage - src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - srcCoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
yafl.c +
83.2%83.2%
+
83.2 %13711487.5 %87
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/src/index-sort-l.html b/docs/coverage/src/index-sort-l.html new file mode 100644 index 0000000..2647ea8 --- /dev/null +++ b/docs/coverage/src/index-sort-l.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - yafl Code Coverage - src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - srcCoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
yafl.c +
83.2%83.2%
+
83.2 %13711487.5 %87
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/src/index.html b/docs/coverage/src/index.html new file mode 100644 index 0000000..6bb7701 --- /dev/null +++ b/docs/coverage/src/index.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - yafl Code Coverage - src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - srcCoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
yafl.c +
83.2%83.2%
+
83.2 %13711487.5 %87
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/src/yafl.c.func-c.html b/docs/coverage/src/yafl.c.func-c.html new file mode 100644 index 0000000..be4222e --- /dev/null +++ b/docs/coverage/src/yafl.c.func-c.html @@ -0,0 +1,131 @@ + + + + + + + LCOV - yafl Code Coverage - src/yafl.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - src - yafl.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
yafl_get_page_size0
yafl_fiber_stack_high_watermark4
fiber_entry_trampoline112
yafl_fiber_destroy118
yafl_fiber_create120
yafl_fiber_suspend1023
yafl_fiber_resume1137
yafl_fiber_status1426
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/src/yafl.c.func.html b/docs/coverage/src/yafl.c.func.html new file mode 100644 index 0000000..a4392a5 --- /dev/null +++ b/docs/coverage/src/yafl.c.func.html @@ -0,0 +1,131 @@ + + + + + + + LCOV - yafl Code Coverage - src/yafl.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - src - yafl.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
fiber_entry_trampoline112
yafl_fiber_create120
yafl_fiber_destroy118
yafl_fiber_resume1137
yafl_fiber_stack_high_watermark4
yafl_fiber_status1426
yafl_fiber_suspend1023
yafl_get_page_size0
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/src/yafl.c.gcov.html b/docs/coverage/src/yafl.c.gcov.html new file mode 100644 index 0000000..286bf49 --- /dev/null +++ b/docs/coverage/src/yafl.c.gcov.html @@ -0,0 +1,499 @@ + + + + + + + LCOV - yafl Code Coverage - src/yafl.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - src - yafl.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:83.2 %137114
Test Date:2026-01-31 14:38:53Functions:87.5 %87
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : /*
+       2              :  * yafl.c - Safe Fiber API Implementation
+       3              :  *
+       4              :  * Implements high-level fiber operations using low-level context switching.
+       5              :  * Stack allocation with optional guard pages and watermark support.
+       6              :  *
+       7              :  * Derived from Boost.Context (https://github.com/boostorg/context)
+       8              :  * Copyright Kyle Hayes (2026)
+       9              :  * Distributed under the Boost Software License, Version 1.0.
+      10              :  * (See accompanying file LICENSE or copy at
+      11              :  *  http://www.boost.org/LICENSE_1_0.txt)
+      12              :  */
+      13              : 
+      14              : #include <errno.h>
+      15              : #include <limits.h>
+      16              : #include <stdio.h>
+      17              : #include <stdlib.h>
+      18              : #include <string.h>
+      19              : 
+      20              : #ifdef _WIN32
+      21              :     #include <windows.h>
+      22              : #else
+      23              :     #include <sys/mman.h>
+      24              :     #include <unistd.h>
+      25              : #endif
+      26              : 
+      27              : #include "yafl.h"
+      28              : 
+      29              : /* ========================================================================
+      30              :  * Low-Level API (Internal Only)
+      31              :  * ======================================================================== */
+      32              : 
+      33              : /* Raw context handle - opaque pointer to saved machine state */
+      34              : typedef struct yafl_opaque_t *yafl_t;
+      35              : 
+      36              : /* Raw transfer between contexts */
+      37              : typedef struct {
+      38              :     yafl_t prev_context;
+      39              :     void *data;
+      40              : } yafl_transfer_t;
+      41              : 
+      42              : /* Raw entry function type for low-level API */
+      43              : typedef void (*yafl_entry_t)(yafl_transfer_t);
+      44              : 
+      45              : /* Low-level assembly-implemented functions */
+      46              : extern yafl_t make_fcontext(void *sp, size_t size, yafl_entry_t fn);
+      47              : extern yafl_transfer_t jump_fcontext(yafl_t const to, void *vp);
+      48              : 
+      49              : /* ========================================================================
+      50              :  * Constants and Types
+      51              :  * ======================================================================== */
+      52              : 
+      53              : #define FCONTEXT_FIBER_MAGIC 0xF1BE7001
+      54              : #define FCONTEXT_STACK_WATERMARK 0xA5
+      55              : #define FCONTEXT_STACK_ALIGNMENT 16
+      56              : 
+      57              : typedef enum {
+      58              :     FCONTEXT_ALLOC_MALLOC,
+      59              :     FCONTEXT_ALLOC_VMEM
+      60              : } yafl_alloc_type_t;
+      61              : 
+      62              : /* Internal fiber structure */
+      63              : struct yafl_fiber {
+      64              :     uint32_t magic;
+      65              :     yafl_alloc_type_t alloc_type;
+      66              :     yafl_fiber_status_t status;
+      67              : 
+      68              :     /* Stack management */
+      69              :     void *stack_region;
+      70              :     size_t stack_total_size;
+      71              :     void *stack_top;
+      72              :     size_t stack_size;
+      73              :     bool watermark_filled;
+      74              : 
+      75              :     /* Context tracking */
+      76              :     yafl_t context;            /* Fiber's saved context */
+      77              :     yafl_t resumer_context;    /* Context to return to */
+      78              : 
+      79              :     /* User entry and result */
+      80              :     yafl_fiber_fn user_entry;
+      81              :     void *cached_result;
+      82              :     void *pending_arg;         /* Argument for next resume */
+      83              : };
+      84              : 
+      85              : /* Typedef for internal use */
+      86              : typedef struct yafl_fiber yafl_fiber_t;
+      87              : 
+      88              : /* Thread-local storage */
+      89              : static _Thread_local yafl_fiber_t *tls_current_fiber = NULL;
+      90              : 
+      91              : /* ========================================================================
+      92              :  * Utility Functions
+      93              :  * ======================================================================== */
+      94              : 
+      95          104 : static size_t get_page_size(void) {
+      96              : #ifdef _WIN32
+      97              :     SYSTEM_INFO si;
+      98              :     GetSystemInfo(&si);
+      99              :     return (size_t)si.dwPageSize;
+     100              : #else
+     101          208 :     long page_size = sysconf(_SC_PAGE_SIZE);
+     102          104 :     if (page_size <= 0) {
+     103              :         return 4096;
+     104              :     }
+     105          104 :     return (size_t)page_size;
+     106              : #endif
+     107              : }
+     108              : 
+     109          116 : static void *align_stack_pointer(void *ptr) {
+     110          116 :     uintptr_t addr = (uintptr_t)ptr;
+     111          116 :     return (void *)(addr & ~(FCONTEXT_STACK_ALIGNMENT - 1));
+     112              : }
+     113              : 
+     114              : /* ========================================================================
+     115              :  * Trampoline: Adapts Low-Level API to High-Level Fiber API
+     116              :  * ======================================================================== */
+     117              : 
+     118              : /*
+     119              :  * This is called as the entry function by make_fcontext().
+     120              :  * It wraps the user's entry function, manages state, and handles the result.
+     121              :  */
+     122          112 : static void fiber_entry_trampoline(yafl_transfer_t t) {
+     123          112 :     yafl_fiber_t *fiber = (yafl_fiber_t *)t.data;
+     124              : 
+     125              :     /* Save resumer's context (who called resume on us) */
+     126          112 :     fiber->resumer_context = t.prev_context;
+     127              : 
+     128              :     /* Update status and TLS */
+     129          112 :     fiber->status = YAFL_FIBER_STATUS_RUNNING;
+     130          112 :     tls_current_fiber = fiber;
+     131              : 
+     132              :     /* Call user entry with argument from first resume */
+     133          112 :     void *result = fiber->user_entry(fiber->pending_arg);
+     134              : 
+     135              :     /* Mark complete and cache result */
+     136          112 :     fiber->status = YAFL_FIBER_STATUS_COMPLETE;
+     137          112 :     fiber->cached_result = result;
+     138          112 :     tls_current_fiber = NULL;
+     139              : 
+     140              :     /* Return to resumer with final result */
+     141          112 :     jump_fcontext(fiber->resumer_context, result);
+     142              : 
+     143              :     /* Should never reach here */
+     144            0 : }
+     145              : 
+     146              : /* ========================================================================
+     147              :  * Fiber Creation
+     148              :  * ======================================================================== */
+     149              : 
+     150          120 : extern yafl_fiber_t *yafl_fiber_create(yafl_fiber_fn fiber_fn, size_t stack_size,
+     151              :                                        yafl_stack_flags_t flags) {
+     152              :     /* Validate fiber function is not NULL */
+     153          120 :     if (fiber_fn == NULL) {
+     154              :         return NULL;
+     155              :     }
+     156              : 
+     157              :     /* Validate exactly one allocation type is set */
+     158          119 :     int alloc_flags = flags & (YAFL_STACK_FLAGS_MALLOC | YAFL_STACK_FLAGS_VMEM);
+     159          119 :     if (alloc_flags != YAFL_STACK_FLAGS_MALLOC && alloc_flags != YAFL_STACK_FLAGS_VMEM) {
+     160              :         return NULL;
+     161              :     }
+     162              : 
+     163          116 :     bool use_vmem = (flags & YAFL_STACK_FLAGS_VMEM) != 0;
+     164          116 :     bool use_watermark = (flags & YAFL_STACK_FLAGS_WATERMARK) != 0;
+     165              : 
+     166              :     /* Allocate fiber structure */
+     167          116 :     yafl_fiber_t *fiber = malloc(sizeof(yafl_fiber_t));
+     168          116 :     if (fiber == NULL) {
+     169              :         return NULL;
+     170              :     }
+     171              : 
+     172              :     /* Initialize fiber structure */
+     173          116 :     fiber->magic = FCONTEXT_FIBER_MAGIC;
+     174          116 :     fiber->alloc_type = use_vmem ? FCONTEXT_ALLOC_VMEM : FCONTEXT_ALLOC_MALLOC;
+     175          116 :     fiber->status = YAFL_FIBER_STATUS_SUSPENDED;
+     176          116 :     fiber->user_entry = fiber_fn;
+     177          116 :     fiber->cached_result = NULL;
+     178          116 :     fiber->pending_arg = NULL;
+     179          116 :     fiber->watermark_filled = use_watermark;
+     180          116 :     fiber->context = NULL;
+     181          116 :     fiber->resumer_context = NULL;
+     182              : 
+     183              :     /* Use default stack size if not specified */
+     184          116 :     if (stack_size == 0) {
+     185            1 :         stack_size = FCONTEXT_DEFAULT_STACK_SIZE;
+     186              :     }
+     187              : 
+     188              :     /* Allocate stack based on allocation type */
+     189          116 :     if (use_vmem) {
+     190          104 :         size_t page_size = get_page_size();
+     191          104 :         size_t stack_with_overhead = stack_size + 256;
+     192          104 :         size_t aligned_stack_size = ((stack_with_overhead + page_size - 1) / page_size) * page_size;
+     193          104 :         size_t guard_size = page_size;
+     194          104 :         size_t total_size = guard_size + aligned_stack_size + guard_size;
+     195              : 
+     196          104 :         void *region = NULL;
+     197              : #ifdef _WIN32
+     198              :         region = VirtualAlloc(NULL, total_size, MEM_RESERVE, PAGE_NOACCESS);
+     199              :         if (region == NULL) {
+     200              :             free(fiber);
+     201              :             return NULL;
+     202              :         }
+     203              :         void *stack_base = (char *)region + guard_size;
+     204              :         if (!VirtualAlloc(stack_base, aligned_stack_size, MEM_COMMIT, PAGE_READWRITE)) {
+     205              :             VirtualFree(region, 0, MEM_RELEASE);
+     206              :             free(fiber);
+     207              :             return NULL;
+     208              :         }
+     209              : #else
+     210          104 :         region = mmap(NULL, total_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+     211          104 :         if (region == MAP_FAILED) {
+     212            0 :             free(fiber);
+     213            0 :             return NULL;
+     214              :         }
+     215          104 :         if (mprotect(region, guard_size, PROT_NONE) == -1) {
+     216            0 :             munmap(region, total_size);
+     217            0 :             free(fiber);
+     218            0 :             return NULL;
+     219              :         }
+     220          104 :         if (mprotect((char *)region + guard_size + aligned_stack_size, guard_size, PROT_NONE) == -1) {
+     221            0 :             munmap(region, total_size);
+     222            0 :             free(fiber);
+     223            0 :             return NULL;
+     224              :         }
+     225          104 :         void *stack_base = (char *)region + guard_size;
+     226              : #endif
+     227              : 
+     228          104 :         void *stack_region_end = (char *)stack_base + aligned_stack_size;
+     229          104 :         void *stack_top = (char *)stack_region_end - 256;
+     230          104 :         stack_top = align_stack_pointer(stack_top);
+     231          104 :         size_t actual_stack_size = (char *)stack_top - (char *)stack_base;
+     232              : 
+     233          104 :         fiber->stack_region = region;
+     234          104 :         fiber->stack_total_size = total_size;
+     235          104 :         fiber->stack_top = stack_top;
+     236          104 :         fiber->stack_size = actual_stack_size;
+     237              :     } else {
+     238              :         /* malloc allocation */
+     239           12 :         size_t allocated_size = stack_size + 256;
+     240           12 :         void *block = malloc(allocated_size);
+     241           12 :         if (block == NULL) {
+     242            0 :             free(fiber);
+     243            0 :             return NULL;
+     244              :         }
+     245              : 
+     246           12 :         void *block_end = (char *)block + allocated_size;
+     247           12 :         void *stack_top = (char *)block_end - 256;
+     248           12 :         stack_top = align_stack_pointer(stack_top);
+     249              : 
+     250           12 :         size_t actual_stack_size = (char *)stack_top - (char *)block;
+     251              : 
+     252           12 :         fiber->stack_region = block;
+     253           12 :         fiber->stack_total_size = allocated_size;
+     254           12 :         fiber->stack_top = stack_top;
+     255           12 :         fiber->stack_size = actual_stack_size;
+     256              :     }
+     257              : 
+     258              :     /* Initialize the low-level context with trampoline as entry */
+     259          116 :     fiber->context = make_fcontext(fiber->stack_top, fiber->stack_size, fiber_entry_trampoline);
+     260          116 :     if (fiber->context == NULL) {
+     261            0 :         if (use_vmem) {
+     262              : #ifdef _WIN32
+     263              :             VirtualFree(fiber->stack_region, 0, MEM_RELEASE);
+     264              : #else
+     265            0 :             munmap(fiber->stack_region, fiber->stack_total_size);
+     266              : #endif
+     267              :         } else {
+     268            0 :             free(fiber->stack_region);
+     269              :         }
+     270            0 :         free(fiber);
+     271            0 :         return NULL;
+     272              :     }
+     273              : 
+     274              :     /* Apply watermark if requested */
+     275          116 :     if (use_watermark) {
+     276            4 :         memset((char *)fiber->stack_top - fiber->stack_size, FCONTEXT_STACK_WATERMARK, fiber->stack_size);
+     277              :         /* Reinitialize context after watermark (overwrites filled area) */
+     278            4 :         fiber->context = make_fcontext(fiber->stack_top, fiber->stack_size, fiber_entry_trampoline);
+     279            4 :         if (fiber->context == NULL) {
+     280            0 :             if (use_vmem) {
+     281              : #ifdef _WIN32
+     282              :                 VirtualFree(fiber->stack_region, 0, MEM_RELEASE);
+     283              : #else
+     284            0 :                 munmap(fiber->stack_region, fiber->stack_total_size);
+     285              : #endif
+     286              :             } else {
+     287            0 :                 free(fiber->stack_region);
+     288              :             }
+     289            0 :             free(fiber);
+     290            0 :             return NULL;
+     291              :         }
+     292              :     }
+     293              : 
+     294              :     return fiber;
+     295              : }
+     296              : 
+     297              : /* ========================================================================
+     298              :  * Fiber Control Flow
+     299              :  * ======================================================================== */
+     300              : 
+     301         1137 : extern void *yafl_fiber_resume(yafl_fiber_t *fiber, void *arg) {
+     302              :     /* Validation */
+     303         1137 :     if (fiber == NULL || fiber->magic != FCONTEXT_FIBER_MAGIC) {
+     304              :         return NULL;
+     305              :     }
+     306              : 
+     307              :     /* If complete, return cached result (idempotent) */
+     308         1136 :     if (fiber->status == YAFL_FIBER_STATUS_COMPLETE) {
+     309            1 :         return fiber->cached_result;
+     310              :     }
+     311              : 
+     312              :     /* Cannot resume running fiber */
+     313         1135 :     if (fiber->status == YAFL_FIBER_STATUS_RUNNING) {
+     314              :         return NULL;
+     315              :     }
+     316              : 
+     317              :     /* Store argument for delivery */
+     318         1135 :     fiber->pending_arg = arg;
+     319              : 
+     320              :     /* Update status and TLS */
+     321         1135 :     fiber->status = YAFL_FIBER_STATUS_RUNNING;
+     322         1135 :     tls_current_fiber = fiber;
+     323              : 
+     324              :     /* Pass fiber pointer to trampoline on first resume */
+     325         1135 :     void *transfer_data = (void *)fiber;
+     326              : 
+     327              :     /* Perform context switch */
+     328         1135 :     yafl_transfer_t t = jump_fcontext(fiber->context, transfer_data);
+     329              : 
+     330              :     /* Back in resumer - update fiber's context for next resume */
+     331         1135 :     fiber->context = t.prev_context;
+     332         1135 :     tls_current_fiber = NULL;
+     333              : 
+     334         1135 :     return t.data;
+     335              : }
+     336              : 
+     337         1023 : extern void *yafl_fiber_suspend(void *result) {
+     338         1023 :     yafl_fiber_t *current = tls_current_fiber;
+     339              : 
+     340              :     /* Must be in a fiber */
+     341         1023 :     if (current == NULL) {
+     342              :         return NULL;
+     343              :     }
+     344              : 
+     345              :     /* Update status */
+     346         1023 :     current->status = YAFL_FIBER_STATUS_SUSPENDED;
+     347              : 
+     348              :     /* Switch back to resumer */
+     349         1023 :     yafl_transfer_t t = jump_fcontext(current->resumer_context, result);
+     350              : 
+     351              :     /* When resumed - restore state */
+     352         1023 :     current->status = YAFL_FIBER_STATUS_RUNNING;
+     353         1023 :     current->resumer_context = t.prev_context;
+     354         1023 :     tls_current_fiber = current;
+     355              : 
+     356              :     /* Return argument passed to resume */
+     357         1023 :     return current->pending_arg;
+     358              : }
+     359              : 
+     360              : /* ========================================================================
+     361              :  * Fiber Status and Monitoring
+     362              :  * ======================================================================== */
+     363              : 
+     364         1426 : extern yafl_fiber_status_t yafl_fiber_status(yafl_fiber_t *fiber) {
+     365         1426 :     if (fiber == NULL || fiber->magic != FCONTEXT_FIBER_MAGIC) {
+     366              :         return YAFL_FIBER_STATUS_ERR;
+     367              :     }
+     368         1425 :     return fiber->status;
+     369              : }
+     370              : 
+     371            4 : extern size_t yafl_fiber_stack_high_watermark(yafl_fiber_t *fiber) {
+     372            4 :     if (fiber == NULL || fiber->magic != FCONTEXT_FIBER_MAGIC || !fiber->watermark_filled) {
+     373              :         return 0;
+     374              :     }
+     375              : 
+     376              :     /* Scan from stack base for watermark bytes */
+     377            2 :     unsigned char *stack_base = (unsigned char *)fiber->stack_top - fiber->stack_size;
+     378            2 :     size_t unused = 0;
+     379              : 
+     380        36434 :     while (unused < fiber->stack_size && stack_base[unused] == FCONTEXT_STACK_WATERMARK) {
+     381        36432 :         unused++;
+     382              :     }
+     383              : 
+     384            2 :     return fiber->stack_size - unused;
+     385              : }
+     386              : 
+     387              : /* ========================================================================
+     388              :  * Cleanup
+     389              :  * ======================================================================== */
+     390              : 
+     391          118 : extern void yafl_fiber_destroy(yafl_fiber_t *fiber) {
+     392          118 :     if (fiber == NULL || fiber->magic != FCONTEXT_FIBER_MAGIC) {
+     393              :         return;
+     394              :     }
+     395              : 
+     396              :     /* Cannot destroy running fiber */
+     397          116 :     if (fiber->status == YAFL_FIBER_STATUS_RUNNING) {
+     398              :         return;
+     399              :     }
+     400              : 
+     401              :     /* Free stack based on allocation type */
+     402          116 :     if (fiber->alloc_type == FCONTEXT_ALLOC_MALLOC) {
+     403           12 :         free(fiber->stack_region);
+     404          104 :     } else if (fiber->alloc_type == FCONTEXT_ALLOC_VMEM) {
+     405              : #ifdef _WIN32
+     406              :         VirtualFree(fiber->stack_region, 0, MEM_RELEASE);
+     407              : #else
+     408          104 :         munmap(fiber->stack_region, fiber->stack_total_size);
+     409              : #endif
+     410              :     }
+     411              : 
+     412              :     /* Invalidate and free */
+     413          116 :     fiber->magic = 0;
+     414          116 :     free(fiber);
+     415              : }
+     416              : 
+     417              : /* ========================================================================
+     418              :  * Utilities
+     419              :  * ======================================================================== */
+     420              : 
+     421            0 : extern size_t yafl_get_page_size(void) {
+     422            0 :     return get_page_size();
+     423              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/index-sort-f.html b/docs/coverage/tests/index-sort-f.html new file mode 100644 index 0000000..8f12c67 --- /dev/null +++ b/docs/coverage/tests/index-sort-f.html @@ -0,0 +1,141 @@ + + + + + + + LCOV - yafl Code Coverage - tests + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - testsCoverageTotalHit
Test:yafl Code CoverageLines:87.1 %402350
Test Date:2026-01-31 14:38:53Functions:90.0 %3027
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
test_yafl_guard.c +
32.5%32.5%
+
32.5 %772525.0 %41
test_yafl_many.c +
100.0%
+
100.0 %6565100.0 %22
test_yafl_suspend_resume.c +
100.0%
+
100.0 %107107100.0 %1111
test_yafl_basic.c +
100.0%
+
100.0 %153153100.0 %1313
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/index-sort-l.html b/docs/coverage/tests/index-sort-l.html new file mode 100644 index 0000000..dd77992 --- /dev/null +++ b/docs/coverage/tests/index-sort-l.html @@ -0,0 +1,141 @@ + + + + + + + LCOV - yafl Code Coverage - tests + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - testsCoverageTotalHit
Test:yafl Code CoverageLines:87.1 %402350
Test Date:2026-01-31 14:38:53Functions:90.0 %3027
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
test_yafl_guard.c +
32.5%32.5%
+
32.5 %772525.0 %41
test_yafl_many.c +
100.0%
+
100.0 %6565100.0 %22
test_yafl_suspend_resume.c +
100.0%
+
100.0 %107107100.0 %1111
test_yafl_basic.c +
100.0%
+
100.0 %153153100.0 %1313
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/index.html b/docs/coverage/tests/index.html new file mode 100644 index 0000000..da0d238 --- /dev/null +++ b/docs/coverage/tests/index.html @@ -0,0 +1,141 @@ + + + + + + + LCOV - yafl Code Coverage - tests + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - testsCoverageTotalHit
Test:yafl Code CoverageLines:87.1 %402350
Test Date:2026-01-31 14:38:53Functions:90.0 %3027
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Filename Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
test_yafl_basic.c +
100.0%
+
100.0 %153153100.0 %1313
test_yafl_guard.c +
32.5%32.5%
+
32.5 %772525.0 %41
test_yafl_many.c +
100.0%
+
100.0 %6565100.0 %22
test_yafl_suspend_resume.c +
100.0%
+
100.0 %107107100.0 %1111
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_basic.c.func-c.html b/docs/coverage/tests/test_yafl_basic.c.func-c.html new file mode 100644 index 0000000..fd6e964 --- /dev/null +++ b/docs/coverage/tests/test_yafl_basic.c.func-c.html @@ -0,0 +1,166 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_basic.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_basic.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %153153
Test Date:2026-01-31 14:38:53Functions:100.0 %1313
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
cycling_fiber_func1
main1
test_default_stack_size1
test_flag_combinations1
test_null_entry_function1
test_null_fiber_pointer1
test_simple_execution1
test_status_query1
test_suspend_resume_cycles1
test_watermark1
test_watermark_without_flag1
watermarked_fiber_func2
simple_fiber_func4
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_basic.c.func.html b/docs/coverage/tests/test_yafl_basic.c.func.html new file mode 100644 index 0000000..345fb8d --- /dev/null +++ b/docs/coverage/tests/test_yafl_basic.c.func.html @@ -0,0 +1,166 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_basic.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_basic.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %153153
Test Date:2026-01-31 14:38:53Functions:100.0 %1313
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
cycling_fiber_func1
main1
simple_fiber_func4
test_default_stack_size1
test_flag_combinations1
test_null_entry_function1
test_null_fiber_pointer1
test_simple_execution1
test_status_query1
test_suspend_resume_cycles1
test_watermark1
test_watermark_without_flag1
watermarked_fiber_func2
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_basic.c.gcov.html b/docs/coverage/tests/test_yafl_basic.c.gcov.html new file mode 100644 index 0000000..43336b1 --- /dev/null +++ b/docs/coverage/tests/test_yafl_basic.c.gcov.html @@ -0,0 +1,403 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_basic.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_basic.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %153153
Test Date:2026-01-31 14:38:53Functions:100.0 %1313
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : /*
+       2              :  * test_yafl_basic.c - Basic API tests for simplified fiber API
+       3              :  *
+       4              :  * Tests all combinations of creation flags and basic lifecycle operations.
+       5              :  */
+       6              : 
+       7              : #include <assert.h>
+       8              : #include <stdbool.h>
+       9              : #include <stdint.h>
+      10              : #include <stdio.h>
+      11              : #include <stdlib.h>
+      12              : #include <string.h>
+      13              : 
+      14              : #include "../include/yafl.h"
+      15              : 
+      16              : /* ========================================================================
+      17              :  * Test: Simple Fiber Execution
+      18              :  * ======================================================================== */
+      19              : 
+      20            4 : static void *simple_fiber_func(void *arg) {
+      21            4 :     return arg;
+      22              : }
+      23              : 
+      24            1 : static void test_simple_execution(void) {
+      25            1 :     printf("test_simple_execution: ");
+      26            1 :     fflush(stdout);
+      27              : 
+      28              :     /* Create fiber with malloc allocation */
+      29            1 :     yafl_fiber_t *fiber = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      30              :                                             YAFL_STACK_FLAGS_MALLOC);
+      31            1 :     assert(fiber != NULL);
+      32            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+      33              : 
+      34              :     /* Resume fiber */
+      35            1 :     void *result = yafl_fiber_resume(fiber, (void *)0x1234);
+      36            1 :     assert(result == (void *)0x1234);
+      37            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+      38              : 
+      39              :     /* Resuming completed fiber returns cached result */
+      40            1 :     void *result2 = yafl_fiber_resume(fiber, (void *)0x5678);
+      41            1 :     assert(result2 == (void *)0x1234);
+      42              : 
+      43              :     /* Cleanup */
+      44            1 :     yafl_fiber_destroy(fiber);
+      45            1 :     yafl_fiber_destroy(NULL);  /* Safe to call on NULL */
+      46              : 
+      47            1 :     printf("PASS\n");
+      48            1 : }
+      49              : 
+      50              : /* ========================================================================
+      51              :  * Test: Flag Combinations
+      52              :  * ======================================================================== */
+      53              : 
+      54            1 : static void test_flag_combinations(void) {
+      55            1 :     printf("test_flag_combinations: ");
+      56            1 :     fflush(stdout);
+      57              : 
+      58              :     /* Valid: MALLOC alone */
+      59            1 :     yafl_fiber_t *f1 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      60              :                                          YAFL_STACK_FLAGS_MALLOC);
+      61            1 :     assert(f1 != NULL);
+      62            1 :     yafl_fiber_destroy(f1);
+      63              : 
+      64              :     /* Valid: VMEM alone */
+      65            1 :     yafl_fiber_t *f2 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      66              :                                          YAFL_STACK_FLAGS_VMEM);
+      67            1 :     assert(f2 != NULL);
+      68            1 :     yafl_fiber_destroy(f2);
+      69              : 
+      70              :     /* Valid: MALLOC with WATERMARK */
+      71            1 :     yafl_fiber_t *f3 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      72              :                                          YAFL_STACK_FLAGS_MALLOC | YAFL_STACK_FLAGS_WATERMARK);
+      73            1 :     assert(f3 != NULL);
+      74            1 :     yafl_fiber_destroy(f3);
+      75              : 
+      76              :     /* Valid: VMEM with WATERMARK */
+      77            1 :     yafl_fiber_t *f4 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      78              :                                          YAFL_STACK_FLAGS_VMEM | YAFL_STACK_FLAGS_WATERMARK);
+      79            1 :     assert(f4 != NULL);
+      80            1 :     yafl_fiber_destroy(f4);
+      81              : 
+      82              :     /* Invalid: NONE */
+      83            1 :     yafl_fiber_t *f5 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      84              :                                          YAFL_STACK_FLAGS_NONE);
+      85            1 :     assert(f5 == NULL);
+      86              : 
+      87              :     /* Invalid: MALLOC | VMEM both set */
+      88            1 :     yafl_fiber_t *f6 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      89              :                                          YAFL_STACK_FLAGS_MALLOC | YAFL_STACK_FLAGS_VMEM);
+      90            1 :     assert(f6 == NULL);
+      91              : 
+      92              :     /* Invalid: Neither allocation type */
+      93            1 :     yafl_fiber_t *f7 = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+      94              :                                          YAFL_STACK_FLAGS_WATERMARK);
+      95            1 :     assert(f7 == NULL);
+      96              : 
+      97            1 :     printf("PASS\n");
+      98            1 : }
+      99              : 
+     100              : /* ========================================================================
+     101              :  * Test: Suspend/Resume Cycles
+     102              :  * ======================================================================== */
+     103              : 
+     104            1 : static void *cycling_fiber_func(void *arg) {
+     105            1 :     void *result = arg;
+     106              : 
+     107            6 :     for (int i = 0; i < 5; i++) {
+     108            5 :         result = yafl_fiber_suspend(result);
+     109              :     }
+     110              : 
+     111            1 :     return result;
+     112              : }
+     113              : 
+     114            1 : static void test_suspend_resume_cycles(void) {
+     115            1 :     printf("test_suspend_resume_cycles: ");
+     116            1 :     fflush(stdout);
+     117              : 
+     118            1 :     yafl_fiber_t *fiber = yafl_fiber_create(cycling_fiber_func, 16 * 1024,
+     119              :                                             YAFL_STACK_FLAGS_MALLOC);
+     120            1 :     assert(fiber != NULL);
+     121              : 
+     122              :     /* Cycle 1 */
+     123            1 :     void *result = yafl_fiber_resume(fiber, (void *)0x1);
+     124            1 :     assert(result == (void *)0x1);
+     125            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+     126              : 
+     127              :     /* Cycle 2 */
+     128            1 :     result = yafl_fiber_resume(fiber, (void *)0x2);
+     129            1 :     assert(result == (void *)0x2);
+     130            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+     131              : 
+     132              :     /* Cycle 3 */
+     133            1 :     result = yafl_fiber_resume(fiber, (void *)0x3);
+     134            1 :     assert(result == (void *)0x3);
+     135              : 
+     136              :     /* Cycle 4 */
+     137            1 :     result = yafl_fiber_resume(fiber, (void *)0x4);
+     138            1 :     assert(result == (void *)0x4);
+     139              : 
+     140              :     /* Cycle 5 */
+     141            1 :     result = yafl_fiber_resume(fiber, (void *)0x5);
+     142            1 :     assert(result == (void *)0x5);
+     143              : 
+     144              :     /* Final cycle - fiber completes */
+     145            1 :     result = yafl_fiber_resume(fiber, (void *)0x6);
+     146            1 :     assert(result == (void *)0x6);
+     147            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+     148              : 
+     149            1 :     yafl_fiber_destroy(fiber);
+     150              : 
+     151            1 :     printf("PASS\n");
+     152            1 : }
+     153              : 
+     154              : /* ========================================================================
+     155              :  * Test: Status Query
+     156              :  * ======================================================================== */
+     157              : 
+     158            1 : static void test_status_query(void) {
+     159            1 :     printf("test_status_query: ");
+     160            1 :     fflush(stdout);
+     161              : 
+     162            1 :     yafl_fiber_t *fiber = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+     163              :                                             YAFL_STACK_FLAGS_MALLOC);
+     164              : 
+     165              :     /* Check initial status */
+     166            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+     167              : 
+     168              :     /* Check status of NULL */
+     169            1 :     assert(yafl_fiber_status(NULL) == YAFL_FIBER_STATUS_ERR);
+     170              : 
+     171              :     /* Resume and check completion */
+     172            1 :     yafl_fiber_resume(fiber, (void *)0x99);
+     173            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+     174              : 
+     175            1 :     yafl_fiber_destroy(fiber);
+     176              : 
+     177            1 :     printf("PASS\n");
+     178            1 : }
+     179              : 
+     180              : /* ========================================================================
+     181              :  * Test: Watermark Measurement
+     182              :  * ======================================================================== */
+     183              : 
+     184            2 : static void *watermarked_fiber_func(void *arg) {
+     185              :     /* Allocate some stack space to trigger watermark usage */
+     186            2 :     volatile char stack_buffer[1024];
+     187              :     /* Use memset to ensure compiler can't optimize the buffer away */
+     188            2 :     memset((char *)stack_buffer, 0xAA, sizeof(stack_buffer));
+     189            2 :     return arg;
+     190              : }
+     191              : 
+     192            1 : static void test_watermark(void) {
+     193            1 :     printf("test_watermark_malloc: ");
+     194            1 :     fflush(stdout);
+     195              : 
+     196              :     /* Test with malloc + watermark */
+     197            1 :     yafl_fiber_t *fiber = yafl_fiber_create(watermarked_fiber_func, 16 * 1024,
+     198              :                                             YAFL_STACK_FLAGS_MALLOC | YAFL_STACK_FLAGS_WATERMARK);
+     199            1 :     assert(fiber != NULL);
+     200              : 
+     201              :     /* Resume and check watermark */
+     202            1 :     yafl_fiber_resume(fiber, NULL);
+     203            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+     204              : 
+     205            1 :     size_t usage = yafl_fiber_stack_high_watermark(fiber);
+     206            1 :     assert(usage > 0);  /* Should have used some stack */
+     207              : 
+     208            1 :     yafl_fiber_destroy(fiber);
+     209              : 
+     210            1 :     printf("PASS\n");
+     211              : 
+     212            1 :     printf("test_watermark_vmem: ");
+     213            1 :     fflush(stdout);
+     214              : 
+     215              :     /* Test with vmem + watermark */
+     216            1 :     yafl_fiber_t *fiber2 = yafl_fiber_create(watermarked_fiber_func, 16 * 1024,
+     217              :                                              YAFL_STACK_FLAGS_VMEM | YAFL_STACK_FLAGS_WATERMARK);
+     218            1 :     assert(fiber2 != NULL);
+     219              : 
+     220            1 :     yafl_fiber_resume(fiber2, NULL);
+     221            1 :     assert(yafl_fiber_status(fiber2) == YAFL_FIBER_STATUS_COMPLETE);
+     222              : 
+     223            1 :     size_t usage2 = yafl_fiber_stack_high_watermark(fiber2);
+     224            1 :     assert(usage2 > 0);
+     225              : 
+     226            1 :     yafl_fiber_destroy(fiber2);
+     227              : 
+     228            1 :     printf("PASS\n");
+     229            1 : }
+     230              : 
+     231              : /* ========================================================================
+     232              :  * Test: Watermark Without Flag
+     233              :  * ======================================================================== */
+     234              : 
+     235            1 : static void test_watermark_without_flag(void) {
+     236            1 :     printf("test_watermark_without_flag: ");
+     237            1 :     fflush(stdout);
+     238              : 
+     239            1 :     yafl_fiber_t *fiber = yafl_fiber_create(simple_fiber_func, 16 * 1024,
+     240              :                                             YAFL_STACK_FLAGS_MALLOC);
+     241            1 :     assert(fiber != NULL);
+     242              : 
+     243              :     /* Without watermark flag, should return 0 */
+     244            1 :     assert(yafl_fiber_stack_high_watermark(fiber) == 0);
+     245              : 
+     246            1 :     yafl_fiber_resume(fiber, NULL);
+     247              : 
+     248              :     /* Still 0 because no watermark was applied */
+     249            1 :     assert(yafl_fiber_stack_high_watermark(fiber) == 0);
+     250              : 
+     251            1 :     yafl_fiber_destroy(fiber);
+     252              : 
+     253            1 :     printf("PASS\n");
+     254            1 : }
+     255              : 
+     256              : /* ========================================================================
+     257              :  * Test: NULL Fiber Pointer
+     258              :  * ======================================================================== */
+     259              : 
+     260            1 : static void test_null_fiber_pointer(void) {
+     261            1 :     printf("test_null_fiber_pointer: ");
+     262            1 :     fflush(stdout);
+     263              : 
+     264              :     /* Resume NULL fiber */
+     265            1 :     void *result = yafl_fiber_resume(NULL, (void *)0x1);
+     266            1 :     assert(result == NULL);
+     267              : 
+     268              :     /* Destroy NULL fiber (safe no-op) */
+     269            1 :     yafl_fiber_destroy(NULL);
+     270              : 
+     271            1 :     printf("PASS\n");
+     272            1 : }
+     273              : 
+     274              : /* ========================================================================
+     275              :  * Test: NULL Entry Function
+     276              :  * ======================================================================== */
+     277              : 
+     278            1 : static void test_null_entry_function(void) {
+     279            1 :     printf("test_null_entry_function: ");
+     280            1 :     fflush(stdout);
+     281              : 
+     282            1 :     yafl_fiber_t *fiber = yafl_fiber_create(NULL, 16 * 1024,
+     283              :                                             YAFL_STACK_FLAGS_MALLOC);
+     284            1 :     assert(fiber == NULL);
+     285              : 
+     286            1 :     printf("PASS\n");
+     287            1 : }
+     288              : 
+     289              : /* ========================================================================
+     290              :  * Test: Default Stack Size
+     291              :  * ======================================================================== */
+     292              : 
+     293            1 : static void test_default_stack_size(void) {
+     294            1 :     printf("test_default_stack_size: ");
+     295            1 :     fflush(stdout);
+     296              : 
+     297              :     /* Create with 0 stack size (uses default) */
+     298            1 :     yafl_fiber_t *fiber = yafl_fiber_create(simple_fiber_func, 0,
+     299              :                                             YAFL_STACK_FLAGS_MALLOC);
+     300            1 :     assert(fiber != NULL);
+     301              : 
+     302            1 :     yafl_fiber_resume(fiber, (void *)0x42);
+     303            1 :     yafl_fiber_destroy(fiber);
+     304              : 
+     305            1 :     printf("PASS\n");
+     306            1 : }
+     307              : 
+     308              : /* ========================================================================
+     309              :  * Main
+     310              :  * ======================================================================== */
+     311              : 
+     312            1 : int main(void) {
+     313            1 :     printf("Running YAFL basic tests...\n");
+     314              : 
+     315            1 :     test_simple_execution();
+     316            1 :     test_flag_combinations();
+     317            1 :     test_suspend_resume_cycles();
+     318            1 :     test_status_query();
+     319            1 :     test_watermark();
+     320            1 :     test_watermark_without_flag();
+     321            1 :     test_null_fiber_pointer();
+     322            1 :     test_null_entry_function();
+     323            1 :     test_default_stack_size();
+     324              : 
+     325            1 :     printf("\nAll tests passed!\n");
+     326            1 :     return 0;
+     327              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_guard.c.func-c.html b/docs/coverage/tests/test_yafl_guard.c.func-c.html new file mode 100644 index 0000000..e9857c3 --- /dev/null +++ b/docs/coverage/tests/test_yafl_guard.c.func-c.html @@ -0,0 +1,103 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_guard.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_guard.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:32.5 %7725
Test Date:2026-01-31 14:38:53Functions:25.0 %41
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
guard_test_fiber0
overflow_stack0
run_child_test0
main1
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_guard.c.func.html b/docs/coverage/tests/test_yafl_guard.c.func.html new file mode 100644 index 0000000..3477552 --- /dev/null +++ b/docs/coverage/tests/test_yafl_guard.c.func.html @@ -0,0 +1,103 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_guard.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_guard.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:32.5 %7725
Test Date:2026-01-31 14:38:53Functions:25.0 %41
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
guard_test_fiber0
main1
overflow_stack0
run_child_test0
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_guard.c.gcov.html b/docs/coverage/tests/test_yafl_guard.c.gcov.html new file mode 100644 index 0000000..3b1a11e --- /dev/null +++ b/docs/coverage/tests/test_yafl_guard.c.gcov.html @@ -0,0 +1,290 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_guard.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_guard.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:32.5 %7725
Test Date:2026-01-31 14:38:53Functions:25.0 %41
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : /*
+       2              :  * test_yafl_guard.c - Guard page overflow detection test
+       3              :  *
+       4              :  * Verifies that guard pages detect stack overflow.
+       5              :  * Uses child process (fork on POSIX, CreateProcess on Windows) to detect crash.
+       6              :  *
+       7              :  * Copyright Kyle Hayes (2026)
+       8              :  * Distributed under the Boost Software License, Version 1.0.
+       9              :  */
+      10              : 
+      11              : #include <assert.h>
+      12              : #include <stdbool.h>
+      13              : #include <stdio.h>
+      14              : #include <stdlib.h>
+      15              : #include <string.h>
+      16              : 
+      17              : #include "../include/yafl.h"
+      18              : 
+      19              : #ifdef _WIN32
+      20              :     #include <windows.h>
+      21              : #else
+      22              :     #include <sys/wait.h>
+      23              :     #include <unistd.h>
+      24              : #endif
+      25              : 
+      26              : /* Recursive function to overflow the stack */
+      27            0 : static void overflow_stack(int depth) {
+      28            0 :     volatile char buffer[128];
+      29              : 
+      30              :     /* Touch the buffer to prevent optimization */
+      31            0 :     memset((void *)buffer, 0xAA, sizeof(buffer));
+      32              : 
+      33            0 :     fprintf(stderr, "[overflow] depth=%d, buffer=%p\n", depth, (void *)buffer);
+      34            0 :     fflush(stderr);
+      35              : 
+      36              :     /* Recurse to build up stack usage to trigger guard page */
+      37            0 :     if (depth < 250) {
+      38            0 :         overflow_stack(depth + 1);
+      39              :     }
+      40            0 : }
+      41              : 
+      42            0 : static void *guard_test_fiber(void *data) {
+      43            0 :     (void)data;
+      44              : 
+      45            0 :     fprintf(stderr, "[fiber] starting guard page test\n");
+      46            0 :     fflush(stderr);
+      47              : 
+      48              :     /* This will hit the guard page and cause the process to crash */
+      49            0 :     overflow_stack(0);
+      50              : 
+      51            0 :     fprintf(stderr, "[fiber] ERROR: should not reach here\n");
+      52            0 :     fflush(stderr);
+      53            0 :     return (void *)0x0;
+      54              : }
+      55              : 
+      56              : /* Child process test - will crash when guard page is hit */
+      57            0 : static int run_child_test(void) {
+      58            0 :     fprintf(stderr, "[child] creating fiber with guard pages\n");
+      59            0 :     fflush(stderr);
+      60              : 
+      61            0 :     yafl_fiber_t *fiber = yafl_fiber_create(guard_test_fiber, 24 * 1024,
+      62              :                                             YAFL_STACK_FLAGS_VMEM);
+      63            0 :     if (fiber == NULL) {
+      64            0 :         fprintf(stderr, "[child] ERROR: fiber creation failed\n");
+      65            0 :         fflush(stderr);
+      66            0 :         return 1;
+      67              :     }
+      68              : 
+      69            0 :     fprintf(stderr, "[child] resuming fiber\n");
+      70            0 :     fflush(stderr);
+      71              : 
+      72              :     /* This will cause guard page fault and crash the process */
+      73            0 :     void *result = yafl_fiber_resume(fiber, NULL);
+      74              : 
+      75              :     /* Should never reach here if guard page is working */
+      76            0 :     fprintf(stderr, "[child] ERROR: fiber returned: %p (should have crashed)\n", result);
+      77            0 :     fflush(stderr);
+      78            0 :     yafl_fiber_destroy(fiber);
+      79            0 :     return 1;
+      80              : }
+      81              : 
+      82            1 : int main(int argc, char *argv[]) {
+      83            1 :     fprintf(stderr, "=== yafl Guard Page Test ===\n");
+      84            1 :     fflush(stderr);
+      85              : 
+      86              :     /* argc and argv only used on Windows */
+      87              : #ifndef _WIN32
+      88            1 :     (void)argc;
+      89            1 :     (void)argv;
+      90              : #endif
+      91              : 
+      92              : #ifdef _WIN32
+      93              :     /* Check if we're the child process */
+      94              :     if (argc > 1 && strcmp(argv[1], "__child__") == 0) {
+      95              :         return run_child_test();
+      96              :     }
+      97              : 
+      98              :     /* Parent: spawn child process */
+      99              :     fprintf(stderr, "[main] spawning child process\n");
+     100              :     fflush(stderr);
+     101              : 
+     102              :     STARTUPINFO si;
+     103              :     PROCESS_INFORMATION pi;
+     104              :     memset(&si, 0, sizeof(si));
+     105              :     si.cb = sizeof(si);
+     106              : 
+     107              :     /* Build command line to run ourselves as child */
+     108              :     char cmd_line[512];
+     109              :     snprintf(cmd_line, sizeof(cmd_line), "%s __child__", argv[0]);
+     110              : 
+     111              :     if (!CreateProcessA(NULL, cmd_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+     112              :         fprintf(stderr, "[main] ERROR: CreateProcess failed (error: %lu)\n", GetLastError());
+     113              :         fflush(stderr);
+     114              :         return 1;
+     115              :     }
+     116              : 
+     117              :     fprintf(stderr, "[main] waiting for child process (PID: %lu)\n", pi.dwProcessId);
+     118              :     fflush(stderr);
+     119              : 
+     120              :     /* Wait for child to complete */
+     121              :     WaitForSingleObject(pi.hProcess, INFINITE);
+     122              : 
+     123              :     DWORD exit_code;
+     124              :     if (!GetExitCodeProcess(pi.hProcess, &exit_code)) {
+     125              :         fprintf(stderr, "[main] ERROR: GetExitCodeProcess failed\n");
+     126              :         fflush(stderr);
+     127              :         CloseHandle(pi.hProcess);
+     128              :         CloseHandle(pi.hThread);
+     129              :         return 1;
+     130              :     }
+     131              : 
+     132              :     CloseHandle(pi.hProcess);
+     133              :     CloseHandle(pi.hThread);
+     134              : 
+     135              :     fprintf(stderr, "[main] child exited with code: 0x%lx\n", exit_code);
+     136              :     fflush(stderr);
+     137              : 
+     138              :     /* On Windows, if guard page is working, child will crash with non-zero exit code
+     139              :      * If child exited cleanly with code 0, it means the guard page didn't trigger */
+     140              :     if (exit_code == 0) {
+     141              :         fprintf(stderr, "[main] FAIL: child exited cleanly (guard page not triggered)\n");
+     142              :         fflush(stderr);
+     143              :         return 1;
+     144              :     }
+     145              : 
+     146              :     fprintf(stderr, "[main] guard page successfully detected stack overflow\n");
+     147              :     fflush(stderr);
+     148              : 
+     149              : #else
+     150              :     /* POSIX: use fork */
+     151            1 :     fprintf(stderr, "[main] spawning child process\n");
+     152            1 :     fflush(stderr);
+     153              : 
+     154            1 :     pid_t pid = fork();
+     155            1 :     if (pid == -1) {
+     156            0 :         fprintf(stderr, "[main] ERROR: fork failed\n");
+     157            0 :         fflush(stderr);
+     158            0 :         return 1;
+     159              :     }
+     160              : 
+     161            1 :     if (pid == 0) {
+     162              :         /* Child process - run test and exit */
+     163            0 :         exit(run_child_test());
+     164              :     }
+     165              : 
+     166              :     /* Parent process - wait for child */
+     167            1 :     fprintf(stderr, "[main] waiting for child process (PID: %d)\n", (int)pid);
+     168            1 :     fflush(stderr);
+     169              : 
+     170            1 :     int status;
+     171            1 :     pid_t result = waitpid(pid, &status, 0);
+     172            1 :     if (result == -1) {
+     173            0 :         fprintf(stderr, "[main] ERROR: waitpid failed\n");
+     174            0 :         fflush(stderr);
+     175            0 :         return 1;
+     176              :     }
+     177              : 
+     178              :     /* Check how the child terminated */
+     179            1 :     if (WIFSIGNALED(status)) {
+     180            1 :         int sig = WTERMSIG(status);
+     181            1 :         fprintf(stderr, "[main] child killed by signal %d\n", sig);
+     182            1 :         fflush(stderr);
+     183              : 
+     184              :         /* Expect SIGSEGV (11) or SIGBUS (7) for guard page fault */
+     185            1 :         if (sig == SIGSEGV || sig == SIGBUS) {
+     186            1 :             fprintf(stderr, "[main] guard page successfully detected stack overflow\n");
+     187            1 :             fflush(stderr);
+     188              :         } else {
+     189            0 :             fprintf(stderr, "[main] FAIL: child killed by unexpected signal %d\n", sig);
+     190            0 :             fflush(stderr);
+     191            0 :             return 1;
+     192              :         }
+     193            0 :     } else if (WIFEXITED(status)) {
+     194            0 :         int exit_code = WEXITSTATUS(status);
+     195            0 :         fprintf(stderr, "[main] child exited with code %d\n", exit_code);
+     196            0 :         fflush(stderr);
+     197              : 
+     198            0 :         if (exit_code == 0) {
+     199            0 :             fprintf(stderr, "[main] FAIL: child exited cleanly (guard page not triggered)\n");
+     200            0 :             fflush(stderr);
+     201            0 :             return 1;
+     202              :         }
+     203              :     } else {
+     204            0 :         fprintf(stderr, "[main] FAIL: unexpected child termination\n");
+     205            0 :         fflush(stderr);
+     206            0 :         return 1;
+     207              :     }
+     208              : 
+     209              : #endif
+     210              : 
+     211            1 :     fprintf(stderr, "\nPASS: Guard page detected stack overflow\n");
+     212            1 :     fflush(stderr);
+     213            1 :     return 0;
+     214              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_many.c.func-c.html b/docs/coverage/tests/test_yafl_many.c.func-c.html new file mode 100644 index 0000000..51f5c73 --- /dev/null +++ b/docs/coverage/tests/test_yafl_many.c.func-c.html @@ -0,0 +1,89 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_many.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_many.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %6565
Test Date:2026-01-31 14:38:53Functions:100.0 %22
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
main1
fiber_entry100
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_many.c.func.html b/docs/coverage/tests/test_yafl_many.c.func.html new file mode 100644 index 0000000..e5025a9 --- /dev/null +++ b/docs/coverage/tests/test_yafl_many.c.func.html @@ -0,0 +1,89 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_many.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_many.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %6565
Test Date:2026-01-31 14:38:53Functions:100.0 %22
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
fiber_entry100
main1
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_many.c.gcov.html b/docs/coverage/tests/test_yafl_many.c.gcov.html new file mode 100644 index 0000000..3bf5007 --- /dev/null +++ b/docs/coverage/tests/test_yafl_many.c.gcov.html @@ -0,0 +1,206 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_many.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_many.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %6565
Test Date:2026-01-31 14:38:53Functions:100.0 %22
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : /*
+       2              :  * test_yafl_many.c - Scalability test with many fibers
+       3              :  *
+       4              :  * Verifies that 100 fibers can coexist and complete using round-robin scheduling.
+       5              :  * Tests status query functions and confirms each fiber gets exactly 10 iterations.
+       6              :  *
+       7              :  * Copyright Kyle Hayes (2026)
+       8              :  * Distributed under the Boost Software License, Version 1.0.
+       9              :  * (See accompanying file LICENSE or copy at
+      10              :  *  http://www.boost.org/LICENSE_1_0.txt)
+      11              :  */
+      12              : 
+      13              : #include <assert.h>
+      14              : #include <stdint.h>
+      15              : #include <stdio.h>
+      16              : #include <stdlib.h>
+      17              : 
+      18              : #include "../include/yafl.h"
+      19              : 
+      20              : #define NUM_FIBERS 100
+      21              : #define ITERATIONS 10
+      22              : 
+      23              : static int counters[NUM_FIBERS];
+      24              : static yafl_fiber_t *fibers[NUM_FIBERS];
+      25              : 
+      26          100 : static void *fiber_entry(void *data) {
+      27          100 :     int id = (int)(uintptr_t)data;
+      28              : 
+      29          100 :     fprintf(stderr, "[fiber %d] entered\n", id);
+      30          100 :     fflush(stderr);
+      31              : 
+      32         1100 :     for (int i = 0; i < ITERATIONS; i++) {
+      33         1000 :         fprintf(stderr, "[fiber %d] iteration %d/%d\n", id, i + 1, ITERATIONS);
+      34         1000 :         fflush(stderr);
+      35              : 
+      36         1000 :         counters[id]++;
+      37              : 
+      38         1000 :         fprintf(stderr, "[fiber %d] suspending\n", id);
+      39         1000 :         fflush(stderr);
+      40         1000 :         yafl_fiber_suspend(NULL);
+      41              : 
+      42         1000 :         fprintf(stderr, "[fiber %d] resumed\n", id);
+      43         1000 :         fflush(stderr);
+      44              :     }
+      45              : 
+      46          100 :     fprintf(stderr, "[fiber %d] finishing with result %d\n", id, id + 1000);
+      47          100 :     fflush(stderr);
+      48          100 :     return (void *)(uintptr_t)(id + 1000);
+      49              : }
+      50              : 
+      51            1 : int main(void) {
+      52            1 :     fprintf(stderr, "=== yafl Many Fibers Test ===\n");
+      53            1 :     fprintf(stderr, "[main] testing with %d fibers, %d iterations each\n", NUM_FIBERS, ITERATIONS);
+      54            1 :     fflush(stderr);
+      55              : 
+      56              :     /* Create 100 fibers */
+      57            1 :     fprintf(stderr, "[main] creating %d fibers\n", NUM_FIBERS);
+      58            1 :     fflush(stderr);
+      59          101 :     for (int i = 0; i < NUM_FIBERS; i++) {
+      60          100 :         counters[i] = 0;
+      61          100 :         fibers[i] = yafl_fiber_create(fiber_entry, 24 * 1024, YAFL_STACK_FLAGS_VMEM);
+      62          100 :         assert(fibers[i] != NULL);
+      63              : 
+      64              :         /* Test status on created fiber */
+      65          100 :         yafl_fiber_status_t status = yafl_fiber_status(fibers[i]);
+      66          100 :         assert(status == YAFL_FIBER_STATUS_SUSPENDED);
+      67              : 
+      68          100 :         if (i == 0 || i == NUM_FIBERS - 1) {
+      69            2 :             fprintf(stderr, "[main] fiber %d: created, status=%d\n", i, status);
+      70            2 :             fflush(stderr);
+      71              :         }
+      72              :     }
+      73            1 :     fprintf(stderr, "[main] all %d fibers created successfully\n", NUM_FIBERS);
+      74            1 :     fflush(stderr);
+      75              : 
+      76              :     /* Round-robin scheduling until all done */
+      77            1 :     fprintf(stderr, "[main] starting round-robin scheduling\n");
+      78            1 :     fflush(stderr);
+      79              : 
+      80            1 :     int round = 0;
+      81            1 :     bool all_done = false;
+      82           13 :     while (!all_done) {
+      83              :         all_done = true;
+      84              :         int active_count = 0;
+      85              : 
+      86         1212 :         for (int i = 0; i < NUM_FIBERS; i++) {
+      87         1200 :             yafl_fiber_status_t status = yafl_fiber_status(fibers[i]);
+      88         1200 :             if (status != YAFL_FIBER_STATUS_COMPLETE) {
+      89         1100 :                 yafl_fiber_resume(fibers[i], (void *)(uintptr_t)i);
+      90         1100 :                 all_done = false;
+      91         1100 :                 active_count++;
+      92              :             }
+      93              :         }
+      94              : 
+      95           12 :         round++;
+      96           12 :         if (round <= 3 || all_done) {
+      97            4 :             fprintf(stderr, "[main] round %d: %d fibers still active\n", round, active_count);
+      98            4 :             fflush(stderr);
+      99              :         }
+     100              :     }
+     101              : 
+     102            1 :     fprintf(stderr, "[main] all fibers finished after %d rounds\n", round);
+     103            1 :     fflush(stderr);
+     104              : 
+     105              :     /* Verify all fibers ran exactly ITERATIONS times */
+     106            1 :     fprintf(stderr, "[main] verifying all fibers completed %d iterations\n", ITERATIONS);
+     107            1 :     fflush(stderr);
+     108              : 
+     109          101 :     for (int i = 0; i < NUM_FIBERS; i++) {
+     110          100 :         assert(counters[i] == ITERATIONS);
+     111              : 
+     112          100 :         yafl_fiber_status_t status = yafl_fiber_status(fibers[i]);
+     113          100 :         assert(status == YAFL_FIBER_STATUS_COMPLETE);
+     114              : 
+     115          100 :         if (i == 0 || i == NUM_FIBERS - 1) {
+     116            2 :             fprintf(stderr, "[main] fiber %d: counter=%d, status=%d\n", i, counters[i], status);
+     117            2 :             fflush(stderr);
+     118              :         }
+     119              : 
+     120          100 :         yafl_fiber_destroy(fibers[i]);
+     121              :     }
+     122              : 
+     123            1 :     fprintf(stderr, "[main] all fibers verified and destroyed\n");
+     124            1 :     fflush(stderr);
+     125              : 
+     126            1 :     fprintf(stderr, "\nPASS: %d fibers x %d iterations = %d total context switches\n", NUM_FIBERS,
+     127              :             ITERATIONS, NUM_FIBERS * ITERATIONS);
+     128            1 :     fflush(stderr);
+     129            1 :     return 0;
+     130              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html b/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html new file mode 100644 index 0000000..32c8e43 --- /dev/null +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html @@ -0,0 +1,152 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_suspend_resume.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_suspend_resume.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %107107
Test Date:2026-01-31 14:38:53Functions:100.0 %1111
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
conditional_suspend_fiber_func1
echo_fiber_func1
main1
multi_suspend_fiber_func1
null_data_fiber_func1
test_bidirectional_data_passing1
test_conditional_suspension1
test_multiple_suspend_points1
test_null_data_passing1
test_vmem_suspend_resume1
vmem_test_func1
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.func.html b/docs/coverage/tests/test_yafl_suspend_resume.c.func.html new file mode 100644 index 0000000..06760f2 --- /dev/null +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.func.html @@ -0,0 +1,152 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_suspend_resume.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_suspend_resume.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %107107
Test Date:2026-01-31 14:38:53Functions:100.0 %1111
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
conditional_suspend_fiber_func1
echo_fiber_func1
main1
multi_suspend_fiber_func1
null_data_fiber_func1
test_bidirectional_data_passing1
test_conditional_suspension1
test_multiple_suspend_points1
test_null_data_passing1
test_vmem_suspend_resume1
vmem_test_func1
+
+
+ + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html b/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html new file mode 100644 index 0000000..e0aac70 --- /dev/null +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html @@ -0,0 +1,290 @@ + + + + + + + LCOV - yafl Code Coverage - tests/test_yafl_suspend_resume.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - tests - test_yafl_suspend_resume.c (source / functions)CoverageTotalHit
Test:yafl Code CoverageLines:100.0 %107107
Test Date:2026-01-31 14:38:53Functions:100.0 %1111
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : /*
+       2              :  * test_yafl_suspend_resume.c - Suspend/resume cycle tests
+       3              :  *
+       4              :  * Tests multiple suspend/resume patterns and data passing.
+       5              :  */
+       6              : 
+       7              : #include <assert.h>
+       8              : #include <stdbool.h>
+       9              : #include <stdint.h>
+      10              : #include <stdio.h>
+      11              : #include <stdlib.h>
+      12              : 
+      13              : #include "../include/yafl.h"
+      14              : 
+      15              : /* ========================================================================
+      16              :  * Test: Bidirectional Data Passing
+      17              :  * ======================================================================== */
+      18              : 
+      19            1 : static void *echo_fiber_func(void *arg) {
+      20              :     /* Fiber receives initial arg, suspends with it */
+      21            1 :     arg = yafl_fiber_suspend(arg);
+      22              : 
+      23              :     /* Receives new arg, suspends with it */
+      24            1 :     arg = yafl_fiber_suspend(arg);
+      25              : 
+      26              :     /* Receives final arg, returns it */
+      27            1 :     return arg;
+      28              : }
+      29              : 
+      30            1 : static void test_bidirectional_data_passing(void) {
+      31            1 :     printf("test_bidirectional_data_passing: ");
+      32            1 :     fflush(stdout);
+      33              : 
+      34            1 :     yafl_fiber_t *fiber = yafl_fiber_create(echo_fiber_func, 16 * 1024,
+      35              :                                             YAFL_STACK_FLAGS_MALLOC);
+      36            1 :     assert(fiber != NULL);
+      37              : 
+      38              :     /* First resume: send 0x1111, receive 0x1111 back */
+      39            1 :     void *result = yafl_fiber_resume(fiber, (void *)0x1111);
+      40            1 :     assert(result == (void *)0x1111);
+      41            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+      42              : 
+      43              :     /* Second resume: send 0x2222, receive 0x2222 back */
+      44            1 :     result = yafl_fiber_resume(fiber, (void *)0x2222);
+      45            1 :     assert(result == (void *)0x2222);
+      46            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+      47              : 
+      48              :     /* Third resume: send 0x3333, receive 0x3333 back (fiber completes) */
+      49            1 :     result = yafl_fiber_resume(fiber, (void *)0x3333);
+      50            1 :     assert(result == (void *)0x3333);
+      51            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+      52              : 
+      53            1 :     yafl_fiber_destroy(fiber);
+      54              : 
+      55            1 :     printf("PASS\n");
+      56            1 : }
+      57              : 
+      58              : /* ========================================================================
+      59              :  * Test: Multiple Suspend Points
+      60              :  * ======================================================================== */
+      61              : 
+      62            1 : static void *multi_suspend_fiber_func(void *arg) {
+      63           11 :     for (int i = 0; i < 10; i++) {
+      64           10 :         arg = yafl_fiber_suspend((void *)(uintptr_t)(0x1000 + i));
+      65              :     }
+      66            1 :     return arg;
+      67              : }
+      68              : 
+      69            1 : static void test_multiple_suspend_points(void) {
+      70            1 :     printf("test_multiple_suspend_points: ");
+      71            1 :     fflush(stdout);
+      72              : 
+      73            1 :     yafl_fiber_t *fiber = yafl_fiber_create(multi_suspend_fiber_func, 16 * 1024,
+      74              :                                             YAFL_STACK_FLAGS_MALLOC);
+      75            1 :     assert(fiber != NULL);
+      76              : 
+      77           11 :     for (int i = 0; i < 10; i++) {
+      78           10 :         void *result = yafl_fiber_resume(fiber, (void *)(uintptr_t)(0x2000 + i));
+      79           10 :         assert(result == (void *)(uintptr_t)(0x1000 + i));
+      80           10 :         assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_SUSPENDED);
+      81              :     }
+      82              : 
+      83              :     /* Final resume to complete - should return the last arg passed to resume */
+      84            1 :     void *final = yafl_fiber_resume(fiber, (void *)0x3000);
+      85            1 :     assert(final == (void *)0x3000);
+      86            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+      87              : 
+      88            1 :     yafl_fiber_destroy(fiber);
+      89              : 
+      90            1 :     printf("PASS\n");
+      91            1 : }
+      92              : 
+      93              : /* ========================================================================
+      94              :  * Test: Conditional Suspension
+      95              :  * ======================================================================== */
+      96              : 
+      97            1 : static void *conditional_suspend_fiber_func(void *arg) {
+      98            6 :     for (int i = 0; i < 5; i++) {
+      99            5 :         if (i % 2 == 0) {
+     100            3 :             arg = yafl_fiber_suspend((void *)(uintptr_t)(0x100 + i));
+     101              :         }
+     102              :     }
+     103            1 :     return arg;
+     104              : }
+     105              : 
+     106            1 : static void test_conditional_suspension(void) {
+     107            1 :     printf("test_conditional_suspension: ");
+     108            1 :     fflush(stdout);
+     109              : 
+     110            1 :     yafl_fiber_t *fiber = yafl_fiber_create(conditional_suspend_fiber_func, 16 * 1024,
+     111              :                                             YAFL_STACK_FLAGS_MALLOC);
+     112            1 :     assert(fiber != NULL);
+     113              : 
+     114              :     /* Suspend at i=0 */
+     115            1 :     void *result = yafl_fiber_resume(fiber, (void *)0x1);
+     116            1 :     assert(result == (void *)0x100);
+     117              : 
+     118              :     /* Suspend at i=2 */
+     119            1 :     result = yafl_fiber_resume(fiber, (void *)0x2);
+     120            1 :     assert(result == (void *)0x102);
+     121              : 
+     122              :     /* Suspend at i=4 */
+     123            1 :     result = yafl_fiber_resume(fiber, (void *)0x3);
+     124            1 :     assert(result == (void *)0x104);
+     125              : 
+     126              :     /* Complete */
+     127            1 :     result = yafl_fiber_resume(fiber, (void *)0x4);
+     128            1 :     assert(result == (void *)0x4);
+     129            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+     130              : 
+     131            1 :     yafl_fiber_destroy(fiber);
+     132              : 
+     133            1 :     printf("PASS\n");
+     134            1 : }
+     135              : 
+     136              : /* ========================================================================
+     137              :  * Test: NULL Data Passing
+     138              :  * ======================================================================== */
+     139              : 
+     140            1 : static void *null_data_fiber_func(void *arg) {
+     141            1 :     assert(arg == NULL);  /* First resume passes NULL */
+     142            1 :     arg = yafl_fiber_suspend(NULL);
+     143            1 :     assert(arg == NULL);  /* Second resume passes NULL */
+     144            1 :     return arg;
+     145              : }
+     146              : 
+     147            1 : static void test_null_data_passing(void) {
+     148            1 :     printf("test_null_data_passing: ");
+     149            1 :     fflush(stdout);
+     150              : 
+     151            1 :     yafl_fiber_t *fiber = yafl_fiber_create(null_data_fiber_func, 16 * 1024,
+     152              :                                             YAFL_STACK_FLAGS_MALLOC);
+     153            1 :     assert(fiber != NULL);
+     154              : 
+     155            1 :     void *result = yafl_fiber_resume(fiber, NULL);
+     156            1 :     assert(result == NULL);
+     157              : 
+     158            1 :     result = yafl_fiber_resume(fiber, NULL);
+     159            1 :     assert(result == NULL);
+     160              : 
+     161            1 :     yafl_fiber_destroy(fiber);
+     162              : 
+     163            1 :     printf("PASS\n");
+     164            1 : }
+     165              : 
+     166              : /* ========================================================================
+     167              :  * Test: VMEM Allocation with Suspend/Resume
+     168              :  * ======================================================================== */
+     169              : 
+     170            1 : static void *vmem_test_func(void *arg) {
+     171            1 :     arg = yafl_fiber_suspend((void *)0xAAAA);
+     172            1 :     arg = yafl_fiber_suspend((void *)0xBBBB);
+     173            1 :     return arg;
+     174              : }
+     175              : 
+     176            1 : static void test_vmem_suspend_resume(void) {
+     177            1 :     printf("test_vmem_suspend_resume: ");
+     178            1 :     fflush(stdout);
+     179              : 
+     180            1 :     yafl_fiber_t *fiber = yafl_fiber_create(vmem_test_func, 16 * 1024,
+     181              :                                             YAFL_STACK_FLAGS_VMEM);
+     182            1 :     assert(fiber != NULL);
+     183              : 
+     184            1 :     void *result = yafl_fiber_resume(fiber, (void *)0x1111);
+     185            1 :     assert(result == (void *)0xAAAA);
+     186              : 
+     187            1 :     result = yafl_fiber_resume(fiber, (void *)0x2222);
+     188            1 :     assert(result == (void *)0xBBBB);
+     189              : 
+     190            1 :     result = yafl_fiber_resume(fiber, (void *)0x3333);
+     191            1 :     assert(result == (void *)0x3333);
+     192            1 :     assert(yafl_fiber_status(fiber) == YAFL_FIBER_STATUS_COMPLETE);
+     193              : 
+     194            1 :     yafl_fiber_destroy(fiber);
+     195              : 
+     196            1 :     printf("PASS\n");
+     197            1 : }
+     198              : 
+     199              : /* ========================================================================
+     200              :  * Main
+     201              :  * ======================================================================== */
+     202              : 
+     203            1 : int main(void) {
+     204            1 :     printf("Running YAFL suspend/resume tests...\n");
+     205              : 
+     206            1 :     test_bidirectional_data_passing();
+     207            1 :     test_multiple_suspend_points();
+     208            1 :     test_conditional_suspension();
+     209            1 :     test_null_data_passing();
+     210            1 :     test_vmem_suspend_resume();
+     211              : 
+     212            1 :     printf("\nAll tests passed!\n");
+     213            1 :     return 0;
+     214              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.0-1
+
+ + + diff --git a/docs/coverage/updown.png b/docs/coverage/updown.png new file mode 100644 index 0000000000000000000000000000000000000000..aa56a238b3e6c435265250f9266cd1b8caba0f20 GIT binary patch literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^AT}Qd8;}%R+`Ae`*?77*hG?8mPH5^{)z4*}Q$iB}huR`+ literal 0 HcmV?d00001 From 25a75f251f80f0625dddce76a3dc11979b0bebc0 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 07:08:28 -0800 Subject: [PATCH 06/33] Timestamps were causing merge conflicts. Filter them out for now until we can find a better solution. --- .github/workflows/coverage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2d04d3e..6908bbd 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -34,6 +34,12 @@ jobs: lcov --remove coverage.info '/usr/*' --output-file coverage.info genhtml coverage.info --output-directory docs/coverage --title "yafl Code Coverage" + - name: Normalize coverage HTML timestamps + run: | + # Remove or normalize timestamps from generated HTML to avoid merge conflicts + find docs/coverage -name "*.html" -type f -exec sed -i 's/[^<]*<\/td>/Generated<\/td>/g' {} \; + echo "Normalized timestamps in coverage HTML files" + - name: Generate coverage badge run: | chmod +x scripts/make_coverage_badge.sh From 458ccc650f4c15e1ec5a0ee929fcb953b8dc5e93 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 31 Jan 2026 15:09:02 +0000 Subject: [PATCH 07/33] Update code coverage report [skip ci] --- docs/coverage/index-sort-f.html | 4 ++-- docs/coverage/index-sort-l.html | 4 ++-- docs/coverage/index.html | 4 ++-- docs/coverage/src/index-sort-f.html | 4 ++-- docs/coverage/src/index-sort-l.html | 4 ++-- docs/coverage/src/index.html | 4 ++-- docs/coverage/src/yafl.c.func-c.html | 4 ++-- docs/coverage/src/yafl.c.func.html | 4 ++-- docs/coverage/src/yafl.c.gcov.html | 4 ++-- docs/coverage/tests/index-sort-f.html | 4 ++-- docs/coverage/tests/index-sort-l.html | 4 ++-- docs/coverage/tests/index.html | 4 ++-- docs/coverage/tests/test_yafl_basic.c.func-c.html | 4 ++-- docs/coverage/tests/test_yafl_basic.c.func.html | 4 ++-- docs/coverage/tests/test_yafl_basic.c.gcov.html | 4 ++-- docs/coverage/tests/test_yafl_guard.c.func-c.html | 4 ++-- docs/coverage/tests/test_yafl_guard.c.func.html | 4 ++-- docs/coverage/tests/test_yafl_guard.c.gcov.html | 4 ++-- docs/coverage/tests/test_yafl_many.c.func-c.html | 4 ++-- docs/coverage/tests/test_yafl_many.c.func.html | 4 ++-- docs/coverage/tests/test_yafl_many.c.gcov.html | 4 ++-- docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html | 4 ++-- docs/coverage/tests/test_yafl_suspend_resume.c.func.html | 4 ++-- docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html | 4 ++-- 24 files changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/coverage/index-sort-f.html b/docs/coverage/index-sort-f.html index 7fe2d54..add076a 100644 --- a/docs/coverage/index-sort-f.html +++ b/docs/coverage/index-sort-f.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 86.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 89.5 % diff --git a/docs/coverage/index-sort-l.html b/docs/coverage/index-sort-l.html index 777c012..ce23a23 100644 --- a/docs/coverage/index-sort-l.html +++ b/docs/coverage/index-sort-l.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 86.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 89.5 % diff --git a/docs/coverage/index.html b/docs/coverage/index.html index 812f2e1..8c51e48 100644 --- a/docs/coverage/index.html +++ b/docs/coverage/index.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 86.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 89.5 % diff --git a/docs/coverage/src/index-sort-f.html b/docs/coverage/src/index-sort-f.html index 4841c90..349824d 100644 --- a/docs/coverage/src/index-sort-f.html +++ b/docs/coverage/src/index-sort-f.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/index-sort-l.html b/docs/coverage/src/index-sort-l.html index 2647ea8..2c30cb2 100644 --- a/docs/coverage/src/index-sort-l.html +++ b/docs/coverage/src/index-sort-l.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/index.html b/docs/coverage/src/index.html index 6bb7701..0f2c5f4 100644 --- a/docs/coverage/src/index.html +++ b/docs/coverage/src/index.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/yafl.c.func-c.html b/docs/coverage/src/yafl.c.func-c.html index be4222e..c46b48b 100644 --- a/docs/coverage/src/yafl.c.func-c.html +++ b/docs/coverage/src/yafl.c.func-c.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/yafl.c.func.html b/docs/coverage/src/yafl.c.func.html index a4392a5..afb0852 100644 --- a/docs/coverage/src/yafl.c.func.html +++ b/docs/coverage/src/yafl.c.func.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/yafl.c.gcov.html b/docs/coverage/src/yafl.c.gcov.html index 286bf49..e606534 100644 --- a/docs/coverage/src/yafl.c.gcov.html +++ b/docs/coverage/src/yafl.c.gcov.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 83.2 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 87.5 % diff --git a/docs/coverage/tests/index-sort-f.html b/docs/coverage/tests/index-sort-f.html index 8f12c67..7e2b0c5 100644 --- a/docs/coverage/tests/index-sort-f.html +++ b/docs/coverage/tests/index-sort-f.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 87.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 90.0 % diff --git a/docs/coverage/tests/index-sort-l.html b/docs/coverage/tests/index-sort-l.html index dd77992..2ee6554 100644 --- a/docs/coverage/tests/index-sort-l.html +++ b/docs/coverage/tests/index-sort-l.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 87.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 90.0 % diff --git a/docs/coverage/tests/index.html b/docs/coverage/tests/index.html index da0d238..c06ba1a 100644 --- a/docs/coverage/tests/index.html +++ b/docs/coverage/tests/index.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 87.1 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 90.0 % diff --git a/docs/coverage/tests/test_yafl_basic.c.func-c.html b/docs/coverage/tests/test_yafl_basic.c.func-c.html index fd6e964..ed2a718 100644 --- a/docs/coverage/tests/test_yafl_basic.c.func-c.html +++ b/docs/coverage/tests/test_yafl_basic.c.func-c.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_basic.c.func.html b/docs/coverage/tests/test_yafl_basic.c.func.html index 345fb8d..d1af4b8 100644 --- a/docs/coverage/tests/test_yafl_basic.c.func.html +++ b/docs/coverage/tests/test_yafl_basic.c.func.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_basic.c.gcov.html b/docs/coverage/tests/test_yafl_basic.c.gcov.html index 43336b1..52bb335 100644 --- a/docs/coverage/tests/test_yafl_basic.c.gcov.html +++ b/docs/coverage/tests/test_yafl_basic.c.gcov.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_guard.c.func-c.html b/docs/coverage/tests/test_yafl_guard.c.func-c.html index e9857c3..5479975 100644 --- a/docs/coverage/tests/test_yafl_guard.c.func-c.html +++ b/docs/coverage/tests/test_yafl_guard.c.func-c.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 32.5 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 25.0 % diff --git a/docs/coverage/tests/test_yafl_guard.c.func.html b/docs/coverage/tests/test_yafl_guard.c.func.html index 3477552..f456f8b 100644 --- a/docs/coverage/tests/test_yafl_guard.c.func.html +++ b/docs/coverage/tests/test_yafl_guard.c.func.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 32.5 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 25.0 % diff --git a/docs/coverage/tests/test_yafl_guard.c.gcov.html b/docs/coverage/tests/test_yafl_guard.c.gcov.html index 3b1a11e..43892bd 100644 --- a/docs/coverage/tests/test_yafl_guard.c.gcov.html +++ b/docs/coverage/tests/test_yafl_guard.c.gcov.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 32.5 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 25.0 % diff --git a/docs/coverage/tests/test_yafl_many.c.func-c.html b/docs/coverage/tests/test_yafl_many.c.func-c.html index 51f5c73..1126f91 100644 --- a/docs/coverage/tests/test_yafl_many.c.func-c.html +++ b/docs/coverage/tests/test_yafl_many.c.func-c.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_many.c.func.html b/docs/coverage/tests/test_yafl_many.c.func.html index e5025a9..b9d9b9e 100644 --- a/docs/coverage/tests/test_yafl_many.c.func.html +++ b/docs/coverage/tests/test_yafl_many.c.func.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_many.c.gcov.html b/docs/coverage/tests/test_yafl_many.c.gcov.html index 3bf5007..931072c 100644 --- a/docs/coverage/tests/test_yafl_many.c.gcov.html +++ b/docs/coverage/tests/test_yafl_many.c.gcov.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html b/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html index 32c8e43..d40870e 100644 --- a/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.func-c.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.func.html b/docs/coverage/tests/test_yafl_suspend_resume.c.func.html index 06760f2..6704222 100644 --- a/docs/coverage/tests/test_yafl_suspend_resume.c.func.html +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.func.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % diff --git a/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html b/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html index e0aac70..a015f7e 100644 --- a/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html +++ b/docs/coverage/tests/test_yafl_suspend_resume.c.gcov.html @@ -28,7 +28,7 @@ Test: - yafl Code Coverage + Generated Lines: 100.0 % @@ -37,7 +37,7 @@ Test Date: - 2026-01-31 14:38:53 + Generated Functions: 100.0 % From 26357735a6e1bad4b48004c2afafaee746f00162 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 07:38:11 -0800 Subject: [PATCH 08/33] Try to avoid merge problems by ignoring the coverage report files except for the SVG badge. Adding templates for issues and the CONTRIBUTING.md page. --- .github/ISSUE_TEMPLATE/bug_report.md | 43 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/ISSUE_TEMPLATE/feature_request.md | 23 ++++++++++++ .github/workflows/coverage.yml | 8 ++-- .gitignore | 7 ++++ CONTRIBUTING.md | 46 +++++++++++++++++++++++ README.md | 2 +- 7 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..14eba5d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,43 @@ +--- +name: Bug report +about: Report a bug to help us improve +title: "[BUG] " +labels: bug +assignees: '' + +--- + +## Description +A clear and concise description of what the bug is. + +## Steps to Reproduce +Steps to reproduce the behavior: +1. Go to '...' +2. Run '...' +3. See error + +## Expected Behavior +A clear and concise description of what you expected to happen. + +## Actual Behavior +What actually happened instead. + +## Environment +- **OS**: [e.g., Linux, macOS, Windows] +- **Architecture**: [e.g., x86_64, ARM64, RISC-V] +- **Compiler**: [e.g., GCC 11, Clang 14, MSVC 2022] +- **yafl Version**: [e.g., 0.1.0] +- **CMake Version**: [version] + +## Code Example +```c +// Minimal code example that reproduces the issue +``` + +## Error Messages +``` +Paste any error messages or logs here +``` + +## Additional Context +Add any other context about the problem here (screenshots, configuration, etc.). diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..32477fe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Discussions + url: https://github.com/libplctag/yafl/discussions + about: Ask questions and share ideas diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..10d4bb8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE] " +labels: enhancement +assignees: '' + +--- + +## Description +Is your feature request related to a problem? Describe it here. + +## Proposed Solution +A clear and concise description of what you want to happen. + +## Alternatives Considered +A clear and concise description of any alternative solutions or features you've considered. + +## Use Case +Describe the use case or scenario where this feature would be useful. + +## Additional Context +Add any other context or mockups about the feature request here. diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6908bbd..046370f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -49,14 +49,14 @@ jobs: run: | touch docs/.nojekyll - - name: Commit and push coverage to prerelease + - name: Commit and push coverage badge to prerelease if: github.event_name == 'push' && github.ref == 'refs/heads/prerelease' run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" - git add -A docs/ + git add docs/coverage.svg if git diff --quiet --cached; then - echo "No coverage changes to commit" + echo "No coverage badge changes to commit" else - git commit -m "Update code coverage report [skip ci]" && git push origin prerelease + git commit -m "Update code coverage badge [skip ci]" && git push origin prerelease fi diff --git a/.gitignore b/.gitignore index cb7c49b..9a711a9 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,13 @@ a.out # CTest and test runtime artifacts Testing/ +# Code coverage (ignore HTML reports directory, but keep SVG badge) +/docs/coverage/ +coverage.info +*.gcda +*.gcno +*.gcov + # Python bytecode (if any) __pycache__/ *.pyc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cd1344b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing to yafl + +## Getting Started + +1. Fork the repository +2. Clone your fork locally +3. Create a feature branch from `prerelease` + +## Making Changes + +1. Make your changes and test them locally +2. For coverage testing, run: `./scripts/generate_coverage.sh` +3. Commit with clear, descriptive messages + +## Submitting Changes + +**Important:** Always open pull requests against the **`prerelease`** branch, not `release`. + +- The `prerelease` branch is for active development +- The `release` branch is only for tagged releases +- PRs to `prerelease` will trigger automated tests and coverage analysis + +## Branch Workflow + +- **prerelease**: Development branch (your PRs go here) +- **release**: Tagged releases (automatically updated from prerelease) + +## Code Style + +- C11 standard +- Use existing code style as a guide +- Include comments for complex logic + +## Testing + +All tests must pass before PRs are merged: + +```bash +mkdir -p build && cd build +cmake -B . -DTARGET= .. +ctest --output-on-failure +``` + +## Questions? + +Open an issue for discussion before making major changes. diff --git a/README.md b/README.md index 0bd6d81..bdbe5dd 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ | powerpc-unknown-linux-gnu | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | | i386-unknown-linux-gnu | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | -[![Coverage](docs/coverage.svg)](docs/coverage/index.html) +![Coverage](docs/coverage.svg) A portable, low-level C11 fiber/coroutine library derived from Boost.Context. From 384f777f10676745b719b7442186c13925f3571f Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 07:45:29 -0800 Subject: [PATCH 09/33] Add automatic version update in the README.md file. --- .github/workflows/update-version-readme.yml | 57 +++++++++++++++++++++ README.md | 2 + 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/update-version-readme.yml diff --git a/.github/workflows/update-version-readme.yml b/.github/workflows/update-version-readme.yml new file mode 100644 index 0000000..c2ecf0f --- /dev/null +++ b/.github/workflows/update-version-readme.yml @@ -0,0 +1,57 @@ +name: Update README and Bump Patch Version + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + update-readme-and-version: + runs-on: ubuntu-latest + steps: + - name: Checkout release branch + uses: actions/checkout@v4 + with: + ref: release + fetch-depth: 0 + + - name: Extract version from tag + id: version + run: | + VERSION=${GITHUB_REF#refs/tags/v} + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Update README with current version + run: | + # Replace existing version line in README + sed -i "s/\*\*Latest Release:\*\*.*/Latest Release:** v${{ steps.version.outputs.version }}/" README.md + + - name: Commit README update to release + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add README.md + git commit -m "Update README with release v${{ steps.version.outputs.version }} [skip ci]" + git push origin release + + - name: Checkout prerelease branch + uses: actions/checkout@v4 + with: + ref: prerelease + fetch-depth: 0 + + - name: Increment patch version on prerelease + run: | + chmod +x scripts/increment_version.sh + scripts/increment_version.sh patch + + - name: Commit version bump to prerelease + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + NEW_VERSION=$(cat VERSION) + git add VERSION + git commit -m "Bump patch version to $NEW_VERSION [skip ci]" + git push origin prerelease diff --git a/README.md b/README.md index bdbe5dd..8c4161d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ ![Coverage](docs/coverage.svg) +**Latest Release:** v0.1.0 + A portable, low-level C11 fiber/coroutine library derived from Boost.Context. ## Why Another Fiber Library? From ddbccab41685a1160786127bd0fbe87d5c508748 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 08:34:15 -0800 Subject: [PATCH 10/33] Add Alpine builds. --- .github/workflows/aarch64-alpine-linux.yml | 21 ++++++ .github/workflows/armv7-alpine-linux.yml | 26 +++++++ .github/workflows/i386-alpine-linux.yml | 22 ++++++ .../mips64el-unknown-linux-gnuabi64.yml | 2 +- .../workflows/mipsel-unknown-linux-gnu.yml | 2 +- .../workflows/powerpc-unknown-linux-gnu.yml | 2 +- .../powerpc64le-unknown-linux-gnu.yml | 2 +- .github/workflows/ppc64le-alpine-linux.yml | 27 +++++++ .github/workflows/riscv64-alpine-linux.yml | 27 +++++++ .github/workflows/s390x-alpine-linux.yml | 27 +++++++ .github/workflows/x86_64-alpine-linux.yml | 21 ++++++ .../x86_64-unknown-linux-android.yml | 5 +- README.md | 71 +++++++++++++------ docker/Dockerfile.alpine-aarch64 | 30 ++++++++ docker/Dockerfile.alpine-armv7 | 30 ++++++++ docker/Dockerfile.alpine-i386 | 30 ++++++++ docker/Dockerfile.alpine-ppc64le | 30 ++++++++ docker/Dockerfile.alpine-riscv64 | 30 ++++++++ docker/Dockerfile.alpine-s390x | 30 ++++++++ docker/Dockerfile.alpine-x86_64 | 29 ++++++++ docker/Dockerfile.arm32 | 37 +++++++--- docker/Dockerfile.mips | 14 ---- docker/Dockerfile.mips64el | 32 +++++++++ docker/Dockerfile.mipsel | 32 +++++++++ docker/Dockerfile.powerpc | 32 +++++++++ docker/Dockerfile.powerpc64le | 32 +++++++++ docker/Dockerfile.ppc | 14 ---- docker/Dockerfile.riscv64 | 37 +++++++--- docker/Dockerfile.sparc64 | 37 +++++++--- 29 files changed, 650 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/aarch64-alpine-linux.yml create mode 100644 .github/workflows/armv7-alpine-linux.yml create mode 100644 .github/workflows/i386-alpine-linux.yml create mode 100644 .github/workflows/ppc64le-alpine-linux.yml create mode 100644 .github/workflows/riscv64-alpine-linux.yml create mode 100644 .github/workflows/s390x-alpine-linux.yml create mode 100644 .github/workflows/x86_64-alpine-linux.yml create mode 100644 docker/Dockerfile.alpine-aarch64 create mode 100644 docker/Dockerfile.alpine-armv7 create mode 100644 docker/Dockerfile.alpine-i386 create mode 100644 docker/Dockerfile.alpine-ppc64le create mode 100644 docker/Dockerfile.alpine-riscv64 create mode 100644 docker/Dockerfile.alpine-s390x create mode 100644 docker/Dockerfile.alpine-x86_64 delete mode 100644 docker/Dockerfile.mips create mode 100644 docker/Dockerfile.mips64el create mode 100644 docker/Dockerfile.mipsel create mode 100644 docker/Dockerfile.powerpc create mode 100644 docker/Dockerfile.powerpc64le delete mode 100644 docker/Dockerfile.ppc diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml new file mode 100644 index 0000000..7810253 --- /dev/null +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -0,0 +1,21 @@ +name: aarch64-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest-arm64 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=aarch64-unknown-linux-musl \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/armv7-alpine-linux.yml b/.github/workflows/armv7-alpine-linux.yml new file mode 100644 index 0000000..b8ad8bb --- /dev/null +++ b/.github/workflows/armv7-alpine-linux.yml @@ -0,0 +1,26 @@ +name: armv7-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-armv7 . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=arm-unknown-linux-gnueabihf \ + -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml new file mode 100644 index 0000000..9de67ea --- /dev/null +++ b/.github/workflows/i386-alpine-linux.yml @@ -0,0 +1,22 @@ +name: i386-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=i386-pc-linux-musl \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_C_FLAGS='-m32' \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml index 9bd18b6..799d970 100644 --- a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml +++ b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mips . + run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - name: Build and Test run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ diff --git a/.github/workflows/mipsel-unknown-linux-gnu.yml b/.github/workflows/mipsel-unknown-linux-gnu.yml index 39dd8c3..05d9c78 100644 --- a/.github/workflows/mipsel-unknown-linux-gnu.yml +++ b/.github/workflows/mipsel-unknown-linux-gnu.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mips . + run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - name: Build and Test run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ diff --git a/.github/workflows/powerpc-unknown-linux-gnu.yml b/.github/workflows/powerpc-unknown-linux-gnu.yml index b9f1156..3045bc6 100644 --- a/.github/workflows/powerpc-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc-unknown-linux-gnu.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.ppc . + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - name: Build and Test run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ diff --git a/.github/workflows/powerpc64le-unknown-linux-gnu.yml b/.github/workflows/powerpc64le-unknown-linux-gnu.yml index 643562a..546bfb1 100644 --- a/.github/workflows/powerpc64le-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc64le-unknown-linux-gnu.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.ppc . + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - name: Build and Test run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ diff --git a/.github/workflows/ppc64le-alpine-linux.yml b/.github/workflows/ppc64le-alpine-linux.yml new file mode 100644 index 0000000..f3c082f --- /dev/null +++ b/.github/workflows/ppc64le-alpine-linux.yml @@ -0,0 +1,27 @@ +name: ppc64le-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc64le + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-ppc64le . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=powerpc64le-unknown-linux-gnu \ + -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc \ + -DCMAKE_C_FLAGS='-static' \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/riscv64-alpine-linux.yml b/.github/workflows/riscv64-alpine-linux.yml new file mode 100644 index 0000000..49ba235 --- /dev/null +++ b/.github/workflows/riscv64-alpine-linux.yml @@ -0,0 +1,27 @@ +name: riscv64-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-riscv64 . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=riscv64-unknown-linux-gnu \ + -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ + -DCMAKE_C_FLAGS='-static' \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64 \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/s390x-alpine-linux.yml b/.github/workflows/s390x-alpine-linux.yml new file mode 100644 index 0000000..e95de4b --- /dev/null +++ b/.github/workflows/s390x-alpine-linux.yml @@ -0,0 +1,27 @@ +name: s390x-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: s390x + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-s390x . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=s390x-ibm-linux-gnu \ + -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc \ + -DCMAKE_C_FLAGS='-static' \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml new file mode 100644 index 0000000..2ca2c2b --- /dev/null +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -0,0 +1,21 @@ +name: x86_64-alpine-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . + - name: Build and Test + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "mkdir -p build && cd build && \ + cmake -DTARGET=x86_64-pc-linux-musl \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + cmake --build . && \ + ctest --output-on-failure" diff --git a/.github/workflows/x86_64-unknown-linux-android.yml b/.github/workflows/x86_64-unknown-linux-android.yml index f431e66..765080c 100644 --- a/.github/workflows/x86_64-unknown-linux-android.yml +++ b/.github/workflows/x86_64-unknown-linux-android.yml @@ -35,8 +35,11 @@ jobs: - name: Run Tests on Emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 29 + api-level: 34 arch: x86_64 + target: google_apis + cache: true + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim script: | # Wait for emulator to be fully ready adb wait-for-device diff --git a/README.md b/README.md index 8c4161d..c90eea9 100644 --- a/README.md +++ b/README.md @@ -2,27 +2,56 @@ ## Build Status -| Platform | Status | -| -------- | ------ | -| x86_64-pc-linux-gnu | [![x86_64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml) | -| aarch64-pc-linux-gnu | [![aarch64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml) | -| x86_64-apple-darwin | [![x86_64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml) | -| aarch64-apple-darwin | [![aarch64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml) | -| x86_64-pc-windows-msvc | [![x86_64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml) | -| aarch64-pc-windows-msvc | [![aarch64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml) | -| x86_64-pc-windows-gnu | [![x86_64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml) | -| aarch64-pc-windows-gnu | [![aarch64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml) | -| x86_64-unknown-linux-android | [![x86_64-unknown-linux-android](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml) | -| aarch64-apple-ios | [![aarch64-apple-ios](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml) | -| arm-unknown-linux-gnueabihf | [![arm-unknown-linux-gnueabihf](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml) | -| riscv64-unknown-linux-gnu | [![riscv64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml) | -| mipsel-unknown-linux-gnu | [![mipsel-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml) | -| mips64el-unknown-linux-gnuabi64 | [![mips64el-unknown-linux-gnuabi64](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml) | -| powerpc64le-unknown-linux-gnu | [![powerpc64le-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml) | -| s390x-ibm-linux-gnu | [![s390x-ibm-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml) | -| sparc64-unknown-linux-gnu | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | -| powerpc-unknown-linux-gnu | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | -| i386-unknown-linux-gnu | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | +### Linux (glibc) + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| x86_64 | GCC | Linux | glibc | [![x86_64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml) | +| aarch64 | GCC | Linux | glibc | [![aarch64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml) | +| ARM (32-bit) | GCC | Linux | glibc | [![arm-unknown-linux-gnueabihf](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml) | +| RISC-V 64 | GCC | Linux | glibc | [![riscv64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml) | +| MIPS (32-bit LE) | GCC | Linux | glibc | [![mipsel-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml) | +| MIPS (64-bit LE) | GCC | Linux | glibc | [![mips64el-unknown-linux-gnuabi64](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml) | +| PowerPC 64 LE | GCC | Linux | glibc | [![powerpc64le-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml) | +| PowerPC (32-bit) | GCC | Linux | glibc | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | +| s390x | GCC | Linux | glibc | [![s390x-ibm-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml) | +| SPARC 64 | GCC | Linux | glibc | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | +| i386 | GCC | Linux | glibc | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | + +### Linux (Alpine, musl) + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| x86_64 | GCC | Alpine Linux | musl | [![x86_64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux.yml) | +| i386 | GCC | Alpine Linux | musl | [![i386-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux.yml) | +| aarch64 | GCC | Alpine Linux | musl | [![aarch64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux.yml) | +| ARM (32-bit) | GCC | Alpine Linux | musl | [![armv7-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/armv7-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/armv7-alpine-linux.yml) | +| PowerPC 64 LE | GCC | Alpine Linux | musl | [![ppc64le-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/ppc64le-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/ppc64le-alpine-linux.yml) | +| s390x | GCC | Alpine Linux | musl | [![s390x-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/s390x-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-alpine-linux.yml) | +| RISC-V 64 | GCC | Alpine Linux | musl | [![riscv64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/riscv64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-alpine-linux.yml) | + +### macOS + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| x86_64 | Clang | macOS | libc | [![x86_64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml) | +| aarch64 | Clang | macOS | libc | [![aarch64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml) | +| aarch64 | Clang | iOS | libc | [![aarch64-apple-ios](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml) | + +### Windows + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| x86_64 | MSVC | Windows | MSVCRT | [![x86_64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml) | +| aarch64 | MSVC | Windows | MSVCRT | [![aarch64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml) | +| x86_64 | GCC (MinGW) | Windows | MSVCRT | [![x86_64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml) | +| aarch64 | GCC (MinGW) | Windows | MSVCRT | [![aarch64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml) | + +### Android + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| x86_64 | Clang | Android | bionic | [![x86_64-unknown-linux-android](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml) | ![Coverage](docs/coverage.svg) diff --git a/docker/Dockerfile.alpine-aarch64 b/docker/Dockerfile.alpine-aarch64 new file mode 100644 index 0000000..6479e33 --- /dev/null +++ b/docker/Dockerfile.alpine-aarch64 @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + aarch64-linux-gnu-gcc \ + qemu-system-aarch64 \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-armv7 b/docker/Dockerfile.alpine-armv7 new file mode 100644 index 0000000..7fe5e19 --- /dev/null +++ b/docker/Dockerfile.alpine-armv7 @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + arm-linux-gnueabihf-gcc \ + qemu-system-arm \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-i386 b/docker/Dockerfile.alpine-i386 new file mode 100644 index 0000000..bdd7e37 --- /dev/null +++ b/docker/Dockerfile.alpine-i386 @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + gcc-doc \ + qemu-system-x86_64 \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-ppc64le b/docker/Dockerfile.alpine-ppc64le new file mode 100644 index 0000000..d6d0670 --- /dev/null +++ b/docker/Dockerfile.alpine-ppc64le @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + powerpc64le-linux-gnu-gcc \ + qemu-system-ppc64 \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-riscv64 b/docker/Dockerfile.alpine-riscv64 new file mode 100644 index 0000000..3a10778 --- /dev/null +++ b/docker/Dockerfile.alpine-riscv64 @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + riscv64-linux-gnu-gcc \ + qemu-system-riscv64 \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-s390x b/docker/Dockerfile.alpine-s390x new file mode 100644 index 0000000..6cdc5cc --- /dev/null +++ b/docker/Dockerfile.alpine-s390x @@ -0,0 +1,30 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + s390x-linux-gnu-gcc \ + qemu-system-s390x \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.alpine-x86_64 b/docker/Dockerfile.alpine-x86_64 new file mode 100644 index 0000000..bb8dc71 --- /dev/null +++ b/docker/Dockerfile.alpine-x86_64 @@ -0,0 +1,29 @@ +FROM alpine:latest + +# Configure apk with retry logic for transient network failures +RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apk update && \ + apk add --no-cache \ + cmake \ + make \ + gcc \ + musl-dev \ + qemu-system-x86_64 \ + qemu-user \ + wget && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.arm32 b/docker/Dockerfile.arm32 index 0b5a940..8ef5312 100644 --- a/docker/Dockerfile.arm32 +++ b/docker/Dockerfile.arm32 @@ -1,13 +1,32 @@ FROM debian:bookworm-slim -RUN apt-get update && apt-get install -y \ - cmake \ - build-essential \ - qemu-user \ - qemu-user-static \ - gcc-arm-linux-gnueabihf \ - wget \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-arm-linux-gnueabihf \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done WORKDIR /src \ No newline at end of file diff --git a/docker/Dockerfile.mips b/docker/Dockerfile.mips deleted file mode 100644 index 79ec871..0000000 --- a/docker/Dockerfile.mips +++ /dev/null @@ -1,14 +0,0 @@ -FROM debian:bullseye-slim - -RUN apt-get update && apt-get install -y \ - cmake \ - build-essential \ - qemu-user \ - qemu-user-static \ - gcc-mipsel-linux-gnu \ - gcc-mips64el-linux-gnuabi64 \ - wget \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /src \ No newline at end of file diff --git a/docker/Dockerfile.mips64el b/docker/Dockerfile.mips64el new file mode 100644 index 0000000..d0810bd --- /dev/null +++ b/docker/Dockerfile.mips64el @@ -0,0 +1,32 @@ +FROM debian:bullseye-slim + +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-mips64el-linux-gnuabi64 \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.mipsel b/docker/Dockerfile.mipsel new file mode 100644 index 0000000..f0c0da2 --- /dev/null +++ b/docker/Dockerfile.mipsel @@ -0,0 +1,32 @@ +FROM debian:bullseye-slim + +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-mipsel-linux-gnu \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.powerpc b/docker/Dockerfile.powerpc new file mode 100644 index 0000000..9b8b6df --- /dev/null +++ b/docker/Dockerfile.powerpc @@ -0,0 +1,32 @@ +FROM debian:bookworm-slim + +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-powerpc-linux-gnu \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.powerpc64le b/docker/Dockerfile.powerpc64le new file mode 100644 index 0000000..2d20c30 --- /dev/null +++ b/docker/Dockerfile.powerpc64le @@ -0,0 +1,32 @@ +FROM debian:bookworm-slim + +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-powerpc64le-linux-gnu \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done + +WORKDIR /src diff --git a/docker/Dockerfile.ppc b/docker/Dockerfile.ppc deleted file mode 100644 index 6ef43c7..0000000 --- a/docker/Dockerfile.ppc +++ /dev/null @@ -1,14 +0,0 @@ -FROM debian:bookworm-slim - -RUN apt-get update && apt-get install -y \ - cmake \ - build-essential \ - qemu-user \ - qemu-user-static \ - gcc-powerpc-linux-gnu \ - gcc-powerpc64le-linux-gnu \ - wget \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /src \ No newline at end of file diff --git a/docker/Dockerfile.riscv64 b/docker/Dockerfile.riscv64 index c5b2325..d3d712d 100644 --- a/docker/Dockerfile.riscv64 +++ b/docker/Dockerfile.riscv64 @@ -1,13 +1,32 @@ FROM debian:bookworm-slim -RUN apt-get update && apt-get install -y \ - cmake \ - build-essential \ - qemu-user \ - qemu-user-static \ - gcc-riscv64-linux-gnu \ - wget \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-riscv64-linux-gnu \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done WORKDIR /src \ No newline at end of file diff --git a/docker/Dockerfile.sparc64 b/docker/Dockerfile.sparc64 index e83badf..7b005ac 100644 --- a/docker/Dockerfile.sparc64 +++ b/docker/Dockerfile.sparc64 @@ -1,13 +1,32 @@ FROM debian:bookworm-slim -RUN apt-get update && apt-get install -y \ - cmake \ - build-essential \ - qemu-user \ - qemu-user-static \ - gcc-sparc64-linux-gnu \ - wget \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* +# Configure apt with retry logic for transient network failures +RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::ConnectionAttemptDelayMsec "1000";' >> /etc/apt/apt.conf.d/99-retries && \ + echo 'Acquire::http::Timeout "60";' >> /etc/apt/apt.conf.d/99-retries + +# Install packages with retry loop to handle transient network issues +RUN for attempt in 1 2 3; do \ + echo "Attempt $attempt/3: Updating package list..." && \ + apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + qemu-user \ + qemu-user-static \ + gcc-sparc64-linux-gnu \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* && \ + echo "Installation successful" && \ + exit 0 || \ + (if [ $attempt -lt 3 ]; then \ + echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ + sleep 15; \ + else \ + echo "All 3 attempts failed"; \ + exit 1; \ + fi); \ + done WORKDIR /src \ No newline at end of file From 7c4fc1d131231a44f1a4b5523feee1c37a312de6 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 08:49:41 -0800 Subject: [PATCH 11/33] Alpine does not have Qemu user packages for all these architecture. So compile in Alpine containers and test on the host with Qemu. --- .github/workflows/armv7-alpine-linux.yml | 10 ++++++---- .github/workflows/ppc64le-alpine-linux.yml | 10 ++++++---- .github/workflows/riscv64-alpine-linux.yml | 10 ++++++---- .github/workflows/s390x-alpine-linux.yml | 10 ++++++---- docker/Dockerfile.alpine-aarch64 | 6 +----- docker/Dockerfile.alpine-armv7 | 5 +---- docker/Dockerfile.alpine-i386 | 6 +----- docker/Dockerfile.alpine-ppc64le | 5 +---- docker/Dockerfile.alpine-riscv64 | 5 +---- docker/Dockerfile.alpine-s390x | 5 +---- docker/Dockerfile.alpine-x86_64 | 5 +---- 11 files changed, 31 insertions(+), 46 deletions(-) diff --git a/.github/workflows/armv7-alpine-linux.yml b/.github/workflows/armv7-alpine-linux.yml index b8ad8bb..2c8810b 100644 --- a/.github/workflows/armv7-alpine-linux.yml +++ b/.github/workflows/armv7-alpine-linux.yml @@ -13,14 +13,16 @@ jobs: platforms: arm - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-armv7 . - - name: Build and Test + - name: Build in Container run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ cmake -DTARGET=arm-unknown-linux-gnueabihf \ -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \ -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Test on Host + run: | + cd ${{ github.workspace }}/build && \ + ctest --output-on-failure diff --git a/.github/workflows/ppc64le-alpine-linux.yml b/.github/workflows/ppc64le-alpine-linux.yml index f3c082f..60e6306 100644 --- a/.github/workflows/ppc64le-alpine-linux.yml +++ b/.github/workflows/ppc64le-alpine-linux.yml @@ -13,7 +13,7 @@ jobs: platforms: ppc64le - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-ppc64le . - - name: Build and Test + - name: Build in Container run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -21,7 +21,9 @@ jobs: -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Test on Host + run: | + cd ${{ github.workspace }}/build && \ + ctest --output-on-failure diff --git a/.github/workflows/riscv64-alpine-linux.yml b/.github/workflows/riscv64-alpine-linux.yml index 49ba235..fa0dcd4 100644 --- a/.github/workflows/riscv64-alpine-linux.yml +++ b/.github/workflows/riscv64-alpine-linux.yml @@ -13,7 +13,7 @@ jobs: platforms: riscv64 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-riscv64 . - - name: Build and Test + - name: Build in Container run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -21,7 +21,9 @@ jobs: -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64 \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Test on Host + run: | + cd ${{ github.workspace }}/build && \ + ctest --output-on-failure diff --git a/.github/workflows/s390x-alpine-linux.yml b/.github/workflows/s390x-alpine-linux.yml index e95de4b..818e475 100644 --- a/.github/workflows/s390x-alpine-linux.yml +++ b/.github/workflows/s390x-alpine-linux.yml @@ -13,7 +13,7 @@ jobs: platforms: s390x - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-s390x . - - name: Build and Test + - name: Build in Container run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -21,7 +21,9 @@ jobs: -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Test on Host + run: | + cd ${{ github.workspace }}/build && \ + ctest --output-on-failure diff --git a/docker/Dockerfile.alpine-aarch64 b/docker/Dockerfile.alpine-aarch64 index 6479e33..fd58ff5 100644 --- a/docker/Dockerfile.alpine-aarch64 +++ b/docker/Dockerfile.alpine-aarch64 @@ -11,11 +11,7 @@ RUN for attempt in 1 2 3; do \ cmake \ make \ gcc \ - musl-dev \ - aarch64-linux-gnu-gcc \ - qemu-system-aarch64 \ - qemu-user \ - wget && \ + musl-dev && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-armv7 b/docker/Dockerfile.alpine-armv7 index 7fe5e19..0259cea 100644 --- a/docker/Dockerfile.alpine-armv7 +++ b/docker/Dockerfile.alpine-armv7 @@ -12,10 +12,7 @@ RUN for attempt in 1 2 3; do \ make \ gcc \ musl-dev \ - arm-linux-gnueabihf-gcc \ - qemu-system-arm \ - qemu-user \ - wget && \ + arm-linux-gnueabihf-gcc && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-i386 b/docker/Dockerfile.alpine-i386 index bdd7e37..fd58ff5 100644 --- a/docker/Dockerfile.alpine-i386 +++ b/docker/Dockerfile.alpine-i386 @@ -11,11 +11,7 @@ RUN for attempt in 1 2 3; do \ cmake \ make \ gcc \ - musl-dev \ - gcc-doc \ - qemu-system-x86_64 \ - qemu-user \ - wget && \ + musl-dev && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-ppc64le b/docker/Dockerfile.alpine-ppc64le index d6d0670..3f052e8 100644 --- a/docker/Dockerfile.alpine-ppc64le +++ b/docker/Dockerfile.alpine-ppc64le @@ -12,10 +12,7 @@ RUN for attempt in 1 2 3; do \ make \ gcc \ musl-dev \ - powerpc64le-linux-gnu-gcc \ - qemu-system-ppc64 \ - qemu-user \ - wget && \ + powerpc64le-linux-gnu-gcc && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-riscv64 b/docker/Dockerfile.alpine-riscv64 index 3a10778..63d019c 100644 --- a/docker/Dockerfile.alpine-riscv64 +++ b/docker/Dockerfile.alpine-riscv64 @@ -12,10 +12,7 @@ RUN for attempt in 1 2 3; do \ make \ gcc \ musl-dev \ - riscv64-linux-gnu-gcc \ - qemu-system-riscv64 \ - qemu-user \ - wget && \ + riscv64-linux-gnu-gcc && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-s390x b/docker/Dockerfile.alpine-s390x index 6cdc5cc..62b2e8f 100644 --- a/docker/Dockerfile.alpine-s390x +++ b/docker/Dockerfile.alpine-s390x @@ -12,10 +12,7 @@ RUN for attempt in 1 2 3; do \ make \ gcc \ musl-dev \ - s390x-linux-gnu-gcc \ - qemu-system-s390x \ - qemu-user \ - wget && \ + s390x-linux-gnu-gcc && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ diff --git a/docker/Dockerfile.alpine-x86_64 b/docker/Dockerfile.alpine-x86_64 index bb8dc71..fd58ff5 100644 --- a/docker/Dockerfile.alpine-x86_64 +++ b/docker/Dockerfile.alpine-x86_64 @@ -11,10 +11,7 @@ RUN for attempt in 1 2 3; do \ cmake \ make \ gcc \ - musl-dev \ - qemu-system-x86_64 \ - qemu-user \ - wget && \ + musl-dev && \ echo "Installation successful" && \ exit 0 || \ (if [ $attempt -lt 3 ]; then \ From ab8f3cbf1f29031086d2a6fb3ca89392e42ea99b Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 09:10:22 -0800 Subject: [PATCH 12/33] Building via musl cross-compile. Can't use Alpine for most of this. --- .github/workflows/armv7-alpine-linux.yml | 28 ----------------- .github/workflows/armv7-musl-linux.yml | 35 ++++++++++++++++++++++ .github/workflows/ppc64le-alpine-linux.yml | 29 ------------------ .github/workflows/ppc64le-musl-linux.yml | 35 ++++++++++++++++++++++ .github/workflows/riscv64-alpine-linux.yml | 29 ------------------ .github/workflows/riscv64-musl-linux.yml | 35 ++++++++++++++++++++++ .github/workflows/s390x-alpine-linux.yml | 29 ------------------ .github/workflows/s390x-musl-linux.yml | 35 ++++++++++++++++++++++ README.md | 15 ++++++---- docker/Dockerfile.alpine-armv7 | 27 ----------------- docker/Dockerfile.alpine-ppc64le | 27 ----------------- docker/Dockerfile.alpine-riscv64 | 27 ----------------- docker/Dockerfile.alpine-s390x | 27 ----------------- 13 files changed, 150 insertions(+), 228 deletions(-) delete mode 100644 .github/workflows/armv7-alpine-linux.yml create mode 100644 .github/workflows/armv7-musl-linux.yml delete mode 100644 .github/workflows/ppc64le-alpine-linux.yml create mode 100644 .github/workflows/ppc64le-musl-linux.yml delete mode 100644 .github/workflows/riscv64-alpine-linux.yml create mode 100644 .github/workflows/riscv64-musl-linux.yml delete mode 100644 .github/workflows/s390x-alpine-linux.yml create mode 100644 .github/workflows/s390x-musl-linux.yml delete mode 100644 docker/Dockerfile.alpine-armv7 delete mode 100644 docker/Dockerfile.alpine-ppc64le delete mode 100644 docker/Dockerfile.alpine-riscv64 delete mode 100644 docker/Dockerfile.alpine-s390x diff --git a/.github/workflows/armv7-alpine-linux.yml b/.github/workflows/armv7-alpine-linux.yml deleted file mode 100644 index 2c8810b..0000000 --- a/.github/workflows/armv7-alpine-linux.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: armv7-alpine-linux - -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-armv7 . - - name: Build in Container - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=arm-unknown-linux-gnueabihf \ - -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Test on Host - run: | - cd ${{ github.workspace }}/build && \ - ctest --output-on-failure diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml new file mode 100644 index 0000000..179f8f5 --- /dev/null +++ b/.github/workflows/armv7-musl-linux.yml @@ -0,0 +1,35 @@ +name: armv7-musl-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download musl.cc cross-compiler + run: | + mkdir -p /opt/cross + cd /opt/cross + wget -q https://musl.cc/arm-linux-musleabihf-cross.tgz + tar xzf arm-linux-musleabihf-cross.tgz + rm arm-linux-musleabihf-cross.tgz + - name: Build + run: | + mkdir -p build && cd build + cmake -DTARGET=arm-unknown-linux-gnueabihf \ + -DCMAKE_C_COMPILER=/opt/cross/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_SYSTEM_PROCESSOR=arm \ + .. + cmake --build . + - name: Test + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/ppc64le-alpine-linux.yml b/.github/workflows/ppc64le-alpine-linux.yml deleted file mode 100644 index 60e6306..0000000 --- a/.github/workflows/ppc64le-alpine-linux.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: ppc64le-alpine-linux - -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ppc64le - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-ppc64le . - - name: Build in Container - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=powerpc64le-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Test on Host - run: | - cd ${{ github.workspace }}/build && \ - ctest --output-on-failure diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml new file mode 100644 index 0000000..6227e2a --- /dev/null +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -0,0 +1,35 @@ +name: ppc64le-musl-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc64le + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download musl.cc cross-compiler + run: | + mkdir -p /opt/cross + cd /opt/cross + wget -q https://musl.cc/powerpc64le-linux-musl-cross.tgz + tar xzf powerpc64le-linux-musl-cross.tgz + rm powerpc64le-linux-musl-cross.tgz + - name: Build + run: | + mkdir -p build && cd build + cmake -DTARGET=powerpc64le-unknown-linux-gnu \ + -DCMAKE_C_COMPILER=/opt/cross/powerpc64le-linux-musl-cross/bin/powerpc64le-linux-musl-gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ + .. + cmake --build . + - name: Test + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/riscv64-alpine-linux.yml b/.github/workflows/riscv64-alpine-linux.yml deleted file mode 100644 index fa0dcd4..0000000 --- a/.github/workflows/riscv64-alpine-linux.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: riscv64-alpine-linux - -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: riscv64 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-riscv64 . - - name: Build in Container - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=riscv64-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Test on Host - run: | - cd ${{ github.workspace }}/build && \ - ctest --output-on-failure diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml new file mode 100644 index 0000000..59b4806 --- /dev/null +++ b/.github/workflows/riscv64-musl-linux.yml @@ -0,0 +1,35 @@ +name: riscv64-musl-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download musl.cc cross-compiler + run: | + mkdir -p /opt/cross + cd /opt/cross + wget -q https://musl.cc/riscv64-linux-musl-cross.tgz + tar xzf riscv64-linux-musl-cross.tgz + rm riscv64-linux-musl-cross.tgz + - name: Build + run: | + mkdir -p build && cd build + cmake -DTARGET=riscv64-unknown-linux-gnu \ + -DCMAKE_C_COMPILER=/opt/cross/riscv64-linux-musl-cross/bin/riscv64-linux-musl-gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ + .. + cmake --build . + - name: Test + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/s390x-alpine-linux.yml b/.github/workflows/s390x-alpine-linux.yml deleted file mode 100644 index 818e475..0000000 --- a/.github/workflows/s390x-alpine-linux.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: s390x-alpine-linux - -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: s390x - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-s390x . - - name: Build in Container - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=s390x-ibm-linux-gnu \ - -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Test on Host - run: | - cd ${{ github.workspace }}/build && \ - ctest --output-on-failure diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml new file mode 100644 index 0000000..92edc48 --- /dev/null +++ b/.github/workflows/s390x-musl-linux.yml @@ -0,0 +1,35 @@ +name: s390x-musl-linux + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: s390x + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download musl.cc cross-compiler + run: | + mkdir -p /opt/cross + cd /opt/cross + wget -q https://musl.cc/s390x-linux-musl-cross.tgz + tar xzf s390x-linux-musl-cross.tgz + rm s390x-linux-musl-cross.tgz + - name: Build + run: | + mkdir -p build && cd build + cmake -DTARGET=s390x-ibm-linux-gnu \ + -DCMAKE_C_COMPILER=/opt/cross/s390x-linux-musl-cross/bin/s390x-linux-musl-gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_SYSTEM_PROCESSOR=s390x \ + .. + cmake --build . + - name: Test + run: | + cd build + ctest --output-on-failure diff --git a/README.md b/README.md index c90eea9..7042233 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,22 @@ | SPARC 64 | GCC | Linux | glibc | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | | i386 | GCC | Linux | glibc | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | -### Linux (Alpine, musl) +### Linux (Alpine Container, native musl) | Architecture | Compiler | OS | Libc | Status | | ------------ | -------- | -- | ---- | ------ | | x86_64 | GCC | Alpine Linux | musl | [![x86_64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux.yml) | | i386 | GCC | Alpine Linux | musl | [![i386-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux.yml) | | aarch64 | GCC | Alpine Linux | musl | [![aarch64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux.yml) | -| ARM (32-bit) | GCC | Alpine Linux | musl | [![armv7-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/armv7-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/armv7-alpine-linux.yml) | -| PowerPC 64 LE | GCC | Alpine Linux | musl | [![ppc64le-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/ppc64le-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/ppc64le-alpine-linux.yml) | -| s390x | GCC | Alpine Linux | musl | [![s390x-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/s390x-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-alpine-linux.yml) | -| RISC-V 64 | GCC | Alpine Linux | musl | [![riscv64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/riscv64-alpine-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-alpine-linux.yml) | + +### Linux (musl.cc Cross-Compiler, QEMU Emulation) + +| Architecture | Compiler | OS | Libc | Status | +| ------------ | -------- | -- | ---- | ------ | +| ARM (32-bit) | GCC | Linux | musl | [![armv7-musl-linux](https://github.com/libplctag/yafl/actions/workflows/armv7-musl-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/armv7-musl-linux.yml) | +| PowerPC 64 LE | GCC | Linux | musl | [![ppc64le-musl-linux](https://github.com/libplctag/yafl/actions/workflows/ppc64le-musl-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/ppc64le-musl-linux.yml) | +| s390x | GCC | Linux | musl | [![s390x-musl-linux](https://github.com/libplctag/yafl/actions/workflows/s390x-musl-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-musl-linux.yml) | +| RISC-V 64 | GCC | Linux | musl | [![riscv64-musl-linux](https://github.com/libplctag/yafl/actions/workflows/riscv64-musl-linux/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-musl-linux.yml) | ### macOS diff --git a/docker/Dockerfile.alpine-armv7 b/docker/Dockerfile.alpine-armv7 deleted file mode 100644 index 0259cea..0000000 --- a/docker/Dockerfile.alpine-armv7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM alpine:latest - -# Configure apk with retry logic for transient network failures -RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf - -# Install packages with retry loop to handle transient network issues -RUN for attempt in 1 2 3; do \ - echo "Attempt $attempt/3: Updating package list..." && \ - apk update && \ - apk add --no-cache \ - cmake \ - make \ - gcc \ - musl-dev \ - arm-linux-gnueabihf-gcc && \ - echo "Installation successful" && \ - exit 0 || \ - (if [ $attempt -lt 3 ]; then \ - echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ - sleep 15; \ - else \ - echo "All 3 attempts failed"; \ - exit 1; \ - fi); \ - done - -WORKDIR /src diff --git a/docker/Dockerfile.alpine-ppc64le b/docker/Dockerfile.alpine-ppc64le deleted file mode 100644 index 3f052e8..0000000 --- a/docker/Dockerfile.alpine-ppc64le +++ /dev/null @@ -1,27 +0,0 @@ -FROM alpine:latest - -# Configure apk with retry logic for transient network failures -RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf - -# Install packages with retry loop to handle transient network issues -RUN for attempt in 1 2 3; do \ - echo "Attempt $attempt/3: Updating package list..." && \ - apk update && \ - apk add --no-cache \ - cmake \ - make \ - gcc \ - musl-dev \ - powerpc64le-linux-gnu-gcc && \ - echo "Installation successful" && \ - exit 0 || \ - (if [ $attempt -lt 3 ]; then \ - echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ - sleep 15; \ - else \ - echo "All 3 attempts failed"; \ - exit 1; \ - fi); \ - done - -WORKDIR /src diff --git a/docker/Dockerfile.alpine-riscv64 b/docker/Dockerfile.alpine-riscv64 deleted file mode 100644 index 63d019c..0000000 --- a/docker/Dockerfile.alpine-riscv64 +++ /dev/null @@ -1,27 +0,0 @@ -FROM alpine:latest - -# Configure apk with retry logic for transient network failures -RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf - -# Install packages with retry loop to handle transient network issues -RUN for attempt in 1 2 3; do \ - echo "Attempt $attempt/3: Updating package list..." && \ - apk update && \ - apk add --no-cache \ - cmake \ - make \ - gcc \ - musl-dev \ - riscv64-linux-gnu-gcc && \ - echo "Installation successful" && \ - exit 0 || \ - (if [ $attempt -lt 3 ]; then \ - echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ - sleep 15; \ - else \ - echo "All 3 attempts failed"; \ - exit 1; \ - fi); \ - done - -WORKDIR /src diff --git a/docker/Dockerfile.alpine-s390x b/docker/Dockerfile.alpine-s390x deleted file mode 100644 index 62b2e8f..0000000 --- a/docker/Dockerfile.alpine-s390x +++ /dev/null @@ -1,27 +0,0 @@ -FROM alpine:latest - -# Configure apk with retry logic for transient network failures -RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf - -# Install packages with retry loop to handle transient network issues -RUN for attempt in 1 2 3; do \ - echo "Attempt $attempt/3: Updating package list..." && \ - apk update && \ - apk add --no-cache \ - cmake \ - make \ - gcc \ - musl-dev \ - s390x-linux-gnu-gcc && \ - echo "Installation successful" && \ - exit 0 || \ - (if [ $attempt -lt 3 ]; then \ - echo "Attempt $attempt failed, waiting 15 seconds before retry..."; \ - sleep 15; \ - else \ - echo "All 3 attempts failed"; \ - exit 1; \ - fi); \ - done - -WORKDIR /src From 5d149b5bcc6ed2baead34f24ff3683bb37a22ce7 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 09:12:57 -0800 Subject: [PATCH 13/33] Only run the release workflow on the release branch. --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 839aea1..5d53e3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,8 @@ on: - i386-unknown-linux-gnu types: - completed + branches: + - release permissions: contents: write From 0ec939b3da0657bef0665e78af0d806deccec4d0 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 09:47:04 -0800 Subject: [PATCH 14/33] Rewrite workflows to split up into three jobs each: setup, build and test. --- .github/workflows/aarch64-alpine-linux.yml | 37 +++++++++++++-- .github/workflows/aarch64-apple-ios.yml | 17 +++++-- .github/workflows/aarch64-pc-windows-gnu.yml | 32 ++++++++++++- .github/workflows/aarch64-pc-windows-msvc.yml | 30 ++++++++++++- .../workflows/arm-unknown-linux-gnueabihf.yml | 38 ++++++++++++++-- .github/workflows/armv7-musl-linux.yml | 38 +++++++++++++--- .github/workflows/i386-alpine-linux.yml | 37 +++++++++++++-- .github/workflows/i386-unknown-linux-gnu.yml | 34 +++++++++++++- .../mips64el-unknown-linux-gnuabi64.yml | 38 ++++++++++++++-- .../workflows/mipsel-unknown-linux-gnu.yml | 38 ++++++++++++++-- .../workflows/powerpc-unknown-linux-gnu.yml | 38 ++++++++++++++-- .../powerpc64le-unknown-linux-gnu.yml | 38 ++++++++++++++-- .github/workflows/ppc64le-musl-linux.yml | 38 +++++++++++++--- .github/workflows/riscv64-musl-linux.yml | 38 +++++++++++++--- .../workflows/riscv64-unknown-linux-gnu.yml | 38 ++++++++++++++-- .github/workflows/s390x-ibm-linux-gnu.yml | 34 +++++++++++++- .github/workflows/s390x-musl-linux.yml | 38 +++++++++++++--- .../workflows/sparc64-unknown-linux-gnu.yml | 38 ++++++++++++++-- .github/workflows/x86_64-alpine-linux.yml | 37 +++++++++++++-- .github/workflows/x86_64-pc-windows-gnu.yml | 32 ++++++++++++- .../x86_64-unknown-linux-android.yml | 45 ++++++++++++++++--- 21 files changed, 666 insertions(+), 87 deletions(-) diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml index 7810253..a7ae140 100644 --- a/.github/workflows/aarch64-alpine-linux.yml +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -3,13 +3,21 @@ name: aarch64-alpine-linux on: [push, pull_request] jobs: - build-and-test: + setup-aarch64-alpine-linux: runs-on: ubuntu-latest-arm64 steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . - - name: Build and Test + + build-aarch64-alpine-linux: + runs-on: ubuntu-latest-arm64 + needs: setup-aarch64-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -17,5 +25,26 @@ jobs: -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-aarch64-alpine-linux + path: build/ + + test-aarch64-alpine-linux: + runs-on: ubuntu-latest-arm64 + needs: build-aarch64-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-aarch64-alpine-linux + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/aarch64-apple-ios.yml b/.github/workflows/aarch64-apple-ios.yml index a92f8bb..9b30c28 100644 --- a/.github/workflows/aarch64-apple-ios.yml +++ b/.github/workflows/aarch64-apple-ios.yml @@ -3,13 +3,18 @@ name: aarch64-apple-ios on: [push, pull_request] jobs: - build-and-test: - name: iOS Simulator (ARM64) + setup-aarch64-apple-ios: + name: Setup iOS (ARM64) runs-on: macos-15 - steps: - uses: actions/checkout@v4 + build-aarch64-apple-ios: + name: Build iOS Simulator (ARM64) + runs-on: macos-15 + needs: setup-aarch64-apple-ios + steps: + - uses: actions/checkout@v4 - name: Configure CMake run: | cmake -G Xcode \ @@ -17,6 +22,10 @@ jobs: -DTARGET=aarch64-apple-ios \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -B build - - name: Build run: cmake --build build --config Debug + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-aarch64-apple-ios + path: build/ diff --git a/.github/workflows/aarch64-pc-windows-gnu.yml b/.github/workflows/aarch64-pc-windows-gnu.yml index 8040512..6741d39 100644 --- a/.github/workflows/aarch64-pc-windows-gnu.yml +++ b/.github/workflows/aarch64-pc-windows-gnu.yml @@ -3,8 +3,20 @@ name: aarch64-pc-windows-gnu on: [push, pull_request] jobs: - build-and-test: + setup-aarch64-pc-windows-gnu: runs-on: windows-11-arm + steps: + - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: CLANGARM64 + update: true + install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake + + build-aarch64-pc-windows-gnu: + runs-on: windows-11-arm + needs: setup-aarch64-pc-windows-gnu steps: - uses: actions/checkout@v4 - name: Setup MinGW @@ -21,6 +33,22 @@ jobs: - name: Build shell: msys2 {0} run: cmake --build build --parallel 4 - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-aarch64-pc-windows-gnu + path: build/ + + test-aarch64-pc-windows-gnu: + runs-on: windows-11-arm + needs: build-aarch64-pc-windows-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-aarch64-pc-windows-gnu + path: build/ + - name: Run Tests shell: msys2 {0} run: cd build && ctest --output-on-failure diff --git a/.github/workflows/aarch64-pc-windows-msvc.yml b/.github/workflows/aarch64-pc-windows-msvc.yml index 9691773..d9f3f02 100644 --- a/.github/workflows/aarch64-pc-windows-msvc.yml +++ b/.github/workflows/aarch64-pc-windows-msvc.yml @@ -3,8 +3,18 @@ name: aarch64-pc-windows-msvc on: [push, pull_request] jobs: - build-and-test: + setup-aarch64-pc-windows-msvc: runs-on: windows-11-arm + steps: + - uses: actions/checkout@v4 + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: arm64 + + build-aarch64-pc-windows-msvc: + runs-on: windows-11-arm + needs: setup-aarch64-pc-windows-msvc steps: - uses: actions/checkout@v4 - name: Setup MSVC @@ -17,5 +27,21 @@ jobs: cmake -G "Ninja" -DTARGET=aarch64-pc-windows-msvc -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl .. - name: Build run: cmake --build build --config Release --parallel 4 - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-aarch64-pc-windows-msvc + path: build/ + + test-aarch64-pc-windows-msvc: + runs-on: windows-11-arm + needs: build-aarch64-pc-windows-msvc + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-aarch64-pc-windows-msvc + path: build/ + - name: Run Tests run: cd build && ctest --output-on-failure diff --git a/.github/workflows/arm-unknown-linux-gnueabihf.yml b/.github/workflows/arm-unknown-linux-gnueabihf.yml index 73f5a91..6398c2c 100644 --- a/.github/workflows/arm-unknown-linux-gnueabihf.yml +++ b/.github/workflows/arm-unknown-linux-gnueabihf.yml @@ -1,14 +1,23 @@ name: arm-unknown-linux-gnueabihf + on: [push, pull_request] jobs: - build-and-test: + setup-arm-unknown-linux-gnueabihf: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . + + build-arm-unknown-linux-gnueabihf: runs-on: ubuntu-24.04 + needs: setup-arm-unknown-linux-gnueabihf steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-arm-unknown-linux-gnueabihf + path: build/ + + test-arm-unknown-linux-gnueabihf: + runs-on: ubuntu-24.04 + needs: build-arm-unknown-linux-gnueabihf + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-arm-unknown-linux-gnueabihf + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index 179f8f5..aa7e603 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -3,14 +3,18 @@ name: armv7-musl-linux on: [push, pull_request] jobs: - build-and-test: + setup-armv7-musl-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + + build-armv7-musl-linux: + runs-on: ubuntu-latest + needs: setup-armv7-musl-linux + steps: + - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - name: Download musl.cc cross-compiler @@ -20,7 +24,7 @@ jobs: wget -q https://musl.cc/arm-linux-musleabihf-cross.tgz tar xzf arm-linux-musleabihf-cross.tgz rm arm-linux-musleabihf-cross.tgz - - name: Build + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=arm-unknown-linux-gnueabihf \ @@ -29,7 +33,27 @@ jobs: -DCMAKE_SYSTEM_PROCESSOR=arm \ .. cmake --build . - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-armv7-musl-linux + path: build/ + + test-armv7-musl-linux: + runs-on: ubuntu-latest + needs: build-armv7-musl-linux + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-armv7-musl-linux + path: build/ + - name: Run Tests run: | cd build ctest --output-on-failure diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml index 9de67ea..894d35a 100644 --- a/.github/workflows/i386-alpine-linux.yml +++ b/.github/workflows/i386-alpine-linux.yml @@ -3,13 +3,21 @@ name: i386-alpine-linux on: [push, pull_request] jobs: - build-and-test: + setup-i386-alpine-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . - - name: Build and Test + + build-i386-alpine-linux: + runs-on: ubuntu-latest + needs: setup-i386-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +26,26 @@ jobs: -DCMAKE_C_FLAGS='-m32' \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-i386-alpine-linux + path: build/ + + test-i386-alpine-linux: + runs-on: ubuntu-latest + needs: build-i386-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-i386-alpine-linux + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/i386-unknown-linux-gnu.yml b/.github/workflows/i386-unknown-linux-gnu.yml index 533b10d..5d88a1b 100644 --- a/.github/workflows/i386-unknown-linux-gnu.yml +++ b/.github/workflows/i386-unknown-linux-gnu.yml @@ -1,16 +1,27 @@ name: i386-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-i386-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential gcc-multilib qemu-user + + build-i386-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-i386-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y cmake build-essential gcc-multilib qemu-user - - name: Build and Test + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=i386-unknown-linux-gnu \ @@ -18,4 +29,23 @@ jobs: -DCMAKE_C_FLAGS='-m32 -static' \ .. make + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-i386-unknown-linux-gnu + path: build/ + + test-i386-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-i386-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-i386-unknown-linux-gnu + path: build/ + - name: Run Tests + run: | + cd build CTEST_OUTPUT_ON_FAILURE=1 ctest diff --git a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml index 799d970..fbc5267 100644 --- a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml +++ b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml @@ -1,14 +1,23 @@ name: mips64el-unknown-linux-gnuabi64 + on: [push, pull_request] jobs: - build-and-test: + setup-mips64el-unknown-linux-gnuabi64: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . + + build-mips64el-unknown-linux-gnuabi64: runs-on: ubuntu-24.04 + needs: setup-mips64el-unknown-linux-gnuabi64 steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mips64el \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-mips64el-unknown-linux-gnuabi64 + path: build/ + + test-mips64el-unknown-linux-gnuabi64: + runs-on: ubuntu-24.04 + needs: build-mips64el-unknown-linux-gnuabi64 + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-mips64el-unknown-linux-gnuabi64 + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/mipsel-unknown-linux-gnu.yml b/.github/workflows/mipsel-unknown-linux-gnu.yml index 05d9c78..d44082a 100644 --- a/.github/workflows/mipsel-unknown-linux-gnu.yml +++ b/.github/workflows/mipsel-unknown-linux-gnu.yml @@ -1,14 +1,23 @@ name: mipsel-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-mipsel-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . + + build-mipsel-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-mipsel-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mipsel \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-mipsel-unknown-linux-gnu + path: build/ + + test-mipsel-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-mipsel-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-mipsel-unknown-linux-gnu + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/powerpc-unknown-linux-gnu.yml b/.github/workflows/powerpc-unknown-linux-gnu.yml index 3045bc6..c0a4fe3 100644 --- a/.github/workflows/powerpc-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc-unknown-linux-gnu.yml @@ -1,14 +1,23 @@ name: powerpc-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-powerpc-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . + + build-powerpc-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-powerpc-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-powerpc-unknown-linux-gnu + path: build/ + + test-powerpc-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-powerpc-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-powerpc-unknown-linux-gnu + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/powerpc64le-unknown-linux-gnu.yml b/.github/workflows/powerpc64le-unknown-linux-gnu.yml index 546bfb1..8f9afb5 100644 --- a/.github/workflows/powerpc64le-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc64le-unknown-linux-gnu.yml @@ -1,14 +1,23 @@ name: powerpc64le-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-powerpc64le-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . + + build-powerpc64le-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-powerpc64le-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-powerpc64le-unknown-linux-gnu + path: build/ + + test-powerpc64le-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-powerpc64le-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-powerpc64le-unknown-linux-gnu + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index 6227e2a..305a06e 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -3,14 +3,18 @@ name: ppc64le-musl-linux on: [push, pull_request] jobs: - build-and-test: + setup-ppc64le-musl-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ppc64le + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + + build-ppc64le-musl-linux: + runs-on: ubuntu-latest + needs: setup-ppc64le-musl-linux + steps: + - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - name: Download musl.cc cross-compiler @@ -20,7 +24,7 @@ jobs: wget -q https://musl.cc/powerpc64le-linux-musl-cross.tgz tar xzf powerpc64le-linux-musl-cross.tgz rm powerpc64le-linux-musl-cross.tgz - - name: Build + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=powerpc64le-unknown-linux-gnu \ @@ -29,7 +33,27 @@ jobs: -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ .. cmake --build . - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-ppc64le-musl-linux + path: build/ + + test-ppc64le-musl-linux: + runs-on: ubuntu-latest + needs: build-ppc64le-musl-linux + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc64le + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-ppc64le-musl-linux + path: build/ + - name: Run Tests run: | cd build ctest --output-on-failure diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 59b4806..91a3550 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -3,14 +3,18 @@ name: riscv64-musl-linux on: [push, pull_request] jobs: - build-and-test: + setup-riscv64-musl-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: riscv64 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + + build-riscv64-musl-linux: + runs-on: ubuntu-latest + needs: setup-riscv64-musl-linux + steps: + - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - name: Download musl.cc cross-compiler @@ -20,7 +24,7 @@ jobs: wget -q https://musl.cc/riscv64-linux-musl-cross.tgz tar xzf riscv64-linux-musl-cross.tgz rm riscv64-linux-musl-cross.tgz - - name: Build + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=riscv64-unknown-linux-gnu \ @@ -29,7 +33,27 @@ jobs: -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ .. cmake --build . - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-riscv64-musl-linux + path: build/ + + test-riscv64-musl-linux: + runs-on: ubuntu-latest + needs: build-riscv64-musl-linux + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-riscv64-musl-linux + path: build/ + - name: Run Tests run: | cd build ctest --output-on-failure diff --git a/.github/workflows/riscv64-unknown-linux-gnu.yml b/.github/workflows/riscv64-unknown-linux-gnu.yml index 53e9ee0..9092460 100644 --- a/.github/workflows/riscv64-unknown-linux-gnu.yml +++ b/.github/workflows/riscv64-unknown-linux-gnu.yml @@ -1,14 +1,23 @@ name: riscv64-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-riscv64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . + + build-riscv64-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-riscv64-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64 \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-riscv64-unknown-linux-gnu + path: build/ + + test-riscv64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-riscv64-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-riscv64-unknown-linux-gnu + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/s390x-ibm-linux-gnu.yml b/.github/workflows/s390x-ibm-linux-gnu.yml index 8db7d44..ca89728 100644 --- a/.github/workflows/s390x-ibm-linux-gnu.yml +++ b/.github/workflows/s390x-ibm-linux-gnu.yml @@ -1,16 +1,27 @@ name: s390x-ibm-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-s390x-ibm-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential gcc-s390x-linux-gnu qemu-user + + build-s390x-ibm-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-s390x-ibm-linux-gnu steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y cmake build-essential gcc-s390x-linux-gnu qemu-user - - name: Build and Test + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=s390x-ibm-linux-gnu \ @@ -20,4 +31,23 @@ jobs: -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x \ .. make + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-s390x-ibm-linux-gnu + path: build/ + + test-s390x-ibm-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-s390x-ibm-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-s390x-ibm-linux-gnu + path: build/ + - name: Run Tests + run: | + cd build CTEST_OUTPUT_ON_FAILURE=1 ctest diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 92edc48..43cc9db 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -3,14 +3,18 @@ name: s390x-musl-linux on: [push, pull_request] jobs: - build-and-test: + setup-s390x-musl-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: s390x + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + + build-s390x-musl-linux: + runs-on: ubuntu-latest + needs: setup-s390x-musl-linux + steps: + - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - name: Download musl.cc cross-compiler @@ -20,7 +24,7 @@ jobs: wget -q https://musl.cc/s390x-linux-musl-cross.tgz tar xzf s390x-linux-musl-cross.tgz rm s390x-linux-musl-cross.tgz - - name: Build + - name: Configure and Build run: | mkdir -p build && cd build cmake -DTARGET=s390x-ibm-linux-gnu \ @@ -29,7 +33,27 @@ jobs: -DCMAKE_SYSTEM_PROCESSOR=s390x \ .. cmake --build . - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-s390x-musl-linux + path: build/ + + test-s390x-musl-linux: + runs-on: ubuntu-latest + needs: build-s390x-musl-linux + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: s390x + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-s390x-musl-linux + path: build/ + - name: Run Tests run: | cd build ctest --output-on-failure diff --git a/.github/workflows/sparc64-unknown-linux-gnu.yml b/.github/workflows/sparc64-unknown-linux-gnu.yml index 1af7fe2..0a41243 100644 --- a/.github/workflows/sparc64-unknown-linux-gnu.yml +++ b/.github/workflows/sparc64-unknown-linux-gnu.yml @@ -1,14 +1,23 @@ name: sparc64-unknown-linux-gnu + on: [push, pull_request] jobs: - build-and-test: + setup-sparc64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . + + build-sparc64-unknown-linux-gnu: runs-on: ubuntu-24.04 + needs: setup-sparc64-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . - - name: Build and Test + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,26 @@ jobs: -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-sparc64 \ .. && \ - make && \ - CTEST_OUTPUT_ON_FAILURE=1 ctest" + make" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-sparc64-unknown-linux-gnu + path: build/ + + test-sparc64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + needs: build-sparc64-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-sparc64-unknown-linux-gnu + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml index 2ca2c2b..58ae151 100644 --- a/.github/workflows/x86_64-alpine-linux.yml +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -3,13 +3,21 @@ name: x86_64-alpine-linux on: [push, pull_request] jobs: - build-and-test: + setup-x86_64-alpine-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . - - name: Build and Test + + build-x86_64-alpine-linux: + runs-on: ubuntu-latest + needs: setup-x86_64-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . + - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -17,5 +25,26 @@ jobs: -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ - cmake --build . && \ - ctest --output-on-failure" + cmake --build ." + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-x86_64-alpine-linux + path: build/ + + test-x86_64-alpine-linux: + runs-on: ubuntu-latest + needs: build-x86_64-alpine-linux + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-x86_64-alpine-linux + path: build/ + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . + - name: Run Tests + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + bash -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/x86_64-pc-windows-gnu.yml b/.github/workflows/x86_64-pc-windows-gnu.yml index 29d552e..b173a33 100644 --- a/.github/workflows/x86_64-pc-windows-gnu.yml +++ b/.github/workflows/x86_64-pc-windows-gnu.yml @@ -3,8 +3,20 @@ name: x86_64-pc-windows-gnu on: [push, pull_request] jobs: - build-and-test: + setup-x86_64-pc-windows-gnu: runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake + + build-x86_64-pc-windows-gnu: + runs-on: windows-latest + needs: setup-x86_64-pc-windows-gnu steps: - uses: actions/checkout@v4 - name: Setup MinGW @@ -21,6 +33,22 @@ jobs: - name: Build shell: msys2 {0} run: cmake --build build --parallel 4 - - name: Test + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-x86_64-pc-windows-gnu + path: build/ + + test-x86_64-pc-windows-gnu: + runs-on: windows-latest + needs: build-x86_64-pc-windows-gnu + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-x86_64-pc-windows-gnu + path: build/ + - name: Run Tests shell: msys2 {0} run: cd build && ctest --output-on-failure diff --git a/.github/workflows/x86_64-unknown-linux-android.yml b/.github/workflows/x86_64-unknown-linux-android.yml index 765080c..8ce2416 100644 --- a/.github/workflows/x86_64-unknown-linux-android.yml +++ b/.github/workflows/x86_64-unknown-linux-android.yml @@ -3,13 +3,11 @@ name: x86_64-unknown-linux-android on: [push, pull_request] jobs: - build-and-test: - name: Android Emulator (x86_64) + setup-x86_64-unknown-linux-android: + name: Setup Android (x86_64) runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Create Test Runner Script run: | echo '#!/bin/bash' > run_android.sh @@ -19,6 +17,20 @@ jobs: echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh chmod +x run_android.sh + build-x86_64-unknown-linux-android: + name: Build Android (x86_64) + runs-on: ubuntu-latest + needs: setup-x86_64-unknown-linux-android + steps: + - uses: actions/checkout@v4 + - name: Create Test Runner Script + run: | + echo '#!/bin/bash' > run_android.sh + echo 'EXE_NAME=$(basename "$1")' >> run_android.sh + echo 'adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null' >> run_android.sh + echo 'shift' >> run_android.sh + echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh + chmod +x run_android.sh - name: Configure CMake run: | cmake \ @@ -28,10 +40,33 @@ jobs: -DANDROID_PLATFORM=android-29 \ -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/run_android.sh \ -B build - - name: Build run: cmake --build build --config Debug + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-x86_64-unknown-linux-android + path: build/ + test-x86_64-unknown-linux-android: + name: Test Android Emulator (x86_64) + runs-on: ubuntu-latest + needs: build-x86_64-unknown-linux-android + steps: + - uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-x86_64-unknown-linux-android + path: build/ + - name: Create Test Runner Script + run: | + echo '#!/bin/bash' > run_android.sh + echo 'EXE_NAME=$(basename "$1")' >> run_android.sh + echo 'adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null' >> run_android.sh + echo 'shift' >> run_android.sh + echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh + chmod +x run_android.sh - name: Run Tests on Emulator uses: reactivecircus/android-emulator-runner@v2 with: From bf30a86c59bb1150cb43656aa2e2639744e7963a Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 10:05:40 -0800 Subject: [PATCH 15/33] Make sure that all workflows that really exist are referenced in the release process. --- .github/workflows/release.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d53e3e..fae563e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,13 @@ on: - sparc64-unknown-linux-gnu - powerpc-unknown-linux-gnu - i386-unknown-linux-gnu + - x86_64-alpine-linux + - i386-alpine-linux + - aarch64-alpine-linux + - armv7-musl-linux + - ppc64le-musl-linux + - s390x-musl-linux + - riscv64-musl-linux types: - completed branches: @@ -61,7 +68,14 @@ jobs: "s390x-ibm-linux-gnu", "sparc64-unknown-linux-gnu", "powerpc-unknown-linux-gnu", - "i386-unknown-linux-gnu" + "i386-unknown-linux-gnu", + "x86_64-alpine-linux", + "i386-alpine-linux", + "aarch64-alpine-linux", + "armv7-musl-linux", + "ppc64le-musl-linux", + "s390x-musl-linux", + "riscv64-musl-linux" ]; const commit_sha = context.payload.workflow_run.head_sha; From 54c94079d0c531387f72f5fa537434fe015be766 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 10:12:57 -0800 Subject: [PATCH 16/33] Alpine containers do not have bash. --- .github/workflows/aarch64-alpine-linux.yml | 4 ++-- .github/workflows/i386-alpine-linux.yml | 4 ++-- .github/workflows/x86_64-alpine-linux.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml index a7ae140..5af4db6 100644 --- a/.github/workflows/aarch64-alpine-linux.yml +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -20,7 +20,7 @@ jobs: - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ + sh -c "mkdir -p build && cd build && \ cmake -DTARGET=aarch64-unknown-linux-musl \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ @@ -47,4 +47,4 @@ jobs: - name: Run Tests run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && ctest --output-on-failure" + sh -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml index 894d35a..d90b533 100644 --- a/.github/workflows/i386-alpine-linux.yml +++ b/.github/workflows/i386-alpine-linux.yml @@ -20,7 +20,7 @@ jobs: - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ + sh -c "mkdir -p build && cd build && \ cmake -DTARGET=i386-pc-linux-musl \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_C_FLAGS='-m32' \ @@ -48,4 +48,4 @@ jobs: - name: Run Tests run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && ctest --output-on-failure" + sh -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml index 58ae151..f07ffa7 100644 --- a/.github/workflows/x86_64-alpine-linux.yml +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -20,7 +20,7 @@ jobs: - name: Build run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ + sh -c "mkdir -p build && cd build && \ cmake -DTARGET=x86_64-pc-linux-musl \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ @@ -47,4 +47,4 @@ jobs: - name: Run Tests run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && ctest --output-on-failure" + sh -c "cd build && ctest --output-on-failure" From cb8f88cc0544f47f3d4328a2244d72ae8a784b08 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 10:16:56 -0800 Subject: [PATCH 17/33] Need to build statically because we do not have architecture-specific musl versions on the hosts. --- .github/workflows/armv7-musl-linux.yml | 1 + .github/workflows/ppc64le-musl-linux.yml | 1 + .github/workflows/riscv64-musl-linux.yml | 1 + .github/workflows/s390x-musl-linux.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index aa7e603..0334506 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -29,6 +29,7 @@ jobs: mkdir -p build && cd build cmake -DTARGET=arm-unknown-linux-gnueabihf \ -DCMAKE_C_COMPILER=/opt/cross/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc \ + -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=arm \ .. diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index 305a06e..c1b132c 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -29,6 +29,7 @@ jobs: mkdir -p build && cd build cmake -DTARGET=powerpc64le-unknown-linux-gnu \ -DCMAKE_C_COMPILER=/opt/cross/powerpc64le-linux-musl-cross/bin/powerpc64le-linux-musl-gcc \ + -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ .. diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 91a3550..0e9fc7c 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -29,6 +29,7 @@ jobs: mkdir -p build && cd build cmake -DTARGET=riscv64-unknown-linux-gnu \ -DCMAKE_C_COMPILER=/opt/cross/riscv64-linux-musl-cross/bin/riscv64-linux-musl-gcc \ + -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ .. diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 43cc9db..c780356 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -29,6 +29,7 @@ jobs: mkdir -p build && cd build cmake -DTARGET=s390x-ibm-linux-gnu \ -DCMAKE_C_COMPILER=/opt/cross/s390x-linux-musl-cross/bin/s390x-linux-musl-gcc \ + -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=s390x \ .. From 77eea1ba2702ad964c4807038286910b4054357b Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 11:45:45 -0800 Subject: [PATCH 18/33] Downloading artifacts removes permissions. So we need to chmod them to be executable. --- .github/workflows/armv7-musl-linux.yml | 2 ++ .github/workflows/i386-unknown-linux-gnu.yml | 2 ++ .github/workflows/ppc64le-musl-linux.yml | 2 ++ .github/workflows/riscv64-musl-linux.yml | 2 ++ .github/workflows/s390x-ibm-linux-gnu.yml | 2 ++ .github/workflows/s390x-musl-linux.yml | 2 ++ 6 files changed, 12 insertions(+) diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index 0334506..951fbe6 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -54,6 +54,8 @@ jobs: with: name: build-armv7-musl-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build diff --git a/.github/workflows/i386-unknown-linux-gnu.yml b/.github/workflows/i386-unknown-linux-gnu.yml index 5d88a1b..14068eb 100644 --- a/.github/workflows/i386-unknown-linux-gnu.yml +++ b/.github/workflows/i386-unknown-linux-gnu.yml @@ -45,6 +45,8 @@ jobs: with: name: build-i386-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index c1b132c..47664c9 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -54,6 +54,8 @@ jobs: with: name: build-ppc64le-musl-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 0e9fc7c..5cab1d1 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -54,6 +54,8 @@ jobs: with: name: build-riscv64-musl-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build diff --git a/.github/workflows/s390x-ibm-linux-gnu.yml b/.github/workflows/s390x-ibm-linux-gnu.yml index ca89728..8ad3cda 100644 --- a/.github/workflows/s390x-ibm-linux-gnu.yml +++ b/.github/workflows/s390x-ibm-linux-gnu.yml @@ -47,6 +47,8 @@ jobs: with: name: build-s390x-ibm-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index c780356..88dfb51 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -54,6 +54,8 @@ jobs: with: name: build-s390x-musl-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Run Tests run: | cd build From b4db4b14707a19a992b6b8b91fb887a4a2c23675 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 15:07:37 -0800 Subject: [PATCH 19/33] Set up binfmt_misc. Fix execute permissions. --- .github/workflows/arm-unknown-linux-gnueabihf.yml | 6 ++++++ .github/workflows/mips64el-unknown-linux-gnuabi64.yml | 6 ++++++ .github/workflows/mipsel-unknown-linux-gnu.yml | 6 ++++++ .github/workflows/powerpc-unknown-linux-gnu.yml | 6 ++++++ .github/workflows/powerpc64le-unknown-linux-gnu.yml | 6 ++++++ .github/workflows/riscv64-unknown-linux-gnu.yml | 6 ++++++ .github/workflows/sparc64-unknown-linux-gnu.yml | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/.github/workflows/arm-unknown-linux-gnueabihf.yml b/.github/workflows/arm-unknown-linux-gnueabihf.yml index 6398c2c..de3491e 100644 --- a/.github/workflows/arm-unknown-linux-gnueabihf.yml +++ b/.github/workflows/arm-unknown-linux-gnueabihf.yml @@ -39,11 +39,17 @@ jobs: needs: build-arm-unknown-linux-gnueabihf steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-arm-unknown-linux-gnueabihf path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . - name: Run Tests diff --git a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml index fbc5267..e95e75f 100644 --- a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml +++ b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml @@ -39,11 +39,17 @@ jobs: needs: build-mips64el-unknown-linux-gnuabi64 steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: mips64el - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-mips64el-unknown-linux-gnuabi64 path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - name: Run Tests diff --git a/.github/workflows/mipsel-unknown-linux-gnu.yml b/.github/workflows/mipsel-unknown-linux-gnu.yml index d44082a..d0ecfe2 100644 --- a/.github/workflows/mipsel-unknown-linux-gnu.yml +++ b/.github/workflows/mipsel-unknown-linux-gnu.yml @@ -39,11 +39,17 @@ jobs: needs: build-mipsel-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: mipsel - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-mipsel-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - name: Run Tests diff --git a/.github/workflows/powerpc-unknown-linux-gnu.yml b/.github/workflows/powerpc-unknown-linux-gnu.yml index c0a4fe3..d791e14 100644 --- a/.github/workflows/powerpc-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc-unknown-linux-gnu.yml @@ -39,11 +39,17 @@ jobs: needs: build-powerpc-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-powerpc-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - name: Run Tests diff --git a/.github/workflows/powerpc64le-unknown-linux-gnu.yml b/.github/workflows/powerpc64le-unknown-linux-gnu.yml index 8f9afb5..b43d5d6 100644 --- a/.github/workflows/powerpc64le-unknown-linux-gnu.yml +++ b/.github/workflows/powerpc64le-unknown-linux-gnu.yml @@ -39,11 +39,17 @@ jobs: needs: build-powerpc64le-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc64le - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-powerpc64le-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - name: Run Tests diff --git a/.github/workflows/riscv64-unknown-linux-gnu.yml b/.github/workflows/riscv64-unknown-linux-gnu.yml index 9092460..88e857a 100644 --- a/.github/workflows/riscv64-unknown-linux-gnu.yml +++ b/.github/workflows/riscv64-unknown-linux-gnu.yml @@ -39,11 +39,17 @@ jobs: needs: build-riscv64-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-riscv64-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . - name: Run Tests diff --git a/.github/workflows/sparc64-unknown-linux-gnu.yml b/.github/workflows/sparc64-unknown-linux-gnu.yml index 0a41243..0b3e7a7 100644 --- a/.github/workflows/sparc64-unknown-linux-gnu.yml +++ b/.github/workflows/sparc64-unknown-linux-gnu.yml @@ -39,11 +39,17 @@ jobs: needs: build-sparc64-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: sparc64 - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-sparc64-unknown-linux-gnu path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . - name: Run Tests From 5ca0b8cd17d6a63f2e13c93b37cf63d3ed06a8ea Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 15:13:17 -0800 Subject: [PATCH 20/33] No i386 dev libs in Alpine AMD64. --- .github/workflows/aarch64-alpine-linux.yml | 2 ++ .github/workflows/i386-alpine-linux.yml | 7 ++++++- .github/workflows/x86_64-alpine-linux.yml | 2 ++ docker/Dockerfile.alpine-aarch64 | 2 +- docker/Dockerfile.alpine-i386 | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml index 5af4db6..e35f7f0 100644 --- a/.github/workflows/aarch64-alpine-linux.yml +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -42,6 +42,8 @@ jobs: with: name: build-aarch64-alpine-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . - name: Run Tests diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml index d90b533..7bf1c70 100644 --- a/.github/workflows/i386-alpine-linux.yml +++ b/.github/workflows/i386-alpine-linux.yml @@ -23,7 +23,6 @@ jobs: sh -c "mkdir -p build && cd build && \ cmake -DTARGET=i386-pc-linux-musl \ -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_C_FLAGS='-m32' \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ cmake --build ." @@ -38,11 +37,17 @@ jobs: needs: build-i386-alpine-linux steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: i386 - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-i386-alpine-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . - name: Run Tests diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml index f07ffa7..b94b446 100644 --- a/.github/workflows/x86_64-alpine-linux.yml +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -42,6 +42,8 @@ jobs: with: name: build-x86_64-alpine-linux path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . - name: Run Tests diff --git a/docker/Dockerfile.alpine-aarch64 b/docker/Dockerfile.alpine-aarch64 index fd58ff5..25b9273 100644 --- a/docker/Dockerfile.alpine-aarch64 +++ b/docker/Dockerfile.alpine-aarch64 @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM aarch64/alpine:latest # Configure apk with retry logic for transient network failures RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf diff --git a/docker/Dockerfile.alpine-i386 b/docker/Dockerfile.alpine-i386 index fd58ff5..3ea6376 100644 --- a/docker/Dockerfile.alpine-i386 +++ b/docker/Dockerfile.alpine-i386 @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM i386/alpine:latest # Configure apk with retry logic for transient network failures RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf From aff8f1edcd0da8458c5b6a64d7a12783a48aa998 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 15:17:02 -0800 Subject: [PATCH 21/33] Add retry loops and more logging. We seem to be having problems getting downloads to work. --- .github/workflows/armv7-musl-linux.yml | 20 +++++++++++++++++--- .github/workflows/ppc64le-musl-linux.yml | 20 +++++++++++++++++--- .github/workflows/riscv64-musl-linux.yml | 20 +++++++++++++++++--- .github/workflows/s390x-musl-linux.yml | 20 +++++++++++++++++--- 4 files changed, 68 insertions(+), 12 deletions(-) diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index 951fbe6..ac2957e 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -21,9 +21,23 @@ jobs: run: | mkdir -p /opt/cross cd /opt/cross - wget -q https://musl.cc/arm-linux-musleabihf-cross.tgz - tar xzf arm-linux-musleabihf-cross.tgz - rm arm-linux-musleabihf-cross.tgz + for attempt in 1 2 3; do + echo "Attempt $attempt/3: Downloading arm-linux-musleabihf-cross.tgz..." + if wget -O arm-linux-musleabihf-cross.tgz https://musl.cc/arm-linux-musleabihf-cross.tgz; then + tar xzf arm-linux-musleabihf-cross.tgz + rm arm-linux-musleabihf-cross.tgz + echo "Download successful" + exit 0 + else + echo "Download attempt $attempt failed" + if [ $attempt -lt 3 ]; then + echo "Waiting 15 seconds before retry..." + sleep 15 + fi + fi + done + echo "All 3 download attempts failed" + exit 1 - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index 47664c9..ede4c83 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -21,9 +21,23 @@ jobs: run: | mkdir -p /opt/cross cd /opt/cross - wget -q https://musl.cc/powerpc64le-linux-musl-cross.tgz - tar xzf powerpc64le-linux-musl-cross.tgz - rm powerpc64le-linux-musl-cross.tgz + for attempt in 1 2 3; do + echo "Attempt $attempt/3: Downloading powerpc64le-linux-musl-cross.tgz..." + if wget -O powerpc64le-linux-musl-cross.tgz https://musl.cc/powerpc64le-linux-musl-cross.tgz; then + tar xzf powerpc64le-linux-musl-cross.tgz + rm powerpc64le-linux-musl-cross.tgz + echo "Download successful" + exit 0 + else + echo "Download attempt $attempt failed" + if [ $attempt -lt 3 ]; then + echo "Waiting 15 seconds before retry..." + sleep 15 + fi + fi + done + echo "All 3 download attempts failed" + exit 1 - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 5cab1d1..95cc090 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -21,9 +21,23 @@ jobs: run: | mkdir -p /opt/cross cd /opt/cross - wget -q https://musl.cc/riscv64-linux-musl-cross.tgz - tar xzf riscv64-linux-musl-cross.tgz - rm riscv64-linux-musl-cross.tgz + for attempt in 1 2 3; do + echo "Attempt $attempt/3: Downloading riscv64-linux-musl-cross.tgz..." + if wget -O riscv64-linux-musl-cross.tgz https://musl.cc/riscv64-linux-musl-cross.tgz; then + tar xzf riscv64-linux-musl-cross.tgz + rm riscv64-linux-musl-cross.tgz + echo "Download successful" + exit 0 + else + echo "Download attempt $attempt failed" + if [ $attempt -lt 3 ]; then + echo "Waiting 15 seconds before retry..." + sleep 15 + fi + fi + done + echo "All 3 download attempts failed" + exit 1 - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 88dfb51..b196de8 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -21,9 +21,23 @@ jobs: run: | mkdir -p /opt/cross cd /opt/cross - wget -q https://musl.cc/s390x-linux-musl-cross.tgz - tar xzf s390x-linux-musl-cross.tgz - rm s390x-linux-musl-cross.tgz + for attempt in 1 2 3; do + echo "Attempt $attempt/3: Downloading s390x-linux-musl-cross.tgz..." + if wget -O s390x-linux-musl-cross.tgz https://musl.cc/s390x-linux-musl-cross.tgz; then + tar xzf s390x-linux-musl-cross.tgz + rm s390x-linux-musl-cross.tgz + echo "Download successful" + exit 0 + else + echo "Download attempt $attempt failed" + if [ $attempt -lt 3 ]; then + echo "Waiting 15 seconds before retry..." + sleep 15 + fi + fi + done + echo "All 3 download attempts failed" + exit 1 - name: Configure and Build run: | mkdir -p build && cd build From a62fc2bf054ae473ddab6934f97813f35f62adc4 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sat, 31 Jan 2026 15:24:43 -0800 Subject: [PATCH 22/33] Qemu was not installed correctly. I think. --- .github/workflows/armv7-musl-linux.yml | 6 ++---- .github/workflows/ppc64le-musl-linux.yml | 6 ++---- .github/workflows/riscv64-musl-linux.yml | 6 ++---- .github/workflows/s390x-musl-linux.yml | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index ac2957e..e37a4e8 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -59,10 +59,8 @@ jobs: needs: build-armv7-musl-linux steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - name: Download build artifacts uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index ede4c83..e8ad72b 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -59,10 +59,8 @@ jobs: needs: build-ppc64le-musl-linux steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ppc64le + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - name: Download build artifacts uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 95cc090..5d09d34 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -59,10 +59,8 @@ jobs: needs: build-riscv64-musl-linux steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: riscv64 + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - name: Download build artifacts uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index b196de8..398d274 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -59,10 +59,8 @@ jobs: needs: build-s390x-musl-linux steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: s390x + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - name: Download build artifacts uses: actions/download-artifact@v4 with: From 80b65fd770ff7e18584d7b46c07a02fceb22a3ef Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 08:05:02 -0800 Subject: [PATCH 23/33] Some triples were not correct. --- .github/workflows/aarch64-alpine-linux.yml | 2 +- .github/workflows/i386-alpine-linux.yml | 2 +- .github/workflows/x86_64-alpine-linux.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml index e35f7f0..b453351 100644 --- a/.github/workflows/aarch64-alpine-linux.yml +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -21,7 +21,7 @@ jobs: run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=aarch64-unknown-linux-musl \ + cmake -DTARGET=aarch64-pc-linux-gnu \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml index 7bf1c70..b53d816 100644 --- a/.github/workflows/i386-alpine-linux.yml +++ b/.github/workflows/i386-alpine-linux.yml @@ -21,7 +21,7 @@ jobs: run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=i386-pc-linux-musl \ + cmake -DTARGET=i386-unknown-linux-gnu \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml index b94b446..6070179 100644 --- a/.github/workflows/x86_64-alpine-linux.yml +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -21,7 +21,7 @@ jobs: run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=x86_64-pc-linux-musl \ + cmake -DTARGET=x86_64-pc-linux-gnu \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_SYSTEM_NAME=Linux \ .. && \ From 9209cae0c8b2f0785201930850f421bfac298402 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 08:38:41 -0800 Subject: [PATCH 24/33] Add musl.cc cross-compiler toolchains --- .gitattributes | 3 + cross-compilers/.gitkeep | 0 cross-compilers/README.md | 82 +++++++++++++++++++ .../arm-linux-musleabihf-cross.tgz | 3 + .../powerpc64le-linux-musl-cross.tgz | 3 + cross-compilers/riscv64-linux-musl-cross.tgz | 3 + cross-compilers/s390x-linux-musl-cross.tgz | 3 + 7 files changed, 97 insertions(+) create mode 100644 .gitattributes create mode 100644 cross-compilers/.gitkeep create mode 100644 cross-compilers/README.md create mode 100644 cross-compilers/arm-linux-musleabihf-cross.tgz create mode 100644 cross-compilers/powerpc64le-linux-musl-cross.tgz create mode 100644 cross-compilers/riscv64-linux-musl-cross.tgz create mode 100644 cross-compilers/s390x-linux-musl-cross.tgz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ed5ac80 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Git LFS configuration for large binary files +# Cross-compiler toolchains (stored with Git LFS) +cross-compilers/*.tgz filter=lfs diff=lfs merge=lfs -text diff --git a/cross-compilers/.gitkeep b/cross-compilers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cross-compilers/README.md b/cross-compilers/README.md new file mode 100644 index 0000000..d04785e --- /dev/null +++ b/cross-compilers/README.md @@ -0,0 +1,82 @@ +# Cross-Compiler Toolchains + +This directory contains pre-built cross-compiler toolchains from [musl.cc](https://musl.cc/). + +## Files + +These files are stored with Git LFS (Large File Storage) and are downloaded via GitHub Actions CI/CD: + +- `arm-linux-musleabihf-cross.tgz` - ARM 32-bit (ARMv7) EABI Hard Float +- `riscv64-linux-musl-cross.tgz` - RISC-V 64-bit +- `s390x-linux-musl-cross.tgz` - IBM System z (s390x) +- `powerpc64le-linux-musl-cross.tgz` - PowerPC 64-bit Little Endian + +## Downloading Toolchains Locally + +To download these toolchains to your local machine: + +1. **Install Git LFS** (if not already installed): + ```bash + # macOS + brew install git-lfs + + # Ubuntu/Debian + sudo apt-get install git-lfs + + # Other systems: https://git-lfs.com/ + ``` + +2. **Initialize Git LFS in this repository** (one-time setup): + ```bash + git lfs install + ``` + +3. **Run the download script**: + ```bash + ./scripts/download-musl-cc.sh + ``` + + This script will: + - Create this directory if it doesn't exist + - Download all four cross-compiler toolchains + - Retry up to 3 times if downloads fail + - Store them for Git LFS tracking + +4. **Commit and push to GitHub**: + ```bash + git add cross-compilers/ .gitattributes + git commit -m "Add musl.cc cross-compiler toolchains" + git push + ``` + +## Git LFS Tracking + +These files are tracked with Git LFS, which means: + +- Git stores pointers to the actual files instead of the full archives +- The repository size remains small +- When you clone or pull, Git LFS downloads only the files you need +- Bandwidth usage is optimized for large binary files + +To verify Git LFS is working correctly, check the `.gitattributes` file to see which patterns are tracked. + +## Why These Toolchains? + +The musl.cc project provides pre-built, statically-linked cross-compiler toolchains. They're: +- Ready to use without system dependencies +- Statically compiled (portable across Linux distributions) +- Designed for cross-compilation to various architectures +- Updated regularly with latest compiler versions + +## Updates + +To update these toolchains to newer versions in the future: + +1. Run the download script again: `./scripts/download-musl-cc.sh` +2. Git will detect changes if new versions are available +3. Commit and push the updated files + +## References + +- [musl.cc](https://musl.cc/) - Pre-built musl libc cross-compiler toolchains +- [Git LFS Documentation](https://git-lfs.com/) diff --git a/cross-compilers/arm-linux-musleabihf-cross.tgz b/cross-compilers/arm-linux-musleabihf-cross.tgz new file mode 100644 index 0000000..b8d0a32 --- /dev/null +++ b/cross-compilers/arm-linux-musleabihf-cross.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11e155a090789c854afb5d91e57c81f441ccdb92f7f277789c3a6d5884a68e58 +size 102391022 diff --git a/cross-compilers/powerpc64le-linux-musl-cross.tgz b/cross-compilers/powerpc64le-linux-musl-cross.tgz new file mode 100644 index 0000000..eb95e8b --- /dev/null +++ b/cross-compilers/powerpc64le-linux-musl-cross.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:688dea3950d9139c761b6d68053b35101308da37f950bbb0abe1d53a0cc1717d +size 107101732 diff --git a/cross-compilers/riscv64-linux-musl-cross.tgz b/cross-compilers/riscv64-linux-musl-cross.tgz new file mode 100644 index 0000000..fc5065f --- /dev/null +++ b/cross-compilers/riscv64-linux-musl-cross.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db0bc413bd4a93f2012cc74b9ba0c4af29d8bc18b88e9c61998738ccb918604b +size 108069067 diff --git a/cross-compilers/s390x-linux-musl-cross.tgz b/cross-compilers/s390x-linux-musl-cross.tgz new file mode 100644 index 0000000..c9d3eab --- /dev/null +++ b/cross-compilers/s390x-linux-musl-cross.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d21e0eda59c25d9ef4b7f477f773aa928fe38b2b6f28ee643c52d33a1597e838 +size 100597838 From 3e83bfd777140e6ac2b11979736a9d1caa34f9c7 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 08:41:32 -0800 Subject: [PATCH 25/33] musl.cc blocks GitHub Actions due to abuse. Cache the toolchains in the repo itself. --- .github/workflows/armv7-musl-linux.yml | 21 +---- .github/workflows/ppc64le-musl-linux.yml | 21 +---- .github/workflows/riscv64-musl-linux.yml | 21 +---- .github/workflows/s390x-musl-linux.yml | 21 +---- scripts/download-musl-cc.sh | 101 +++++++++++++++++++++++ 5 files changed, 113 insertions(+), 72 deletions(-) create mode 100755 scripts/download-musl-cc.sh diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index e37a4e8..e886a1f 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -17,27 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Download musl.cc cross-compiler + - name: Extract musl.cc cross-compiler run: | mkdir -p /opt/cross cd /opt/cross - for attempt in 1 2 3; do - echo "Attempt $attempt/3: Downloading arm-linux-musleabihf-cross.tgz..." - if wget -O arm-linux-musleabihf-cross.tgz https://musl.cc/arm-linux-musleabihf-cross.tgz; then - tar xzf arm-linux-musleabihf-cross.tgz - rm arm-linux-musleabihf-cross.tgz - echo "Download successful" - exit 0 - else - echo "Download attempt $attempt failed" - if [ $attempt -lt 3 ]; then - echo "Waiting 15 seconds before retry..." - sleep 15 - fi - fi - done - echo "All 3 download attempts failed" - exit 1 + tar xzf ${{ github.workspace }}/cross-compilers/arm-linux-musleabihf-cross.tgz + echo "Cross-compiler extracted successfully" - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index e8ad72b..09f68c6 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -17,27 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Download musl.cc cross-compiler + - name: Extract musl.cc cross-compiler run: | mkdir -p /opt/cross cd /opt/cross - for attempt in 1 2 3; do - echo "Attempt $attempt/3: Downloading powerpc64le-linux-musl-cross.tgz..." - if wget -O powerpc64le-linux-musl-cross.tgz https://musl.cc/powerpc64le-linux-musl-cross.tgz; then - tar xzf powerpc64le-linux-musl-cross.tgz - rm powerpc64le-linux-musl-cross.tgz - echo "Download successful" - exit 0 - else - echo "Download attempt $attempt failed" - if [ $attempt -lt 3 ]; then - echo "Waiting 15 seconds before retry..." - sleep 15 - fi - fi - done - echo "All 3 download attempts failed" - exit 1 + tar xzf ${{ github.workspace }}/cross-compilers/powerpc64le-linux-musl-cross.tgz + echo "Cross-compiler extracted successfully" - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 5d09d34..3ac2181 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -17,27 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Download musl.cc cross-compiler + - name: Extract musl.cc cross-compiler run: | mkdir -p /opt/cross cd /opt/cross - for attempt in 1 2 3; do - echo "Attempt $attempt/3: Downloading riscv64-linux-musl-cross.tgz..." - if wget -O riscv64-linux-musl-cross.tgz https://musl.cc/riscv64-linux-musl-cross.tgz; then - tar xzf riscv64-linux-musl-cross.tgz - rm riscv64-linux-musl-cross.tgz - echo "Download successful" - exit 0 - else - echo "Download attempt $attempt failed" - if [ $attempt -lt 3 ]; then - echo "Waiting 15 seconds before retry..." - sleep 15 - fi - fi - done - echo "All 3 download attempts failed" - exit 1 + tar xzf ${{ github.workspace }}/cross-compilers/riscv64-linux-musl-cross.tgz + echo "Cross-compiler extracted successfully" - name: Configure and Build run: | mkdir -p build && cd build diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 398d274..22bc517 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -17,27 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Download musl.cc cross-compiler + - name: Extract musl.cc cross-compiler run: | mkdir -p /opt/cross cd /opt/cross - for attempt in 1 2 3; do - echo "Attempt $attempt/3: Downloading s390x-linux-musl-cross.tgz..." - if wget -O s390x-linux-musl-cross.tgz https://musl.cc/s390x-linux-musl-cross.tgz; then - tar xzf s390x-linux-musl-cross.tgz - rm s390x-linux-musl-cross.tgz - echo "Download successful" - exit 0 - else - echo "Download attempt $attempt failed" - if [ $attempt -lt 3 ]; then - echo "Waiting 15 seconds before retry..." - sleep 15 - fi - fi - done - echo "All 3 download attempts failed" - exit 1 + tar xzf ${{ github.workspace }}/cross-compilers/s390x-linux-musl-cross.tgz + echo "Cross-compiler extracted successfully" - name: Configure and Build run: | mkdir -p build && cd build diff --git a/scripts/download-musl-cc.sh b/scripts/download-musl-cc.sh new file mode 100755 index 0000000..4f0d18e --- /dev/null +++ b/scripts/download-musl-cc.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Download musl.cc cross-compiler toolchains +# +# This script downloads pre-built cross-compiler toolchains from musl.cc +# and stores them in the cross-compilers/ directory for Git LFS tracking. +# +# Usage: ./scripts/download-musl-cc.sh +# +# Before running this script, ensure Git LFS is installed: +# brew install git-lfs (macOS) +# apt-get install git-lfs (Ubuntu/Debian) +# choco install git-lfs (Windows) +# +# Then initialize Git LFS in this repository: +# git lfs install +# + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(dirname "$SCRIPT_DIR")" +CROSS_COMPILERS_DIR="$REPO_ROOT/cross-compilers" + +# Create cross-compilers directory if it doesn't exist +mkdir -p "$CROSS_COMPILERS_DIR" + +# Array of architectures to download +declare -a ARCHITECTURES=( + "arm-linux-musleabihf" + "riscv64-linux-musl" + "s390x-linux-musl" + "powerpc64le-linux-musl" +) + +# Colors for output +GREEN='\033[0;32m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +echo -e "${BLUE}Downloading musl.cc cross-compiler toolchains${NC}" +echo "Destination: $CROSS_COMPILERS_DIR" +echo "" + +# Check if Git LFS is configured +if ! git lfs version &>/dev/null; then + echo -e "${RED}Error: Git LFS is not installed${NC}" + echo "" + echo "Install Git LFS first:" + echo " macOS: brew install git-lfs" + echo " Linux: apt-get install git-lfs" + echo " Windows: choco install git-lfs" + echo "" + echo "Then initialize it in this repository:" + echo " git lfs install" + exit 1 +fi + +# Download each toolchain +for arch in "${ARCHITECTURES[@]}"; do + filename="${arch}-cross.tgz" + filepath="$CROSS_COMPILERS_DIR/$filename" + url="https://musl.cc/${filename}" + + # Skip if already exists + if [ -f "$filepath" ]; then + echo -e "${GREEN}✓${NC} $filename already exists, skipping" + continue + fi + + echo -e "${BLUE}Downloading${NC} $filename..." + + # Download with retries + for attempt in 1 2 3; do + if wget -O "$filepath" "$url"; then + echo -e "${GREEN}✓${NC} Downloaded: $filename" + break + else + if [ $attempt -lt 3 ]; then + echo " Attempt $attempt failed, retrying in 15 seconds..." + sleep 15 + else + echo -e "${RED}✗${NC} Failed to download $filename after 3 attempts" + rm -f "$filepath" + exit 1 + fi + fi + done +done + +echo "" +echo -e "${GREEN}All musl.cc cross-compilers downloaded successfully!${NC}" +echo "" +echo "Next steps:" +echo " 1. Add these files to Git LFS tracking:" +echo " git lfs track 'cross-compilers/*.tgz'" +echo " 2. Commit and push:" +echo " git add cross-compilers/ .gitattributes" +echo " git commit -m 'Add musl.cc cross-compiler toolchains'" +echo " git push" From 9b2980faa0803e333680d28060998ec2c36ad3d2 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 09:19:15 -0800 Subject: [PATCH 26/33] musl.cc does not allow downloads from GitHub Actions. But adding the tgz files is far too large for a default checkout of yafl. So we add downloading from a GitHub mirror to the CI process and script it so that it can be done by users on their own machines. --- .gitattributes | 12 ++ .github/workflows/armv7-musl-linux.yml | 14 +-- .github/workflows/ppc64le-musl-linux.yml | 14 +-- .github/workflows/riscv64-musl-linux.yml | 14 +-- .github/workflows/s390x-musl-linux.yml | 14 +-- .gitignore | 3 + CMakeLists.txt | 26 +++++ cross-compilers/README.md | 107 ++++++++---------- scripts/download-musl-cross.sh | 95 ++++++++++++++++ toolchains/arm-unknown-linux-musleabihf.cmake | 13 +++ .../powerpc64le-unknown-linux-musl.cmake | 13 +++ toolchains/riscv64-unknown-linux-musl.cmake | 13 +++ toolchains/s390x-ibm-linux-musl.cmake | 13 +++ 13 files changed, 256 insertions(+), 95 deletions(-) create mode 100755 scripts/download-musl-cross.sh create mode 100644 toolchains/arm-unknown-linux-musleabihf.cmake create mode 100644 toolchains/powerpc64le-unknown-linux-musl.cmake create mode 100644 toolchains/riscv64-unknown-linux-musl.cmake create mode 100644 toolchains/s390x-ibm-linux-musl.cmake diff --git a/.gitattributes b/.gitattributes index ed5ac80..c0058d3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,15 @@ # Git LFS configuration for large binary files +# +# These files are optional and only needed if you plan to run musl.cc-based +# cross-compilation workflows locally. Most developers can skip them: +# +# GIT_LFS_SKIP_SMUDGE=1 git clone +# # or +# git clone --no-lfs +# +# To pull these files later: +# git lfs pull +# + # Cross-compiler toolchains (stored with Git LFS) cross-compilers/*.tgz filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index e886a1f..dbfefd6 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -16,18 +16,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Extract musl.cc cross-compiler - run: | - mkdir -p /opt/cross - cd /opt/cross - tar xzf ${{ github.workspace }}/cross-compilers/arm-linux-musleabihf-cross.tgz - echo "Cross-compiler extracted successfully" + run: sudo apt-get update && sudo apt-get install -y cmake make wget + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf - name: Configure and Build run: | mkdir -p build && cd build - cmake -DTARGET=arm-unknown-linux-gnueabihf \ - -DCMAKE_C_COMPILER=/opt/cross/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc \ + cmake -DTARGET=arm-unknown-linux-musleabihf \ + -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/arm-unknown-linux-musleabihf/bin/arm-unknown-linux-musleabihf-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=arm \ diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index 09f68c6..56c7876 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -16,18 +16,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Extract musl.cc cross-compiler - run: | - mkdir -p /opt/cross - cd /opt/cross - tar xzf ${{ github.workspace }}/cross-compilers/powerpc64le-linux-musl-cross.tgz - echo "Cross-compiler extracted successfully" + run: sudo apt-get update && sudo apt-get install -y cmake make wget + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh powerpc64le-unknown-linux-musl - name: Configure and Build run: | mkdir -p build && cd build - cmake -DTARGET=powerpc64le-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=/opt/cross/powerpc64le-linux-musl-cross/bin/powerpc64le-linux-musl-gcc \ + cmake -DTARGET=powerpc64le-unknown-linux-musl \ + -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/powerpc64le-unknown-linux-musl/bin/powerpc64le-unknown-linux-musl-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 3ac2181..276d7f9 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -16,18 +16,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Extract musl.cc cross-compiler - run: | - mkdir -p /opt/cross - cd /opt/cross - tar xzf ${{ github.workspace }}/cross-compilers/riscv64-linux-musl-cross.tgz - echo "Cross-compiler extracted successfully" + run: sudo apt-get update && sudo apt-get install -y cmake make wget + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh riscv64-unknown-linux-musl - name: Configure and Build run: | mkdir -p build && cd build - cmake -DTARGET=riscv64-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=/opt/cross/riscv64-linux-musl-cross/bin/riscv64-linux-musl-gcc \ + cmake -DTARGET=riscv64-unknown-linux-musl \ + -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/riscv64-unknown-linux-musl/bin/riscv64-unknown-linux-musl-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 22bc517..3023ded 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -16,18 +16,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - name: Extract musl.cc cross-compiler - run: | - mkdir -p /opt/cross - cd /opt/cross - tar xzf ${{ github.workspace }}/cross-compilers/s390x-linux-musl-cross.tgz - echo "Cross-compiler extracted successfully" + run: sudo apt-get update && sudo apt-get install -y cmake make wget + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh s390x-ibm-linux-musl - name: Configure and Build run: | mkdir -p build && cd build - cmake -DTARGET=s390x-ibm-linux-gnu \ - -DCMAKE_C_COMPILER=/opt/cross/s390x-linux-musl-cross/bin/s390x-linux-musl-gcc \ + cmake -DTARGET=s390x-ibm-linux-musl \ + -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/s390x-ibm-linux-musl/bin/s390x-ibm-linux-musl-gcc \ -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=s390x \ diff --git a/.gitignore b/.gitignore index 9a711a9..96c1f40 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,7 @@ coverage.info __pycache__/ *.pyc +# Downloaded musl-cross toolchains (generated by scripts/download-musl-cross.sh) +/cross-compilers/x-tools/ + .claude \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f6d8797..f5df3d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,6 +143,32 @@ else() endif() message(STATUS "Loading configuration for triple: ${TRIPLE}") + +# Check if this is a musl target that requires cross-compiler binaries +string(REGEX MATCH "musl" IS_MUSL_TARGET "${TRIPLE}") + +if(IS_MUSL_TARGET) + # For musl targets, check if cross-compiler is available in the repo + set(MUSL_X_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cross-compilers/x-tools") + set(MUSL_TOOLCHAIN_DIR "${MUSL_X_TOOLS_DIR}/${TRIPLE}") + + if(NOT EXISTS "${MUSL_TOOLCHAIN_DIR}") + message(FATAL_ERROR + "Musl cross-compiler toolchain not found: ${MUSL_TOOLCHAIN_DIR}\n" + "\n" + "To enable musl-based cross-compilation, download and install the toolchain:\n" + " ./scripts/download-musl-cross.sh\n" + "\n" + "This will download pre-built toolchains from:\n" + " https://github.com/cross-tools/musl-cross/releases\n" + "\n" + "If you don't need musl cross-compilation, you can build without it:\n" + " cmake -DTARGET= ..\n" + ) + endif() + message(STATUS "Using musl cross-compiler from: ${MUSL_TOOLCHAIN_DIR}") +endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/toolchains/${TRIPLE}.cmake") include(toolchains/${TRIPLE}.cmake) else() diff --git a/cross-compilers/README.md b/cross-compilers/README.md index d04785e..c4e3c98 100644 --- a/cross-compilers/README.md +++ b/cross-compilers/README.md @@ -1,82 +1,71 @@ # Cross-Compiler Toolchains -This directory contains pre-built cross-compiler toolchains from [musl.cc](https://musl.cc/). +This directory contains downloaded musl-cross pre-built toolchains for cross-compilation support. -## Files +## Installation -These files are stored with Git LFS (Large File Storage) and are downloaded via GitHub Actions CI/CD: +The musl cross-compiler binaries are downloaded on-demand and stored in the `x-tools/` subdirectory. -- `arm-linux-musleabihf-cross.tgz` - ARM 32-bit (ARMv7) EABI Hard Float -- `riscv64-linux-musl-cross.tgz` - RISC-V 64-bit -- `s390x-linux-musl-cross.tgz` - IBM System z (s390x) -- `powerpc64le-linux-musl-cross.tgz` - PowerPC 64-bit Little Endian +To install the musl-cross toolchains locally: -## Downloading Toolchains Locally +```bash +./scripts/download-musl-cross.sh +``` -To download these toolchains to your local machine: +This will download all four supported architectures from the [cross-tools/musl-cross](https://github.com/cross-tools/musl-cross) GitHub releases. -1. **Install Git LFS** (if not already installed): - ```bash - # macOS - brew install git-lfs +To download a specific architecture only: - # Ubuntu/Debian - sudo apt-get install git-lfs +```bash +./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf +./scripts/download-musl-cross.sh riscv64-unknown-linux-musl +./scripts/download-musl-cross.sh s390x-ibm-linux-musl +./scripts/download-musl-cross.sh powerpc64le-unknown-linux-musl +``` - # Other systems: https://git-lfs.com/ - ``` +## Building with Musl -2. **Initialize Git LFS in this repository** (one-time setup): - ```bash - git lfs install - ``` +Once installed, you can build for musl targets: -3. **Run the download script**: - ```bash - ./scripts/download-musl-cc.sh - ``` +```bash +mkdir build && cd build +cmake -DTARGET=arm-unknown-linux-musleabihf .. +cmake --build . +``` - This script will: - - Create this directory if it doesn't exist - - Download all four cross-compiler toolchains - - Retry up to 3 times if downloads fail - - Store them for Git LFS tracking +## Supported Architectures -4. **Commit and push to GitHub**: - ```bash - git add cross-compilers/ .gitattributes - git commit -m "Add musl.cc cross-compiler toolchains" - git push - ``` +- **arm-unknown-linux-musleabihf** - ARM 32-bit (ARMv7) EABI Hard Float +- **riscv64-unknown-linux-musl** - RISC-V 64-bit +- **s390x-ibm-linux-musl** - IBM System z (s390x) +- **powerpc64le-unknown-linux-musl** - PowerPC 64-bit Little Endian -## Git LFS Tracking +## Directory Structure -These files are tracked with Git LFS, which means: +``` +cross-compilers/ +├── README.md (this file) +├── .gitkeep +└── x-tools/ + ├── arm-unknown-linux-musleabihf/ + ├── riscv64-unknown-linux-musl/ + ├── s390x-ibm-linux-musl/ + └── powerpc64le-unknown-linux-musl/ +``` -- Git stores pointers to the actual files instead of the full archives -- The repository size remains small -- When you clone or pull, Git LFS downloads only the files you need -- Bandwidth usage is optimized for large binary files +The `x-tools/` directory is generated by the download script and is not checked into Git. -To verify Git LFS is working correctly, check the `.gitattributes` file to see which patterns are tracked. +## Optional -## Why These Toolchains? +These toolchains are **optional**. If you don't need musl cross-compilation, you can build for your native platform without downloading them: -The musl.cc project provides pre-built, statically-linked cross-compiler toolchains. They're: -- Ready to use without system dependencies -- Statically compiled (portable across Linux distributions) -- Designed for cross-compilation to various architectures -- Updated regularly with latest compiler versions - -## Updates - -To update these toolchains to newer versions in the future: - -1. Run the download script again: `./scripts/download-musl-cc.sh` -2. Git will detect changes if new versions are available -3. Commit and push the updated files +```bash +mkdir build && cd build +cmake .. # Auto-detects your native platform +cmake --build . +``` ## References -- [musl.cc](https://musl.cc/) - Pre-built musl libc cross-compiler toolchains -- [Git LFS Documentation](https://git-lfs.com/) +- [cross-tools/musl-cross](https://github.com/cross-tools/musl-cross) - Pre-built musl libc cross-compiler toolchains +- [musl libc](https://musl.libc.org) - Standard C library for Linux diff --git a/scripts/download-musl-cross.sh b/scripts/download-musl-cross.sh new file mode 100755 index 0000000..ec9eda4 --- /dev/null +++ b/scripts/download-musl-cross.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# +# Download and install musl-cross pre-built toolchains +# +# This script downloads pre-built cross-compiler toolchains from the +# cross-tools/musl-cross GitHub releases and installs them to the +# cross-compilers/x-tools/ directory for use with CMake builds. +# +# Usage: ./scripts/download-musl-cross.sh [optional: specific architecture] +# ./scripts/download-musl-cross.sh # Download all +# ./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf # Download one +# + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(dirname "$SCRIPT_DIR")" +X_TOOLS_DIR="$REPO_ROOT/cross-compilers/x-tools" + +# musl-cross release version +RELEASE="20250929" + +# Array of architectures we need +declare -a ARCHITECTURES=( + "arm-unknown-linux-musleabihf" + "riscv64-unknown-linux-musl" + "s390x-ibm-linux-musl" + "powerpc64le-unknown-linux-musl" +) + +# Colors for output +GREEN='\033[0;32m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +echo -e "${BLUE}Downloading musl-cross toolchains${NC}" +echo "Release: ${RELEASE}" +echo "Destination: $X_TOOLS_DIR" +echo "" + +# Create x-tools directory if it doesn't exist +mkdir -p "$X_TOOLS_DIR" + +# If specific architecture requested, override the array +if [ $# -gt 0 ]; then + ARCHITECTURES=("$1") + echo "Downloading only: $1" + echo "" +fi + +# Download each toolchain +for arch in "${ARCHITECTURES[@]}"; do + filename="${arch}.tar.xz" + filepath="$X_TOOLS_DIR/$filename" + extract_dir="$X_TOOLS_DIR/$arch" + url="https://github.com/cross-tools/musl-cross/releases/download/${RELEASE}/${filename}" + + # Skip if already exists + if [ -d "$extract_dir" ]; then + echo -e "${GREEN}✓${NC} $arch already installed, skipping" + continue + fi + + echo -e "${BLUE}Downloading${NC} $filename..." + + # Download with retries + for attempt in 1 2 3; do + if wget -O "$filepath" "$url"; then + echo -e "${BLUE}Extracting${NC} $filename..." + tar xf "$filepath" -C "$X_TOOLS_DIR" + rm "$filepath" + echo -e "${GREEN}✓${NC} Installed: $arch" + break + else + if [ $attempt -lt 3 ]; then + echo " Attempt $attempt failed, retrying in 10 seconds..." + sleep 10 + else + echo -e "${RED}✗${NC} Failed to download $filename after 3 attempts" + rm -f "$filepath" + exit 1 + fi + fi + done +done + +echo "" +echo -e "${GREEN}All musl-cross toolchains ready!${NC}" +echo "" +echo "You can now build with musl targets:" +echo " cmake -DTARGET=arm-unknown-linux-musleabihf .." +echo " cmake -DTARGET=riscv64-unknown-linux-musl .." +echo " cmake -DTARGET=s390x-ibm-linux-musl .." +echo " cmake -DTARGET=powerpc64le-unknown-linux-musl .." diff --git a/toolchains/arm-unknown-linux-musleabihf.cmake b/toolchains/arm-unknown-linux-musleabihf.cmake new file mode 100644 index 0000000..5815768 --- /dev/null +++ b/toolchains/arm-unknown-linux-musleabihf.cmake @@ -0,0 +1,13 @@ +# CMake toolchain configuration for arm-unknown-linux-musleabihf +# Uses musl-cross pre-built toolchain from /opt/x-tools +# Compiler path must be specified: -DCMAKE_C_COMPILER=/opt/x-tools/arm-unknown-linux-musleabihf/bin/arm-unknown-linux-musleabihf-gcc +# Copyright Kyle Hayes (2026) +# Distributed under the Boost Software License, Version 1.0. +# See LICENSE file for details + +set(ASM_FILES + src/asm/arm/make_arm_aapcs_elf_gas.S + src/asm/arm/jump_arm_aapcs_elf_gas.S +) +enable_language(ASM) +add_compile_options(-Wall -Wextra -Werror -g -O2 -static) diff --git a/toolchains/powerpc64le-unknown-linux-musl.cmake b/toolchains/powerpc64le-unknown-linux-musl.cmake new file mode 100644 index 0000000..5297786 --- /dev/null +++ b/toolchains/powerpc64le-unknown-linux-musl.cmake @@ -0,0 +1,13 @@ +# CMake toolchain configuration for powerpc64le-unknown-linux-musl +# Uses musl-cross pre-built toolchain from /opt/x-tools +# Compiler path must be specified: -DCMAKE_C_COMPILER=/opt/x-tools/powerpc64le-unknown-linux-musl/bin/powerpc64le-unknown-linux-musl-gcc +# Copyright Kyle Hayes (2026) +# Distributed under the Boost Software License, Version 1.0. +# See LICENSE file for details + +set(ASM_FILES + src/asm/powerpc64le/make_powerpc64le_sysv_elf_gas.S + src/asm/powerpc64le/jump_powerpc64le_sysv_elf_gas.S +) +enable_language(ASM) +add_compile_options(-Wall -Wextra -Werror -g -O2 -static) diff --git a/toolchains/riscv64-unknown-linux-musl.cmake b/toolchains/riscv64-unknown-linux-musl.cmake new file mode 100644 index 0000000..0f368f5 --- /dev/null +++ b/toolchains/riscv64-unknown-linux-musl.cmake @@ -0,0 +1,13 @@ +# CMake toolchain configuration for riscv64-unknown-linux-musl +# Uses musl-cross pre-built toolchain from /opt/x-tools +# Compiler path must be specified: -DCMAKE_C_COMPILER=/opt/x-tools/riscv64-unknown-linux-musl/bin/riscv64-unknown-linux-musl-gcc +# Copyright Kyle Hayes (2026) +# Distributed under the Boost Software License, Version 1.0. +# See LICENSE file for details + +set(ASM_FILES + src/asm/riscv64/make_riscv64_sysv_elf_gas.S + src/asm/riscv64/jump_riscv64_sysv_elf_gas.S +) +enable_language(ASM) +add_compile_options(-Wall -Wextra -Werror -g -O2 -static) diff --git a/toolchains/s390x-ibm-linux-musl.cmake b/toolchains/s390x-ibm-linux-musl.cmake new file mode 100644 index 0000000..e15d4cc --- /dev/null +++ b/toolchains/s390x-ibm-linux-musl.cmake @@ -0,0 +1,13 @@ +# CMake toolchain configuration for s390x-ibm-linux-musl +# Uses musl-cross pre-built toolchain from /opt/x-tools +# Compiler path must be specified: -DCMAKE_C_COMPILER=/opt/x-tools/s390x-ibm-linux-musl/bin/s390x-ibm-linux-musl-gcc +# Copyright Kyle Hayes (2026) +# Distributed under the Boost Software License, Version 1.0. +# See LICENSE file for details + +set(ASM_FILES + src/asm/s390x/make_s390x_sysv_elf_gas.S + src/asm/s390x/jump_s390x_sysv_elf_gas.S +) +enable_language(ASM) +add_compile_options(-Wall -Wextra -Werror -g -O2 -static) From 9d37bcbcb8f63a2b1253380d42cfd094dc16236c Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 09:29:24 -0800 Subject: [PATCH 27/33] Wrong path to the assembly files. --- toolchains/powerpc64le-unknown-linux-musl.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/powerpc64le-unknown-linux-musl.cmake b/toolchains/powerpc64le-unknown-linux-musl.cmake index 5297786..846f96d 100644 --- a/toolchains/powerpc64le-unknown-linux-musl.cmake +++ b/toolchains/powerpc64le-unknown-linux-musl.cmake @@ -6,8 +6,8 @@ # See LICENSE file for details set(ASM_FILES - src/asm/powerpc64le/make_powerpc64le_sysv_elf_gas.S - src/asm/powerpc64le/jump_powerpc64le_sysv_elf_gas.S + src/asm/ppc64/make_ppc64_sysv_elf_gas.S + src/asm/ppc64/jump_ppc64_sysv_elf_gas.S ) enable_language(ASM) add_compile_options(-Wall -Wextra -Werror -g -O2 -static) From 222940d495f51e51456a1e321a8dc472d9a802bc Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 09:29:43 -0800 Subject: [PATCH 28/33] Need to add the qemu user support. --- .github/workflows/armv7-musl-linux.yml | 3 ++- .github/workflows/ppc64le-musl-linux.yml | 3 ++- .github/workflows/riscv64-musl-linux.yml | 3 ++- .github/workflows/s390x-musl-linux.yml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml index dbfefd6..a7da622 100644 --- a/.github/workflows/armv7-musl-linux.yml +++ b/.github/workflows/armv7-musl-linux.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget + run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - name: Download and install musl-cross toolchain run: ./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf - name: Configure and Build @@ -27,6 +27,7 @@ jobs: -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=arm \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm-static \ .. cmake --build . - name: Upload build artifacts diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml index 56c7876..34271c7 100644 --- a/.github/workflows/ppc64le-musl-linux.yml +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget + run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - name: Download and install musl-cross toolchain run: ./scripts/download-musl-cross.sh powerpc64le-unknown-linux-musl - name: Configure and Build @@ -27,6 +27,7 @@ jobs: -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le-static \ .. cmake --build . - name: Upload build artifacts diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml index 276d7f9..e4a4691 100644 --- a/.github/workflows/riscv64-musl-linux.yml +++ b/.github/workflows/riscv64-musl-linux.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget + run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - name: Download and install musl-cross toolchain run: ./scripts/download-musl-cross.sh riscv64-unknown-linux-musl - name: Configure and Build @@ -27,6 +27,7 @@ jobs: -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64-static \ .. cmake --build . - name: Upload build artifacts diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml index 3023ded..fae667d 100644 --- a/.github/workflows/s390x-musl-linux.yml +++ b/.github/workflows/s390x-musl-linux.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget + run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - name: Download and install musl-cross toolchain run: ./scripts/download-musl-cross.sh s390x-ibm-linux-musl - name: Configure and Build @@ -27,6 +27,7 @@ jobs: -DCMAKE_C_FLAGS='-static' \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=s390x \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x-static \ .. cmake --build . - name: Upload build artifacts From f51c7534313ec1a5092c80d387652bf0337b3396 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 09:37:57 -0800 Subject: [PATCH 29/33] msys2 does not carry over from the build job. This is due to the break up of the single build-and-test job into multiple stages. --- .github/workflows/aarch64-pc-windows-gnu.yml | 6 ++++++ .github/workflows/x86_64-pc-windows-gnu.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/aarch64-pc-windows-gnu.yml b/.github/workflows/aarch64-pc-windows-gnu.yml index 6741d39..5e36380 100644 --- a/.github/workflows/aarch64-pc-windows-gnu.yml +++ b/.github/workflows/aarch64-pc-windows-gnu.yml @@ -44,6 +44,12 @@ jobs: needs: build-aarch64-pc-windows-gnu steps: - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: CLANGARM64 + update: true + install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake - name: Download build artifacts uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/x86_64-pc-windows-gnu.yml b/.github/workflows/x86_64-pc-windows-gnu.yml index b173a33..a57e01b 100644 --- a/.github/workflows/x86_64-pc-windows-gnu.yml +++ b/.github/workflows/x86_64-pc-windows-gnu.yml @@ -44,6 +44,12 @@ jobs: needs: build-x86_64-pc-windows-gnu steps: - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake - name: Download build artifacts uses: actions/download-artifact@v4 with: From ac8e7020adcba669b06d69b9d3f5834347259839 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 09:47:35 -0800 Subject: [PATCH 30/33] No qemu user package installed. --- .github/workflows/i386-unknown-linux-gnu.yml | 2 ++ .github/workflows/s390x-ibm-linux-gnu.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/i386-unknown-linux-gnu.yml b/.github/workflows/i386-unknown-linux-gnu.yml index 14068eb..02eb8c6 100644 --- a/.github/workflows/i386-unknown-linux-gnu.yml +++ b/.github/workflows/i386-unknown-linux-gnu.yml @@ -40,6 +40,8 @@ jobs: needs: build-i386-unknown-linux-gnu steps: - uses: actions/checkout@v4 + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user - name: Download build artifacts uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/s390x-ibm-linux-gnu.yml b/.github/workflows/s390x-ibm-linux-gnu.yml index 8ad3cda..f622e33 100644 --- a/.github/workflows/s390x-ibm-linux-gnu.yml +++ b/.github/workflows/s390x-ibm-linux-gnu.yml @@ -42,6 +42,8 @@ jobs: needs: build-s390x-ibm-linux-gnu steps: - uses: actions/checkout@v4 + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user - name: Download build artifacts uses: actions/download-artifact@v4 with: From 1ffce99bfffc820005a929a559ccf2c6c5b221cb Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 10:23:37 -0800 Subject: [PATCH 31/33] incorrect parameters to the emulator. --- .github/workflows/x86_64-unknown-linux-android.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/x86_64-unknown-linux-android.yml b/.github/workflows/x86_64-unknown-linux-android.yml index 8ce2416..2e58037 100644 --- a/.github/workflows/x86_64-unknown-linux-android.yml +++ b/.github/workflows/x86_64-unknown-linux-android.yml @@ -73,10 +73,11 @@ jobs: api-level: 34 arch: x86_64 target: google_apis - cache: true - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -memory 2048 + disable-animations: true script: | # Wait for emulator to be fully ready adb wait-for-device + adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done' cd build ctest --output-on-failure From fdf224aa82e48866cef2fbf3b5964c2f7e3e9832 Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 10:31:48 -0800 Subject: [PATCH 32/33] Wrong runner type. --- .github/workflows/aarch64-alpine-linux.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml index b453351..15fe155 100644 --- a/.github/workflows/aarch64-alpine-linux.yml +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -4,14 +4,14 @@ on: [push, pull_request] jobs: setup-aarch64-alpine-linux: - runs-on: ubuntu-latest-arm64 + runs-on: ubuntu-24.04-arm steps: - uses: actions/checkout@v4 - name: Build Docker image run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . build-aarch64-alpine-linux: - runs-on: ubuntu-latest-arm64 + runs-on: ubuntu-24.04-arm needs: setup-aarch64-alpine-linux steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: path: build/ test-aarch64-alpine-linux: - runs-on: ubuntu-latest-arm64 + runs-on: ubuntu-24.04-arm needs: build-aarch64-alpine-linux steps: - uses: actions/checkout@v4 From 24cade1bb3f966988e749f0ec67ad1c0b549ff9d Mon Sep 17 00:00:00 2001 From: Kyle Hayes Date: Sun, 1 Feb 2026 10:36:46 -0800 Subject: [PATCH 33/33] Incorrect image names. With i386, we need to force the platform so that we can run 32-bit code on a 64-bit host. --- docker/Dockerfile.alpine-aarch64 | 2 +- docker/Dockerfile.alpine-i386 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.alpine-aarch64 b/docker/Dockerfile.alpine-aarch64 index 25b9273..fd58ff5 100644 --- a/docker/Dockerfile.alpine-aarch64 +++ b/docker/Dockerfile.alpine-aarch64 @@ -1,4 +1,4 @@ -FROM aarch64/alpine:latest +FROM alpine:latest # Configure apk with retry logic for transient network failures RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf diff --git a/docker/Dockerfile.alpine-i386 b/docker/Dockerfile.alpine-i386 index 3ea6376..b2555aa 100644 --- a/docker/Dockerfile.alpine-i386 +++ b/docker/Dockerfile.alpine-i386 @@ -1,4 +1,4 @@ -FROM i386/alpine:latest +FROM --platform=linux/386 alpine:latest # Configure apk with retry logic for transient network failures RUN echo 'http_request_timeout=120' >> /etc/apk/apk.conf