diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c0058d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +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/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/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml new file mode 100644 index 0000000..15fe155 --- /dev/null +++ b/.github/workflows/aarch64-alpine-linux.yml @@ -0,0 +1,52 @@ +name: aarch64-alpine-linux + +on: [push, pull_request] + +jobs: + setup-aarch64-alpine-linux: + 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-24.04-arm + 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 \ + sh -c "mkdir -p build && cd build && \ + cmake -DTARGET=aarch64-pc-linux-gnu \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + 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-24.04-arm + 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: 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 + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + sh -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..5e36380 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,28 @@ 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: 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: + 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..de3491e 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,32 @@ 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: 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 + 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 new file mode 100644 index 0000000..a7da622 --- /dev/null +++ b/.github/workflows/armv7-musl-linux.yml @@ -0,0 +1,56 @@ +name: armv7-musl-linux + +on: [push, pull_request] + +jobs: + setup-armv7-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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 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 + run: | + mkdir -p build && cd build + 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 \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm-static \ + .. + cmake --build . + - 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: 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: + name: build-armv7-musl-linux + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - name: Run Tests + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 36bb92b..046370f 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: @@ -33,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 @@ -42,14 +49,14 @@ 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 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" && git push origin release + git commit -m "Update code coverage badge [skip ci]" && git push origin prerelease fi diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml new file mode 100644 index 0000000..b53d816 --- /dev/null +++ b/.github/workflows/i386-alpine-linux.yml @@ -0,0 +1,56 @@ +name: i386-alpine-linux + +on: [push, pull_request] + +jobs: + 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 . + + 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 \ + sh -c "mkdir -p build && cd build && \ + cmake -DTARGET=i386-unknown-linux-gnu \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + 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: 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 + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + sh -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..02eb8c6 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,27 @@ 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: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-i386-unknown-linux-gnu + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - 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 9bd18b6..e95e75f 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.mips . - - name: Build and Test + 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 run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,32 @@ 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: 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 + 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 39dd8c3..d0ecfe2 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.mips . - - name: Build and Test + 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 run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,32 @@ 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: 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 + 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 b9f1156..d791e14 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.ppc . - - name: Build and Test + 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 run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,32 @@ 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: 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 + 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 643562a..b43d5d6 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.ppc . - - name: Build and Test + 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 run: | docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ bash -c "mkdir -p build && cd build && \ @@ -18,5 +27,32 @@ 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: 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 + 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 new file mode 100644 index 0000000..34271c7 --- /dev/null +++ b/.github/workflows/ppc64le-musl-linux.yml @@ -0,0 +1,56 @@ +name: ppc64le-musl-linux + +on: [push, pull_request] + +jobs: + setup-ppc64le-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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 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 + run: | + mkdir -p build && cd build + 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 \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le-static \ + .. + cmake --build . + - 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: 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: + name: build-ppc64le-musl-linux + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - name: Run Tests + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f15835b..fae563e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,17 @@ 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: + - release permissions: contents: write @@ -59,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; @@ -171,22 +187,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 diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml new file mode 100644 index 0000000..e4a4691 --- /dev/null +++ b/.github/workflows/riscv64-musl-linux.yml @@ -0,0 +1,56 @@ +name: riscv64-musl-linux + +on: [push, pull_request] + +jobs: + setup-riscv64-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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 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 + run: | + mkdir -p build && cd build + 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 \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64-static \ + .. + cmake --build . + - 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: 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: + name: build-riscv64-musl-linux + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - 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..88e857a 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,32 @@ 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: 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 + 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..f622e33 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,27 @@ 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: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-s390x-ibm-linux-gnu + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - 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 new file mode 100644 index 0000000..fae667d --- /dev/null +++ b/.github/workflows/s390x-musl-linux.yml @@ -0,0 +1,56 @@ +name: s390x-musl-linux + +on: [push, pull_request] + +jobs: + setup-s390x-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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 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 + run: | + mkdir -p build && cd build + 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 \ + -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x-static \ + .. + cmake --build . + - 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: 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: + name: build-s390x-musl-linux + path: build/ + - name: Restore execute permissions + run: chmod +x build/bin/* + - 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..0b3e7a7 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,32 @@ 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: 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 + 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/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/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml new file mode 100644 index 0000000..6070179 --- /dev/null +++ b/.github/workflows/x86_64-alpine-linux.yml @@ -0,0 +1,52 @@ +name: x86_64-alpine-linux + +on: [push, pull_request] + +jobs: + 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 . + + 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 \ + sh -c "mkdir -p build && cd build && \ + cmake -DTARGET=x86_64-pc-linux-gnu \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_SYSTEM_NAME=Linux \ + .. && \ + 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: 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 + run: | + docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ + sh -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..a57e01b 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,28 @@ 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: 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: + 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 f431e66..2e58037 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,17 +40,44 @@ 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: - api-level: 29 + api-level: 34 arch: x86_64 + target: google_apis + 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 diff --git a/.gitignore b/.gitignore index cb7c49b..96c1f40 100644 --- a/.gitignore +++ b/.gitignore @@ -44,8 +44,18 @@ 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 +# 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 cd2fa91..f5df3d6 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 @@ -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/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 df175ca..7042233 100644 --- a/README.md +++ b/README.md @@ -2,29 +2,65 @@ ## 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.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) +### 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 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) | + +### 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 + +| 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) + +**Latest Release:** v0.1.0 A portable, low-level C11 fiber/coroutine library derived from Boost.Context. diff --git a/VERSION b/VERSION index 6c6aa7c..6e8bf73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.0 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..c4e3c98 --- /dev/null +++ b/cross-compilers/README.md @@ -0,0 +1,71 @@ +# Cross-Compiler Toolchains + +This directory contains downloaded musl-cross pre-built toolchains for cross-compilation support. + +## Installation + +The musl cross-compiler binaries are downloaded on-demand and stored in the `x-tools/` subdirectory. + +To install the musl-cross toolchains locally: + +```bash +./scripts/download-musl-cross.sh +``` + +This will download all four supported architectures from the [cross-tools/musl-cross](https://github.com/cross-tools/musl-cross) GitHub releases. + +To download a specific architecture only: + +```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 +``` + +## Building with Musl + +Once installed, you can build for musl targets: + +```bash +mkdir build && cd build +cmake -DTARGET=arm-unknown-linux-musleabihf .. +cmake --build . +``` + +## Supported Architectures + +- **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 + +## Directory Structure + +``` +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/ +``` + +The `x-tools/` directory is generated by the download script and is not checked into Git. + +## Optional + +These toolchains are **optional**. If you don't need musl cross-compilation, you can build for your native platform without downloading them: + +```bash +mkdir build && cd build +cmake .. # Auto-detects your native platform +cmake --build . +``` + +## References + +- [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/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 diff --git a/docker/Dockerfile.alpine-aarch64 b/docker/Dockerfile.alpine-aarch64 new file mode 100644 index 0000000..fd58ff5 --- /dev/null +++ b/docker/Dockerfile.alpine-aarch64 @@ -0,0 +1,26 @@ +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 && \ + 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..b2555aa --- /dev/null +++ b/docker/Dockerfile.alpine-i386 @@ -0,0 +1,26 @@ +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 + +# 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 && \ + 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..fd58ff5 --- /dev/null +++ b/docker/Dockerfile.alpine-x86_64 @@ -0,0 +1,26 @@ +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 && \ + 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 diff --git a/docs/coverage/index-sort-f.html b/docs/coverage/index-sort-f.html index 603704f..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 02:38:20 + Generated Functions: 89.5 % diff --git a/docs/coverage/index-sort-l.html b/docs/coverage/index-sort-l.html index 1285fb0..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 02:38:20 + Generated Functions: 89.5 % diff --git a/docs/coverage/index.html b/docs/coverage/index.html index bb9bb0c..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 02:38:20 + Generated Functions: 89.5 % diff --git a/docs/coverage/src/index-sort-f.html b/docs/coverage/src/index-sort-f.html index 6aac335..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 02:38:20 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/index-sort-l.html b/docs/coverage/src/index-sort-l.html index 8834b73..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 02:38:20 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/index.html b/docs/coverage/src/index.html index ccf894e..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 02:38:20 + 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 0b9c24c..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 02:38:20 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/yafl.c.func.html b/docs/coverage/src/yafl.c.func.html index c2bd44c..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 02:38:20 + Generated Functions: 87.5 % diff --git a/docs/coverage/src/yafl.c.gcov.html b/docs/coverage/src/yafl.c.gcov.html index 3e0edfb..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 02:38:20 + Generated Functions: 87.5 % diff --git a/docs/coverage/tests/index-sort-f.html b/docs/coverage/tests/index-sort-f.html index aad5901..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 02:38:20 + Generated Functions: 90.0 % diff --git a/docs/coverage/tests/index-sort-l.html b/docs/coverage/tests/index-sort-l.html index 2cc2701..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 02:38:20 + Generated Functions: 90.0 % diff --git a/docs/coverage/tests/index.html b/docs/coverage/tests/index.html index 478d384..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 02:38:20 + 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 ae927f1..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 02:38:20 + 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 426c245..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 02:38:20 + 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 a67b3b2..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 02:38:20 + 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 8f84c0c..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 02:38:20 + 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 7fa3122..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 02:38:20 + 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 fc0a162..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 02:38:20 + 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 b1c2a8c..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 02:38:20 + 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 d7c697f..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 02:38:20 + 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 509c256..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 02:38:20 + 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 8452976..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 02:38:20 + 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 7496095..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 02:38:20 + 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 9f9a968..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 02:38:20 + Generated Functions: 100.0 % 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" 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/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 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..846f96d --- /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/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) 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)