Skip to content

Build Windows binaries using upstream MXE scripts - #459

Merged
lovell merged 1 commit into
mainfrom
temp-win-build
Dec 3, 2026
Merged

lovell merged 1 commit into
mainfrom
temp-win-build

Conversation

@lovell

@lovell lovell commented Dec 3, 2026

Copy link
Copy Markdown
Owner

This takes advantage of the OCI image files to cross-compile libvips within this repo rather than repackage existing Windows release binaries tied to the libvips release schedule.

This approach should allow more frequent releases that can include other upstream changes.

It currently takes ~23 minutes, which is faster than the macOS builds, and the resultant tarballs have the same contents as the previous build on the main branch (the following correctly produces no output):

$ diff <(tar -tvf a/sharp-libvips-win32-x64.tar.gz | cut -w -f3,6) <(tar -tvf b/sharp-libvips-win32-x64.tar.gz | cut -w -f3,6)
$ diff <(tar -tvf a/sharp-libvips-win32-arm64v8.tar.gz | cut -w -f3,6) <(tar -tvf b/sharp-libvips-win32-arm64v8.tar.gz | cut -w -f3,6)

/cc @kleisauke for "might be interesting" purposes

Rather than repackage existing Windows release binaries tied to
the libvips release schedule, this approach allows more frequent
releases that can include other upstream changes.
@kleisauke

Copy link
Copy Markdown
Collaborator

[...] the resultant tarballs have the same contents as the previous build on the main branch

Ah, interesting. I had always assumed this would result in a different sha256sum for the final DLL, since it also changes the build directory into which libvips is cloned.
https://github.com/libvips/build-win64-mxe/blob/v8.19.0/build/plugins/nightly/overrides.mk

But indeed, it looks like this would only change if libvips were configured with a different --prefix= (see e.g. #227 (comment)) or if building these binaries with --with-debug.

@kleisauke kleisauke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! This also saves you from having to wait until I've finished building all these Windows binaries, which still takes ~2 hours locally. 😅

@lovell

lovell commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

The shasums are different for the resultant DLL as the .buildid changes, but the file size and other headers all appear to be the same.

@lovell
lovell merged commit e15c361 into main Dec 3, 2026
28 checks passed
@kleisauke

Copy link
Copy Markdown
Collaborator

The shasums are different for the resultant DLL as the .buildid changes

Ah, I did some digging and found this interesting blog post:
https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html#getting-to-local-determinism

I applied those suggestions in commit libvips/build-win64-mxe@14daded (and opened PR libvips/libvips#5369). I now see:

$ ./build.sh vips-web -t x86_64-w64-mingw32.static
$ ./build.sh vips-web -t x86_64-w64-mingw32.static -r v8.19.0
$ unzip packaging/vips-dev-x64-web-8.19.0-static.zip
$ unzip packaging/vips-dev-x64-web-1379056-static.zip
$ docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro registry.salsa.debian.org/reproducible-builds/diffoscope --exclude-directory-metadata=yes vips-dev-8.19 vips-dev-1379056
--- vips-dev-8.19
+++ vips-dev-1379056
│   --- vips-dev-8.19/versions.json
├── +++ vips-dev-1379056/versions.json
│ ├── Pretty-printed
│ │┄ Similarity: 0.9821428571428571%
│ │┄ Differences: {"'vips'": "'1379056'"}
│ │ @@ -19,12 +19,12 @@
│ │      "pango": "1.58.2",
│ │      "pixman": "0.46.4",
│ │      "png": "1.6.59",
│ │      "proxy-libintl": "0.5",
│ │      "rsvg": "2.63.4",
│ │      "tiff": "4.7.2",
│ │      "uhdr": "2.0.2",
│ │ -    "vips": "8.19.0",
│ │ +    "vips": "1379056",
│ │      "webp": "1.6.0",
│ │      "xml2": "2.15.4",
│ │      "zlib-ng": "2.3.3"
│ │  }

i.e. identical extracted content when building with -r v8.19.0 (except for versions.json). 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants