From c7f5cfce34b98cec7e836b7f863518160095e416 Mon Sep 17 00:00:00 2001 From: javi11 Date: Sat, 25 Apr 2026 16:08:01 +0200 Subject: [PATCH 1/2] ci: force external linkmode for static MinGW link in Windows GUI builds Without -linkmode external, Go silently ignored -extldflags=-static, so the Wails GUI exe still imported libstdc++-6.dll and libwinpthread-1.dll and failed verify-windows-gui-dlls. The trailing -Wl,-Bdynamic in CGO_LDFLAGS also reverted later libs to dynamic linking. Run the build under msys2 {0} so the MINGW64 gcc is unambiguously on PATH, mirroring the working CLI build. --- .github/workflows/dev-build.yml | 5 +++-- .github/workflows/release.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 7aad0fe..068db8d 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -96,11 +96,12 @@ jobs: run: npm install -g bun - name: Build Windows GUI - run: wails build -platform windows/amd64 -ldflags="-extldflags=-static" + shell: msys2 {0} + run: wails build -platform windows/amd64 -ldflags="-linkmode external -extldflags=-static" env: CGO_ENABLED: 1 CC: gcc - CGO_LDFLAGS: '-static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic' + CGO_LDFLAGS: '-static-libgcc -static-libstdc++' - name: Verify no MinGW runtime DLL dependencies uses: ./.github/actions/verify-windows-gui-dlls diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffb1714..b54554b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -410,11 +410,12 @@ jobs: # Build Windows GUI using Wails config - name: Build Windows GUI - run: wails build -platform windows/amd64 -ldflags="-extldflags=-static" + shell: msys2 {0} + run: wails build -platform windows/amd64 -ldflags="-linkmode external -extldflags=-static" env: CGO_ENABLED: 1 CC: gcc - CGO_LDFLAGS: '-static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic' + CGO_LDFLAGS: '-static-libgcc -static-libstdc++' # Verify the built exe doesn't dynamically depend on MinGW runtime DLLs - name: Verify no MinGW runtime DLL dependencies From edb924e38d72fcd73b12458a2179f6691d204af2 Mon Sep 17 00:00:00 2001 From: javi11 Date: Sat, 25 Apr 2026 16:28:38 +0200 Subject: [PATCH 2/2] ci: inherit Windows PATH in MSYS2 shell for Wails GUI build The msys2 {0} shell uses a clean PATH by default, so wails (installed via go install into the Windows GOPATH/bin) and go itself were not visible, breaking the build with 'wails: command not found'. Set path-type: inherit on setup-msys2 so the Windows PATH is preserved. --- .github/workflows/dev-build.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 068db8d..9881d51 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -88,6 +88,7 @@ jobs: msystem: MINGW64 install: mingw-w64-x86_64-gcc update: false + path-type: inherit - name: Install Wails run: go install github.com/wailsapp/wails/v2/cmd/wails@latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b54554b..985a203 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -399,6 +399,7 @@ jobs: msystem: MINGW64 install: mingw-w64-x86_64-gcc update: false + path-type: inherit # Install Wails (version from wails.json) - name: Install Wails