Skip to content

fontlist: support WOFF and WOFF2 fonts#14455

Merged
Frenzie merged 1 commit into
koreader:masterfrom
benoit-pierre:pr/fontlist_woff_and_woff2_support
Oct 16, 2025
Merged

fontlist: support WOFF and WOFF2 fonts#14455
Frenzie merged 1 commit into
koreader:masterfrom
benoit-pierre:pr/fontlist_woff_and_woff2_support

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Oct 13, 2025

Copy link
Copy Markdown
Member

This change is Reviewable

@benoit-pierre

benoit-pierre commented Oct 13, 2025

Copy link
Copy Markdown
Member Author

TODO:

@Frenzie Frenzie added this to the 2025.10 milestone Oct 13, 2025
@Commodore64user

Commodore64user commented Oct 13, 2025

Copy link
Copy Markdown
Member

Who let the dogs fonts out?
Woff? woff? Woff?

I'll see myself out.

@mergen3107

Copy link
Copy Markdown
Contributor

You beat me to it :D

@benoit-pierre

Copy link
Copy Markdown
Member Author

We regularly see this failure with the macOS ARM64 build:

Summary of Failures:

43/73 koreader-testrunner:front / persist                 FAIL             0.60s   killed by signal 11 SIGSEGV

Ok:                72  
Fail:              1   

Can someone reproduce locally?

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

I'll try if the build finishes within the next 15 minutes or so.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

Bad news on the compilation front, some error about _LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE instead. I'll try a full clean.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

No, it said it again despite starting from scratch.

This is because either HarfBuzz or our usage of HarfBuzz includes -D_LIBCPP_ENABLE_ASSERTIONS=1.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member
      | [harfbuzz   6%] Compiling C++ object src/libharfbuzz.0.dylib.p/hb-draw.cc.o
FAILED: src/libharfbuzz.0.dylib.p/hb-draw.cc.o 
env clang++ -Isrc/libharfbuzz.0.dylib.p -Isrc -I../source/src -I. -I../source -I/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/staging/include/freetype2 -I/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/staging/include -fdiagnostics-color=always -D_LIBCPP_ENABLE_ASSERTIONS=1 -Wall -Winvalid-pch -std=c++11 -fno-exceptions -O0 -g -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -Og -g -pipe -fno-omit-frame-pointer -idirafter /usr/local/include -ffile-prefix-map=/Users/xxx/src/koreader/base/= -Wno-ignored-optimization-argument -Wno-unknown-warning-option -Wno-array-bounds -Wno-unused-command-line-argument -Wno-self-assign -Wno-parentheses-equality -Wno-macro-redefined -std=gnu++17 -mcpu=apple-m1 -fPIC -MD -MQ src/libharfbuzz.0.dylib.p/hb-draw.cc.o -MF src/libharfbuzz.0.dylib.p/hb-draw.cc.o.d -o src/libharfbuzz.0.dylib.p/hb-draw.cc.o -c ../source/src/hb-draw.cc
In file included from ../source/src/hb-draw.cc:25:
In file included from ../source/src/hb.hh:191:
In file included from ../source/src/hb.h:31:
In file included from ../source/src/hb-blob.h:34:
In file included from ../source/src/hb-common.h:66:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/inttypes.h:241:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:49:6: error: "_LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE instead"
   49 | #    error "_LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE instead"
      |      ^

@benoit-pierre

Copy link
Copy Markdown
Member Author

Weird, where is that flag coming from? Anything if you grep the build/…/staging or build/…/thirdparty directories?

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

It looks like it's a combination of a mildly older Meson and a newer macOS issue. Updating to 1.9.1 (from 1.7.0) seems to have done the trick, assuming I'm not speaking too quickly.

apache/arrow#46690

@benoit-pierre

Copy link
Copy Markdown
Member Author

I assume that's with KODEBUG=1 (that could explain the difference with the CI), can you check with KODEBUG=?

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

Can someone reproduce locally?

I ran this for a few minutes:

while ./kodev test front; do echo yay; done

I was about to say it doesn't look like it's doing any crashing, but then suddenly:

