From e9df01d5eaacee628471671baf1b23cc49135277 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Thu, 7 Dec 2023 06:03:25 +0200 Subject: [PATCH] Use better workaround for libpng in Windows release packaging --- .github/workflows/release.yml | 34 ++++++++++++++++++++-------- wix/expected-dlls.log | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 wix/expected-dlls.log diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e11d6984..6f99fc70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,16 +56,38 @@ jobs: run: brew install gtk4 if: runner.os == 'macOS' + # TODO: This is a workaround for https://github.com/wingtk/gvsbuild/issues/984, remove once fixed upstream + - name: Move git binary (Windows) + run: | + Move-Item "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin" + Move-Item "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin" + if: runner.os == 'Windows' + - name: Install GTK4 (Windows) - # TODO: Git commit from `libpng` branch that works around https://github.com/wingtk/gvsbuild/issues/984 run: | - pipx install git+https://github.com/g40/gvsbuild@20f78d8314b3f753adfd472b4b6c0b6866a4a0f8 + pipx install gvsbuild gvsbuild build gtk4 Add-Content $env:GITHUB_ENV "PKG_CONFIG_PATH=C:\gtk-build\gtk\x64\release\lib\pkgconfig" Add-Content $env:GITHUB_ENV ("LIB=" + $env:LIB + ";" + "C:\gtk-build\gtk\x64\release\lib") Add-Content $env:GITHUB_PATH "C:\gtk-build\gtk\x64\release\bin" + + # We have hardcoded list of libraries in space-acres.wxs, make sure it didn't change unexpectedly + Get-ChildItem C:\gtk-build\gtk\x64\release\bin\*.dll | ForEach-Object { $_.Name } > wix\actual-dlls.log + if (-not (Compare-Object -ReferenceObject (Get-Content -Path wix\expected-dlls.log) -DifferenceObject (Get-Content -Path wix\actual-dlls.log))) { + Write-Output "Expected DLLs:" + Get-Content wix\expected-dlls.log + Write-Output "Actual DLLs:" + Get-Content wix\actual-dlls.log + Throw "Actual DLLs do not match expected" + } if: runner.os == 'Windows' + # TODO: This is a workaround for https://github.com/wingtk/gvsbuild/issues/984, remove once fixed upstream + - name: Restore git binary (Windows) + run: | + Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin" + Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin" + # On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support # TODO: on macOS, the consensus/domain runtime build is not compatible with LLVM 15.0.7 and # LLVM 15.0.{3, 4, 5, 6} is not released for macOS thus install LLVM 15.0.2 explicitly as a @@ -128,13 +150,7 @@ jobs: # TODO: Ideally something like this would have worked and we wouldn't need to hardcode stuff in `space-acres.wxs`: https://github.com/volks73/cargo-wix/issues/271 # & "C:\Program Files (x86)\WiX Toolset v3.11\bin\heat.exe" dir target\wix\gtk4 -gg -sfrag -template:fragment -out target\wix\gtk4.wxs -cg GTK -dr GTK - # TODO: This is a workaround for missing `--target` support: https://github.com/volks73/cargo-wix/issues/272 - New-Item target\production -ItemType Directory -Force - Copy-Item -Path ${{ env.PRODUCTION_TARGET }}\space-acres.exe -Destination target\production\space-acres.exe - - cargo wix --profile production --no-build --nocapture - - Remove-Item target\production -Recurse -Confirm:$false + cargo wix --target ${{ matrix.build.target }} --profile production --no-build --nocapture Remove-Item target\wix\gtk4 -Recurse -Confirm:$false -ErrorAction SilentlyContinue if: runner.os == 'Windows' diff --git a/wix/expected-dlls.log b/wix/expected-dlls.log new file mode 100644 index 00000000..f1824795 --- /dev/null +++ b/wix/expected-dlls.log @@ -0,0 +1,42 @@ +asprintf.dll +cairo-2.dll +cairo-gobject-2.dll +cairo-script-interpreter-2.dll +epoxy-0.dll +ffi-8.dll +fontconfig-1.dll +freetype-6.dll +fribidi-0.dll +gdk_pixbuf-2.0-0.dll +gettextlib-0.21.0.dll +gettextpo.dll +gettextsrc-0.21.0.dll +gio-2.0-0.dll +glib-2.0-0.dll +gmodule-2.0-0.dll +gobject-2.0-0.dll +graphene-1.0-0.dll +gthread-2.0-0.dll +gtk-4-1.dll +harfbuzz-cairo.dll +harfbuzz-gobject.dll +harfbuzz-subset.dll +harfbuzz.dll +iconv.dll +intl.dll +jpeg62.dll +libexpat.dll +libpng16.dll +pango-1.0-0.dll +pangocairo-1.0-0.dll +pangowin32-1.0-0.dll +pcre2-16.dll +pcre2-32.dll +pcre2-8.dll +pcre2-posix.dll +pixman-1-0.dll +pkgconf-4.dll +textstyle.dll +tiff.dll +turbojpeg.dll +zlib1.dll