libvips / build-win64-mxe

76 stars 15 forks source link

question: Failed to build package vips-all for target x86_64-w64-mingw32.shared.posix.all! #63

Closed lomolomo2 closed 6 months ago

lomolomo2 commented 6 months ago

This is my script:

> ./build.sh all --with-hevc -r 8.13

Failed to build package vips-all for target x86_64-w64-mingw32.shared.posix.all!
------------------------------------------------------------
Hunk #2 FAILED at 1189.
2 out of 2 hunks FAILED -- saving rejects to file libvips/iofuncs/init.c.rej
patching file libvips/iofuncs/util.c
Hunk #1 succeeded at 1993 with fuzz 1 (offset -6 lines).
make[1]: *** [Makefile:913: build-only-vips-all_x86_64-w64-mingw32.shared.posix.all] Error 1
make[1]: Leaving directory '/data/mxe'
real    0m3.547s
user    0m3.497s
sys     0m0.112s
------------------------------------------------------------
[log]      /data/mxe/log/vips-all_x86_64-w64-mingw32.shared.posix.all

make: *** [Makefile:902: /data/mxe/usr/x86_64-w64-mingw32.shared.posix.all/installed/vips-all] Error 1
lomolomo2 commented 6 months ago

This is log:

make[1]: Entering directory '/data/mxe'
== General overrides: /data/overrides.mk
[plugin]      /data/plugins/nightly/
[plugin]      /data/plugins/mozjpeg/
[plugin]      /data/plugins/hevc/
[plugin]      /data/plugins/zlib-ng/
[plugin]      /data/plugins/llvm-mingw/
[plugin]      /data/plugins/proxy-libintl/
uname -a
Linux 1e7ab9940dfb 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux
git log --pretty=tformat:"%H - %s [%ar] [%d]" -1
ffc214fdbd078d364db3e99e1a1afd6fd989f46a - qt6-qtbase: enable openssl support [2 years, 2 months ago] [ (HEAD -> master)]
lsb_release -a 2>/dev/null || sw_vers 2>/dev/null || true
autoconf --version 2>/dev/null | head -1
autoconf (GNU Autoconf) 2.69
automake --version 2>/dev/null | head -1
automake (GNU automake) 1.16.3
gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ --version
g++ (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

python --version
Python 3.9.2
perl --version 2>&1 | head -3

This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi
(with 48 registered patches, see perl -V for more detail)
rm -rf   '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all'
mkdir -p '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all'
mkdir -p '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/libvips-libvips-caed71a'
mkdir -p '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/libvips-libvips-caed71a.build_'
# disable wine with readonly directory
# see https://github.com/mxe/mxe/issues/841
mkdir -p '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/readonly'
chmod 0555 '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/readonly'
cd '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all' &&   tar xzf '/data/mxe/pkg/vips-all-caed71a.tar.gz'
cd '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/libvips-libvips-caed71a'
(cd '/var/tmp/tmp-vips-all-x86_64-w64-mingw32.shared.posix.all/libvips-libvips-caed71a' && patch -p1 -u) < /data/patches/vips-8-dlldir-as-libdir.patch 
patching file libvips/include/vips/util.h
Hunk #1 FAILED at 428.
1 out of 1 hunk FAILED -- saving rejects to file libvips/include/vips/util.h.rej
patching file libvips/iofuncs/init.c
Hunk #1 FAILED at 1165.
Hunk #2 FAILED at 1189.
2 out of 2 hunks FAILED -- saving rejects to file libvips/iofuncs/init.c.rej
patching file libvips/iofuncs/util.c
Hunk #1 succeeded at 1993 with fuzz 1 (offset -6 lines).
make[1]: *** [Makefile:913: build-only-vips-all_x86_64-w64-mingw32.shared.posix.all] Error 1
make[1]: Leaving directory '/data/mxe'

real    0m3.547s
user    0m3.497s
sys 0m0.112s
lomolomo2 commented 6 months ago

I tried to build 8.13 version. If I checkout build-win64-mxe to 8.13, and build with -r 8.13. will meet below issue:

Already up to date.
HEAD is now at a7830988 Update packages.json & build-matrix.html
[ignore settings.mk]
[check reqs]
[download]    zlib-1.2.13.tar.xz
MXE Warning! Downloading zlib from second URL.
MXE Warning! Downloading zlib from backup.

Download failed or wrong checksum of package zlib!
------------------------------------------------------------
2024-04-08 17:10:11 ERROR 404: Not Found.
--2024-04-08 17:10:11--  http://d1yihgixbnrglp.cloudfront.net/zlib%2D1%2E2%2E13%2Etar%2Exz_d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98
Reusing existing connection to d1yihgixbnrglp.cloudfront.net:80.
HTTP request sent, awaiting response... 404 Not Found
2024-04-08 17:10:11 ERROR 404: Not Found.
Download failed!
------------------------------------------------------------
[log]      /data/mxe/log/zlib-download

make: *** [Makefile:737: download-only-zlib-1.2.13.tar.xz] Error 1
kleisauke commented 6 months ago

Please remove -r 8.13, as the 8.13 branch is outdated/unsupported and incompatible with the current applied patches.

lomolomo2 commented 6 months ago

but I found that like 8.14 will not compatible to my go language go vips. seems no libintl will be there.

kleisauke commented 6 months ago

Could you try this patch?:

--- a/vips-dev-8.15/lib/pkgconfig/glib-2.0.pc
+++ b/vips-dev-8.15/lib/pkgconfig/glib-2.0.pc
@@ -12,6 +12,6 @@ glib_valgrind_suppressions=${datadir}/glib-2.0/valgrind/glib.supp
 Name: GLib
 Description: C Utility Library
 Version: 2.80.0
-Libs: -L${libdir} -lglib-2.0 -lintl
-Libs.private: -lws2_32 -lole32 -lwinmm -lshlwapi -luuid -lm
+Libs: -L${libdir} -lglib-2.0
+Libs.private: -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -luuid -lm
 Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -mms-bitfields

I think only the shared variants would work with pkg-config with this patch. The -static variant probably needs a couple more patches to make sure libintl (and likewise for libgio-2.0 and libgmodule-2.0) is defined as a private dependency in the various pkg-config files.

lomolomo2 commented 6 months ago

Could you try this patch?:

--- a/vips-dev-8.15/lib/pkgconfig/glib-2.0.pc
+++ b/vips-dev-8.15/lib/pkgconfig/glib-2.0.pc
@@ -12,6 +12,6 @@ glib_valgrind_suppressions=${datadir}/glib-2.0/valgrind/glib.supp
 Name: GLib
 Description: C Utility Library
 Version: 2.80.0
-Libs: -L${libdir} -lglib-2.0 -lintl
-Libs.private: -lws2_32 -lole32 -lwinmm -lshlwapi -luuid -lm
+Libs: -L${libdir} -lglib-2.0
+Libs.private: -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -luuid -lm
 Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -mms-bitfields

I think only the shared variants would work with pkg-config with this patch. The -static variant probably needs a couple more patches to make sure libintl (and likewise for libgio-2.0 and libgmodule-2.0) is defined as a private dependency in the various pkg-config files.

as tried, this can be pass the building with my go language app.

And I want to include hevc. shall I do like this:

./build.sh all --with-hevc

or

./build.sh all --with-hevc -r 8.15

lomolomo2 commented 6 months ago

》 ./build.sh all --with-hevc -r 8.15

building success. see instructions here: https://github.com/lomolomo2/download-vips/tree/main