mxe icon indicating copy to clipboard operation
mxe copied to clipboard

Failed to build HarfBuzz for target x86_64-w64-mingw32.shared

Open cgilles opened this issue 4 years ago • 12 comments

[download] harfbuzz-4.1.0.tar.gz MXE Warning! Downloading harfbuzz from second URL. [build] harfbuzz x86_64-w64-mingw32.shared

Failed to build package harfbuzz for target x86_64-w64-mingw32.shared!

[2/84] Compiling C++ object src/libharfbuzz-0.dll.p/hb-buffer-serialize.cc.obj [3/84] Compiling C++ object src/libharfbuzz-0.dll.p/hb-aat-map.cc.obj [4/84] Compiling C++ object src/libharfbuzz-0.dll.p/hb-aat-layout.cc.obj ninja: build stopped: subcommand failed. make[1]: *** [Makefile:898: build-only-harfbuzz_x86_64-w64-mingw32.shared] Error 1 make[1]: Leaving directory '/home/gilles/Documents/7.x/project/bundles/mxe/build.win64' real 0m18.828s user 0m25.709s sys 0m3.215s

[log] /home/gilles/Documents/7.x/project/bundles/mxe/build.win64/log/harfbuzz_x86_64-w64-mingw32.shared

cgilles avatar Apr 05 '22 10:04 cgilles

I'm seeing the same, could be caused by ragel:

Program ragel found: NO
tmp-harfbuzz-x86_64-w64-mingw32.shared/harfbuzz-4.1.0/src/meson.build:305: WARNING: You have to install ragel if you are going to develop HarfBuzz itself
Program ragel found: NO found 6.9 but need: '6.10' (/Users/tonyt/dev/mxe/usr/aarch64-apple-darwin21.4.0/bin/ragel)
tmp-harfbuzz-i686-w64-mingw32.static.gcc12/harfbuzz-4.2.0/src/meson.build:327: WARNING: You have to install ragel if you are going to develop HarfBuzz itself

tonytheodore avatar Apr 10 '22 01:04 tonytheodore

Updating ragel has no impact.

tonytheodore avatar Apr 10 '22 02:04 tonytheodore

Actually, we're on different versions, and the recent mingw-w64 update was after 4.2.0.

@mabrand, is harfbuzz building for you?

tonytheodore avatar Apr 10 '22 02:04 tonytheodore

It fails if mman-win32 is installed.

@danger89, do you know how to do:

ac_cv_header_sys_mman_h=no

with meson?

tonytheodore avatar Apr 10 '22 02:04 tonytheodore

This will fix it:

diff --git a/src/harfbuzz.mk b/src/harfbuzz.mk
index 50483440..f53f8b43 100644
--- a/src/harfbuzz.mk
+++ b/src/harfbuzz.mk
@@ -15,6 +15,8 @@ define $(PKG)_BUILD
         -Ddocs=disabled \
         -Dintrospection=disabled \
         '$(BUILD_DIR)' '$(SOURCE_DIR)'
+    # mman-win32 is only a partial implementation
+    $(SED) -i '/HAVE_SYS_MMAN_H/d' '$(BUILD_DIR)/config.h'
     '$(MXE_NINJA)' -C '$(BUILD_DIR)' -j '$(JOBS)'
     '$(MXE_NINJA)' -C '$(BUILD_DIR)' -j '$(JOBS)' install
 endef

but and option to meson would be better than sed.

tonytheodore avatar Apr 10 '22 02:04 tonytheodore

Confirmed. It fix the problem:

[done] lzo x86_64-w64-mingw32.shared 7112 KiB 0m32.223s [download] pixman-0.33.6.tar.gz [build] pixman x86_64-w64-mingw32.shared [done] pixman x86_64-w64-mingw32.shared 24364 KiB 0m25.300s [download] cairo-1.16.0.tar.xz [build] cairo x86_64-w64-mingw32.shared [done] cairo x86_64-w64-mingw32.shared 106440 KiB 1m5.008s [download] harfbuzz-4.2.0.tar.gz MXE Warning! Downloading harfbuzz from second URL. [build] harfbuzz x86_64-w64-mingw32.shared [done] harfbuzz x86_64-w64-mingw32.shared 102548 KiB 2m20.480s [build] freetype x86_64-w64-mingw32.shared [done] freetype x86_64-w64-mingw32.shared 28568 KiB 0m20.720s

cgilles avatar Apr 10 '22 11:04 cgilles

Actually, we're on different versions, and the recent mingw-w64 update was after 4.2.0.

@mabrand, is harfbuzz building for you?

Yes, it builds for me.

mabrand avatar Apr 11 '22 08:04 mabrand

I haven't been able to spot the difference that makes it work for me, but while I notice that ICU is detected during configuration if it's present. Should we add icu4c to the DEPS list for harfbuzz, at least for shared builds?

Unicode callbacks (you want at least one)
    Builtin          : YES
    Glib             : YES
    ICU              : NO

mabrand avatar Apr 11 '22 09:04 mabrand

@tonytheodore If this is a (cache) variable I would expect you just can use -D variable_name=value during a meson configure or meson setup step.

melroy89 avatar Apr 15 '22 15:04 melroy89

I would expect you just can use -D variable_name=value during a meson configure

Mmm... I can't seem to find any intermediate cache variable in meson, or work out what its name might be - it seems to simply create config.h.

Theres's a similar workaround in gtk3 that uses sed to change meson.build. If I add that to CFLAGS, it appears earlier in the invocation and is overridden by other flags meson adds.

tonytheodore avatar Apr 15 '22 15:04 tonytheodore

I haven't been able to spot the difference that makes it work for me

@mabrand, it fails if mman-win32 is installed.

Should we add icu4c to the DEPS list for harfbuzz

Hard to say, the message is "you want at least one", where font callbacks are "the more the merrier".

tonytheodore avatar Apr 15 '22 15:04 tonytheodore