42/73 koreader-testrunner:front / persist                         FAIL             0.30s   killed by signal 11 SIGSEGV
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 LSAN_OPTIONS=exitcode=0 MALLOC_PERTURB_=74 MESON_TEST_ITERATION=1 KO_HOME=/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/spec/run/front_persist MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 /Users/xxx/src/koreader/koreader-emulator-arm64-apple-darwin25.0.0-debug/koreader/luajit -e 'require "busted.runner" {standalone = false}' /dev/null --output=gtest -Xoutput=--color --run=front spec/front/unit/persist_spec.lua --config-file=spec/config.lua --exclude-tags=notest --helper=spec/helper.lua --loaders=lua --lazy
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
has monolibtic? no (dlopen(libs/libkoreader-monolibtic.dylib, 0x0005): tried: 'libs/libkoreader-monolibtic.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/libs/libs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/koreader/libs/libs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/libs/libs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/koreader/libs/libs/libkoreader-monolibtic.dylib' (no such file), '/usr/lib/libs/libkoreader-monolibtic.dylib' (no such file, not in dyld cache), 'libs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/libs/libkoreader-monolibtic.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/libs/libkoreader-monolibtic.dylib' (no such file), '/Users/xxx/src/koreader/base/build/arm64-apple-darwin25.0.0-debug/libs/libkoreader-monolibtic.dylib' (no such file))
lib_search_path: libs/?;/opt/homebrew/lib/?
lib_basic_format: lib%s.dylib
lib_version_format: lib%s.%s.dylib

I'll rerun it a few times with a counter to see if there's any type of regularity to it. I wonder if it could be something like too many open files? But I don't know where to check those kinds of things on macOS.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

We're on 27 iterations by now, so I think it's safe to say there's no clear regularity to it.

cnt=0; while ./kodev test front; do ((cnt++)); echo "yay $cnt"; done

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

It happened again by the 47th iteration. But trying again this time it was immediate. Let me see if I can get the full log from that Mac somehow.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

testlog.txt

@benoit-pierre

Copy link
Copy Markdown
Member Author

On Linux, you could use something like this:

▸ ./kodev test -w "gdb -ex run -ex bt -ex quit --batch --args" --meson=-i -v persist

On macOS, maybe something like this?

▸ ./kodev test -w "lldb --one-line run --one-line quit --one-line-on-crash bt run --batch --" --meson=-i -v persist

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

It says 'run' does not exist. Maybe it needs to be supplied with a command somehow?

@Commodore64user

Copy link
Copy Markdown
Member

Brother is ARMs @kodermike might be of some help here, I believe he too has an emulator on Mx machines.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

Anyway, I'm headed off to bed. Maybe one of the actual Mac users will be able to assist quicker, otherwise you might have to exercise some patience until I can test again. ^_^

@benoit-pierre

Copy link
Copy Markdown
Member Author

Better Linux command ./kodev test -w 'gdb --batch -ex run -ex bt -return-child-result -ex quit --args' --meson=-i -v persist.

@benoit-pierre

Copy link
Copy Markdown
Member Author

Yeah, I got the macOS command from a quick look at one macOS LLDB man page. I'm not sure of the syntax.

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

PS The Linux commands both work fine. Nothing to report there afaict.

@benoit-pierre

Copy link
Copy Markdown
Member Author

Some stray run in there, this works on Linux:

./kodev test -w 'lldb --batch --one-line run --one-line-on-crash bt --one-line quit --' --meson=-i -v persist

@Frenzie

Frenzie commented Oct 13, 2025

Copy link
Copy Markdown
Member

Annoyingly I just shut down the Mac, but it is midnight so that's a good thing really. ;-)

@benoit-pierre

Copy link
Copy Markdown
Member Author

It will stop on crash however. Can't find a LLDB equivalent for GDB -return-child-result.

@benoit-pierre

benoit-pierre commented Oct 13, 2025

Copy link
Copy Markdown
Member Author

I'm dumb: ./kodev test -w 'lldb --batch --one-line run --one-line-on-crash bt --one-line-on-crash quit\ 1 --one-line quit --' --meson=-i -v persist.

Enough to run in batch mode and still trip the testsuite, even if the exit code is not correct.

@Commodore64user

Copy link
Copy Markdown
Member

I'm dumb:

welcome to the club

@kodermike

Copy link
Copy Markdown
Contributor

I'm dumb:

welcome to the club

hold my 🍺 ...

Sadly, my Mx went with the layoff. I can run on an x86, but I think you have that base covered.

@Frenzie

Frenzie commented Oct 14, 2025

Copy link
Copy Markdown
Member

The 59th run failed:

