diff --git a/.github/actions/verify-windows-gui-dlls/action.yml b/.github/actions/verify-windows-gui-dlls/action.yml new file mode 100644 index 0000000..f881372 --- /dev/null +++ b/.github/actions/verify-windows-gui-dlls/action.yml @@ -0,0 +1,30 @@ +name: Verify Windows GUI DLL dependencies +description: Fails if the built Windows GUI exe imports MinGW runtime DLLs (libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll). +inputs: + exe-glob: + description: Glob for the built GUI exe + required: false + default: build/bin/*.exe +runs: + using: composite + steps: + - name: Check PE imports for forbidden MinGW runtime DLLs + shell: msys2 {0} + run: | + set -euo pipefail + exe=$(ls ${{ inputs.exe-glob }} | head -n1) + if [ -z "$exe" ]; then + echo "::error::No exe found matching glob '${{ inputs.exe-glob }}'" + exit 1 + fi + echo "Inspecting: $exe" + imports=$(objdump -p "$exe" | grep -i "DLL Name:" || true) + echo "--- DLL imports ---" + echo "$imports" + echo "-------------------" + forbidden='libgcc_s_seh-1\.dll|libstdc\+\+-6\.dll|libwinpthread-1\.dll' + if echo "$imports" | grep -iE "$forbidden"; then + echo "::error::Windows GUI exe depends on MinGW runtime DLL(s); static linking regressed." + exit 1 + fi + echo "OK: no MinGW runtime DLL dependencies found." diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 33808ae..7aad0fe 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -102,6 +102,9 @@ jobs: CC: gcc CGO_LDFLAGS: '-static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic' + - name: Verify no MinGW runtime DLL dependencies + uses: ./.github/actions/verify-windows-gui-dlls + - name: Upload Windows GUI artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ba2ac5..ffb1714 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -416,6 +416,10 @@ jobs: CC: gcc CGO_LDFLAGS: '-static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic' + # Verify the built exe doesn't dynamically depend on MinGW runtime DLLs + - name: Verify no MinGW runtime DLL dependencies + uses: ./.github/actions/verify-windows-gui-dlls + # Upload Windows artifact - name: Upload Windows GUI artifact uses: actions/upload-artifact@v4