From 3fc122c2acd99a709b351fa51be4ffbe49e48bea Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 15:45:28 -0500 Subject: [PATCH 1/8] Add CI workflow to build CrossBasic on Linux and Windows --- .github/workflows/build.yml | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..da73c7f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,82 @@ +name: Build CrossBasic + +on: + push: + branches: [ main, master ] + tags: [ 'v*' ] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + env: + RELEASE_DIR: release-64 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Rust toolchain (Linux) + if: matrix.os == 'ubuntu-latest' + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Set up Rust toolchain (Windows GNU) + if: matrix.os == 'windows-latest' + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: x86_64-pc-windows-gnu + override: true + + - name: Install Linux dependencies + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y g++ libffi-dev + + - name: Install Windows MinGW toolchain + if: matrix.os == 'windows-latest' + run: | + choco install mingw --version=13.1.0 -y + echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin" >> %GITHUB_PATH% + + - name: Make scripts executable (Linux) + if: matrix.os == 'ubuntu-latest' + run: chmod +x build_crossbasic.sh build_xcompile.sh build_appserver.sh build_plugins.sh + + - name: Build on Linux + if: matrix.os == 'ubuntu-latest' + run: | + ./build_crossbasic.sh + ./build_xcompile.sh + ./build_appserver.sh + ./build_plugins.sh + + - name: Build on Windows + if: matrix.os == 'windows-latest' + run: | + call build_all_windows.bat + shell: cmd + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: crossbasic-${{ matrix.os }} + path: ${{ env.RELEASE_DIR }} + if-no-files-found: error From 8855504ebe73fc503dd9d789c74014dd7a58ace3 Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 16:05:40 -0500 Subject: [PATCH 2/8] Add missing dependencies to CI workflow --- .github/workflows/build.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da73c7f..acbad4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,13 +47,29 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y g++ libffi-dev + sudo apt-get install -y \ + g++ \ + libffi-dev \ + libgmp-dev \ + libboost-all-dev \ + libcurl4-openssl-dev \ + libsqlite3-dev \ + libglew-dev - - name: Install Windows MinGW toolchain + - name: Install Windows build toolchain and dependencies if: matrix.os == 'windows-latest' + shell: pwsh run: | - choco install mingw --version=13.1.0 -y - echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin" >> %GITHUB_PATH% + choco install nuget.commandline -y + choco install msys2 -y + + C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy" + C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost mingw-w64-x86_64-libffi mingw-w64-x86_64-gmp mingw-w64-x86_64-curl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-glew mingw-w64-x86_64-cppwinrt" + + nuget install Microsoft.Web.WebView2 -Version 1.0.2210.55 -OutputDirectory $pwd\deps + + "C:\\msys64\\mingw64\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + "CPLUS_INCLUDE_PATH=$pwd\deps\Microsoft.Web.WebView2.1.0.2210.55\build\native\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Make scripts executable (Linux) if: matrix.os == 'ubuntu-latest' From 1a71de83a79bf783ccbbf6ac8da6118bb721c611 Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 16:49:58 -0500 Subject: [PATCH 3/8] Improve Windows CI dependencies and flags --- .github/workflows/build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acbad4b..d8bbb61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,13 +64,22 @@ jobs: choco install msys2 -y C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy" - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost mingw-w64-x86_64-libffi mingw-w64-x86_64-gmp mingw-w64-x86_64-curl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-glew mingw-w64-x86_64-cppwinrt" + C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost mingw-w64-x86_64-libffi mingw-w64-x86_64-gmp mingw-w64-x86_64-curl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-cppwinrt" nuget install Microsoft.Web.WebView2 -Version 1.0.2210.55 -OutputDirectory $pwd\deps "C:\\msys64\\mingw64\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append "CPLUS_INCLUDE_PATH=$pwd\deps\Microsoft.Web.WebView2.1.0.2210.55\build\native\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + C:\msys64\usr\bin\bash -lc "for lib in system thread; do src=\$(ls /mingw64/lib/libboost_${lib}*.a | head -n1); cp \"$src\" /mingw64/lib/libboost_${lib}-mgw14-mt-s-x64-1_87.a; done" + + - name: Set Windows build flags + if: matrix.os == 'windows-latest' + shell: cmd + run: | + echo CXXFLAGS=-std=c++20 -fcoroutines >> %GITHUB_ENV% + echo CFLAGS=-std=c11 >> %GITHUB_ENV% + - name: Make scripts executable (Linux) if: matrix.os == 'ubuntu-latest' run: chmod +x build_crossbasic.sh build_xcompile.sh build_appserver.sh build_plugins.sh @@ -89,6 +98,13 @@ jobs: call build_all_windows.bat shell: cmd + - name: Copy Windows runtime libraries + if: matrix.os == 'windows-latest' + shell: cmd + run: | + if not exist %RELEASE_DIR%\libs mkdir %RELEASE_DIR%\libs + xcopy libs %RELEASE_DIR%\libs /E /I /Y + - name: Upload artifacts if: always() uses: actions/upload-artifact@v4 From 3aea8e8a5b8bc952643defc960f08d23b7bab27b Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 16:50:18 -0500 Subject: [PATCH 4/8] Clarify Windows libs requirements --- libs/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/README.md b/libs/README.md index f9087f0..3dacf6f 100644 --- a/libs/README.md +++ b/libs/README.md @@ -1 +1,7 @@ -Windows-specific dynamic link library dependencies. \ No newline at end of file +Windows-specific dynamic link library dependencies. + +The Windows workflows copy everything in this folder into the final `release-64/libs` +output. If required runtime DLLs are missing here, Windows builds will succeed but the +published artifact will launch with missing-library errors. Make sure the proprietary +or prebuilt DLLs the application depends on (e.g., bundled plugin runtimes) are added +before cutting a release. From 22114621fbe55eed4d3e4224e0597ce42a89da43 Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 17:09:22 -0500 Subject: [PATCH 5/8] Fix Windows boost alias in workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8bbb61..a676b9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: "C:\\msys64\\mingw64\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append "CPLUS_INCLUDE_PATH=$pwd\deps\Microsoft.Web.WebView2.1.0.2210.55\build\native\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - C:\msys64\usr\bin\bash -lc "for lib in system thread; do src=\$(ls /mingw64/lib/libboost_${lib}*.a | head -n1); cp \"$src\" /mingw64/lib/libboost_${lib}-mgw14-mt-s-x64-1_87.a; done" + C:\msys64\usr\bin\bash -lc 'for lib in system thread; do src=$(ls /mingw64/lib/libboost_${lib}*.a | head -n1); cp "$src" /mingw64/lib/libboost_${lib}-mgw14-mt-s-x64-1_87.a; done' - name: Set Windows build flags if: matrix.os == 'windows-latest' From 55541513046b988ef867925e0e5f1641d2778aa9 Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 17:53:04 -0500 Subject: [PATCH 6/8] Add macOS and Linux arm64 builds to workflow --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a676b9e..b71d8c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,12 +12,22 @@ permissions: jobs: build: - name: Build (${{ matrix.os }}) + name: Build (${{ matrix.name }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + include: + - name: linux-x64 + os: ubuntu-latest + - name: linux-arm64 + os: ubuntu-24.04-arm64 + - name: macos-x64 + os: macos-13 + - name: macos-arm64 + os: macos-14 + - name: windows-x64 + os: windows-latest env: RELEASE_DIR: release-64 @@ -27,7 +37,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Rust toolchain (Linux) - if: matrix.os == 'ubuntu-latest' + if: startsWith(matrix.os, 'ubuntu') uses: actions-rs/toolchain@v1 with: profile: minimal @@ -43,8 +53,16 @@ jobs: target: x86_64-pc-windows-gnu override: true + - name: Set up Rust toolchain (macOS) + if: startsWith(matrix.os, 'macos') + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Install Linux dependencies - if: matrix.os == 'ubuntu-latest' + if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update sudo apt-get install -y \ @@ -56,6 +74,19 @@ jobs: libsqlite3-dev \ libglew-dev + - name: Install macOS dependencies + if: startsWith(matrix.os, 'macos') + run: | + brew update + brew install \ + boost \ + gmp \ + libffi \ + curl \ + sqlite \ + glew \ + glfw + - name: Install Windows build toolchain and dependencies if: matrix.os == 'windows-latest' shell: pwsh @@ -80,12 +111,12 @@ jobs: echo CXXFLAGS=-std=c++20 -fcoroutines >> %GITHUB_ENV% echo CFLAGS=-std=c11 >> %GITHUB_ENV% - - name: Make scripts executable (Linux) - if: matrix.os == 'ubuntu-latest' + - name: Make scripts executable (POSIX) + if: matrix.os != 'windows-latest' run: chmod +x build_crossbasic.sh build_xcompile.sh build_appserver.sh build_plugins.sh - - name: Build on Linux - if: matrix.os == 'ubuntu-latest' + - name: Build on Linux/macOS + if: matrix.os != 'windows-latest' run: | ./build_crossbasic.sh ./build_xcompile.sh @@ -109,6 +140,6 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: crossbasic-${{ matrix.os }} + name: crossbasic-${{ matrix.name }} path: ${{ env.RELEASE_DIR }} if-no-files-found: error From 6fbbddb1a8301843b89c876e4f3584776faf8d2e Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 18:26:25 -0500 Subject: [PATCH 7/8] Update macOS runners and libffi setup --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b71d8c2..dae9d1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,9 @@ jobs: - name: linux-arm64 os: ubuntu-24.04-arm64 - name: macos-x64 - os: macos-13 + os: macos-15-intel - name: macos-arm64 - os: macos-14 + os: macos-latest - name: windows-x64 os: windows-latest @@ -82,11 +82,17 @@ jobs: boost \ gmp \ libffi \ + pkg-config \ curl \ sqlite \ glew \ glfw + prefix=$(brew --prefix libffi) + echo "CPATH=$prefix/include:$CPATH" >> "$GITHUB_ENV" + echo "LIBRARY_PATH=$prefix/lib:$LIBRARY_PATH" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" + - name: Install Windows build toolchain and dependencies if: matrix.os == 'windows-latest' shell: pwsh From 68076873d0cac971e57ea8fc537d5b0db4dfae4d Mon Sep 17 00:00:00 2001 From: Matthew Combatti Date: Sun, 21 Dec 2025 18:43:12 -0500 Subject: [PATCH 8/8] Limit CI matrix and add Windows static libs --- .github/workflows/build.yml | 48 +++++++++---------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dae9d1f..52acec6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,6 @@ jobs: include: - name: linux-x64 os: ubuntu-latest - - name: linux-arm64 - os: ubuntu-24.04-arm64 - - name: macos-x64 - os: macos-15-intel - - name: macos-arm64 - os: macos-latest - name: windows-x64 os: windows-latest @@ -53,14 +47,6 @@ jobs: target: x86_64-pc-windows-gnu override: true - - name: Set up Rust toolchain (macOS) - if: startsWith(matrix.os, 'macos') - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - name: Install Linux dependencies if: startsWith(matrix.os, 'ubuntu') run: | @@ -74,25 +60,6 @@ jobs: libsqlite3-dev \ libglew-dev - - name: Install macOS dependencies - if: startsWith(matrix.os, 'macos') - run: | - brew update - brew install \ - boost \ - gmp \ - libffi \ - pkg-config \ - curl \ - sqlite \ - glew \ - glfw - - prefix=$(brew --prefix libffi) - echo "CPATH=$prefix/include:$CPATH" >> "$GITHUB_ENV" - echo "LIBRARY_PATH=$prefix/lib:$LIBRARY_PATH" >> "$GITHUB_ENV" - echo "PKG_CONFIG_PATH=$prefix/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" - - name: Install Windows build toolchain and dependencies if: matrix.os == 'windows-latest' shell: pwsh @@ -110,6 +77,13 @@ jobs: C:\msys64\usr\bin\bash -lc 'for lib in system thread; do src=$(ls /mingw64/lib/libboost_${lib}*.a | head -n1); cp "$src" /mingw64/lib/libboost_${lib}-mgw14-mt-s-x64-1_87.a; done' + $zipPath = "$pwd\deps\mingw-libs.zip" + Invoke-WebRequest -Uri "https://www.simulanics.com/libs.zip" -OutFile $zipPath + Expand-Archive -LiteralPath $zipPath -DestinationPath "$pwd\deps\mingw-libs" + + "LIBRARY_PATH=$pwd\deps\mingw-libs;$env:LIBRARY_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + "LIB=$pwd\deps\mingw-libs;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Set Windows build flags if: matrix.os == 'windows-latest' shell: cmd @@ -117,12 +91,12 @@ jobs: echo CXXFLAGS=-std=c++20 -fcoroutines >> %GITHUB_ENV% echo CFLAGS=-std=c11 >> %GITHUB_ENV% - - name: Make scripts executable (POSIX) - if: matrix.os != 'windows-latest' + - name: Make scripts executable (Linux) + if: matrix.os == 'ubuntu-latest' run: chmod +x build_crossbasic.sh build_xcompile.sh build_appserver.sh build_plugins.sh - - name: Build on Linux/macOS - if: matrix.os != 'windows-latest' + - name: Build on Linux + if: matrix.os == 'ubuntu-latest' run: | ./build_crossbasic.sh ./build_xcompile.sh