Process 10849 launched: '/Users/rambla/src/koreader/koreader-emulator-arm64-apple-darwin25.0.0-debug/koreader/luajit' (arm64)
Process 10849 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x0000000191506c70 libunwind.dylib`unw_set_reg + 340
libunwind.dylib`unw_set_reg:
->  0x191506c70 <+340>: ldr    w8, [x22, #0x8]
    0x191506c74 <+344>: and    w8, w8, #0xffffff
    0x191506c78 <+348>: cmp    w8, #0x2
    0x191506c7c <+352>: b.ne   0x191506cac    ; <+400>
Target 0: (luajit) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x0000000191506c70 libunwind.dylib`unw_set_reg + 340
    frame #1: 0x0000000100063148 luajit`err_unwind_jit(version=<unavailable>, actions=<unavailable>, uexclass=5500374307216568834, uex=<unavailable>, ctx=<unavailable>) at lj_err.c:541:7 [opt]
    frame #2: 0x0000000191507bd8 libunwind.dylib`unwind_phase2 + 604
    frame #3: 0x0000000191507964 libunwind.dylib`_Unwind_RaiseException + 800
    frame #4: 0x0000000100006770 luajit`err_raise_ext(g=<unavailable>, errcode=<unavailable>) at lj_err.c:758:3 [opt] [inlined]
    frame #5: 0x0000000100006730 luajit`lj_err_throw(L=0x00000001000b4380, errcode=<unavailable>) at lj_err.c:774:3 [opt]
    frame #6: 0x00000001000068bc luajit`lj_err_run(L=<unavailable>) at lj_err.c:899:3 [opt]
    frame #7: 0x0000000100007114 luajit`lj_err_callermsg(L=0x00000001000b4380, msg=<unavailable>) at lj_err.c:1028:3 [opt]
    frame #8: 0x00000001000110e8 luajit`lj_err_callerv(L=0x00000001000b4380, em=<unavailable>) at lj_err.c:1039:3 [opt]
    frame #9: 0x000000010002f9d0 luajit`serialize_put(w="ot serialize 'function's a minimum of 2 arguments, got: 2ected, got nil)) 'str' (a nil value)should fail to serialize functions\U0000001b[0m\nms)\n99\t\U00000004!a(sample 5!d\U00000006\U00000005", sbx=<unavailable>, o=0x0000000104b4b7b0) at lj_serialize.c:332:5 [opt]
    frame #10: 0x000000010002fb5c luajit`serialize_put(w=<unavailable>, sbx=<unavailable>, o=<unavailable>) at lj_serialize.c:271:10 [opt]
    frame #11: 0x0000000100019428 luajit`lj_serialize_encode(L=0x00000001000b4380, o=<unavailable>) at lj_serialize.c:492:7 [opt]
    frame #12: 0x00000001000f6d2c
    frame #13: 0x0000000100016870 luajit`lua_pcall(L=<unavailable>, nargs=<unavailable>, nresults=<unavailable>, errfunc=<unavailable>) at lj_api.c:1151:12 [opt]
    frame #14: 0x00000001000015a4 luajit`docall(L=0x00000001000b4380, narg=<unavailable>, clear=1) at luajit.c:137:12 [opt]
    frame #15: 0x00000001000014c4 luajit`dostring(L=0x00000001000b4380, s="require \"busted.runner\" {standalone = false}", name=<unavailable>) at luajit.c:191:58 [opt]
    frame #16: 0x0000000100000c34 luajit`runargs(L=0x00000001000b4380, argv=0x000000016fdfeb68, argn=3) at luajit.c:473:11 [opt]
    frame #17: 0x0000000100000b64 luajit`pmain(L=0x00000001000b4380) at luajit.c:561:15 [opt]
    frame #18: 0x0000000100003b1c luajit`lj_BC_FUNCC + 44
    frame #19: 0x00000001000168b4 luajit`lua_cpcall(L=<unavailable>, func=<unavailable>, ud=<unavailable>) at lj_api.c:1179:12 [opt]
    frame #20: 0x000000010000078c luajit`main(argc=13, argv=0x000000016fdfeb68) at luajit.c:596:12 [opt]
    frame #21: 0x0000000181875d54 dyld`start + 7184
(lldb) quit 1

log.txt

@benoit-pierre benoit-pierre force-pushed the pr/fontlist_woff_and_woff2_support branch from b3dc697 to 1ce4bb8 Compare October 16, 2025 22:38
@Frenzie Frenzie merged commit c7d4dfa into koreader:master Oct 16, 2025
4 checks passed
@benoit-pierre benoit-pierre deleted the pr/fontlist_woff_and_woff2_support branch October 16, 2025 23:16
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
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.

5 participants