Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix macOS build #11660

Merged
merged 3 commits into from
Apr 30, 2024
Merged

ci: fix macOS build #11660

merged 3 commits into from
Apr 30, 2024

Conversation

benoit-pierre
Copy link
Contributor

@benoit-pierre benoit-pierre commented Apr 10, 2024

Work around the fact that the lua@5.1 brew formula has been disabled.

Additionally, drop ragel (no necessary anymore).


This change is Reviewable

@Frenzie Frenzie added this to the 2024.04 milestone Apr 10, 2024
@benoit-pierre
Copy link
Contributor Author

o.O

2024-04-10T22:03:29.1639880Z CMake Error at /usr/local/Cellar/cmake/3.29.1/share/cmake/Modules/CMakeTestOBJCCompiler.cmake:64 (message):
2024-04-10T22:03:29.1641410Z -- Check for working OBJC compiler: /usr/local/bin/ccache - broken
2024-04-10T22:03:29.1642560Z   The Objective-C compiler
2024-04-10T22:03:29.1642870Z 
2024-04-10T22:03:29.1643010Z     "/usr/local/bin/ccache"
2024-04-10T22:03:29.1643290Z 
2024-04-10T22:03:29.1643500Z   is not able to compile a simple test program.
2024-04-10T22:03:29.1643930Z 
2024-04-10T22:03:29.1644100Z   It fails with the following output:
2024-04-10T22:03:29.1644450Z 
2024-04-10T22:03:29.1646650Z     Change Dir: '/Users/runner/work/koreader/koreader/base/thirdparty/sdl2/build/x86_64-apple-darwin22.6.0/sdl2-prefix/src/sdl2-build/CMakeFiles/CMakeScratch/TryCompile-VCVJW7'
2024-04-10T22:03:29.1648340Z     
2024-04-10T22:03:29.1649430Z     Run Build Command(s): /usr/local/Cellar/cmake/3.29.1/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_dd71e/fast
2024-04-10T22:03:29.1651430Z     /Applications/Xcode_15.0.1.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_dd71e.dir/build.make CMakeFiles/cmTC_dd71e.dir/build
2024-04-10T22:03:29.1652940Z     Building OBJC object CMakeFiles/cmTC_dd71e.dir/testObjCCompiler.m.o
2024-04-10T22:03:29.1657540Z     /usr/local/bin/ccache   -x objective-c  -o CMakeFiles/cmTC_dd71e.dir/testObjCCompiler.m.o -c /Users/runner/work/koreader/koreader/base/thirdparty/sdl2/build/x86_64-apple-darwin22.6.0/sdl2-prefix/src/sdl2-build/CMakeFiles/CMakeScratch/TryCompile-VCVJW7/testObjCCompiler.m
2024-04-10T22:03:29.1660840Z     ccache: error: missing equal sign in "CMakeFiles/cmTC_dd71e.dir/testObjCCompiler.m.o"

@benoit-pierre
Copy link
Contributor Author

See koreader/koreader-base#1771 for a fix for the SDL issue.

@benoit-pierre benoit-pierre changed the title ci: fix macOS build ci: partially fix macOS build Apr 14, 2024
@benoit-pierre benoit-pierre marked this pull request as ready for review April 14, 2024 20:37
@ryanwwest
Copy link
Contributor

ryanwwest commented Apr 23, 2024

Would this do anything to fix the constant 'koreader quit unexpectedly' error message in the MacOS version? For the last year this just shows up even if the app doesn't actually quit and reappears whenever I click 'Ignore', so I just drag it to the corner of the screen and use KOReader normally (which is way buggier than Android but sometimes works).

image

@Frenzie
Copy link
Member

Frenzie commented Apr 23, 2024

Would this do anything to fix the constant 'koreader quit unexpectedly' error message in the MacOS version?

No, it's just to get it to build.

For the last year this just shows up even if the app doesn't actually quit and reappears whenever I click 'Ignore'

You don't mean it's restarted or anything, just a weird random message?

@ryanwwest
Copy link
Contributor

Well, it has an error log output, but it's for an outdated version of KOReader (2023.06). I just downloaded the latest generated MacOS build I could find which is from 2024.01 and that immediate failure message doesn't show up. But then I remembered why I've been sticking with the outdated one—whenever I try to open any file on the newest version, it displays in-app error "No reader engine for this file or invalid file". Maybe there's something to do inside the package contents to move around some binary paths, but since it didn't work out of box I've just been sticking to the older one.

I can send you the older version log if you want, but might not be relevant anymore.

@Frenzie
Copy link
Member

Frenzie commented Apr 23, 2024

If you can send logs from exactly when it happens there's a chance it's of some interest but it's probably better to wait until after this is finished.

Edit: which with koreader/koreader-base#1771 it probably is.

@Frenzie Frenzie modified the milestones: 2024.04, 2024.05 Apr 23, 2024
Work around the fact that the lua@5.1 brew formula has been disabled.

Additionally, drop ragel (no necessary anymore).
Use the same parameters as for the koreader-base job (faster).
Reduce differences with the configuration used on koreader-base.
@benoit-pierre benoit-pierre changed the title ci: partially fix macOS build ci: fix macOS build Apr 30, 2024
@Frenzie Frenzie merged commit 087ddd1 into koreader:master Apr 30, 2024
2 checks passed
@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

Thanks a lot!

@benoit-pierre benoit-pierre deleted the pr/fix_macos_ci branch April 30, 2024 21:08
@benoit-pierre
Copy link
Contributor Author

From the traces when platform/mac/do_mac_bundle.sh is run I'm not sure the resulting build is functional:

cp: /usr/local/opt/libsodium/lib/libsodium.23.dylib: No such file or directory
chmod: libs/libsodium.23.dylib: No such file or directory
error: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libs/libsodium.23.dylib (No such file or directory)
error: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libs/libglib-2.0.dylib (No such file or directory)
error: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libs/libfmq.1.dylib (No such file or directory)
error: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libs/libzyre.1.dylib (No such file or directory)

@benoit-pierre
Copy link
Contributor Author

libglib-2.0.dylib is out (compiled statically), libintl.8.dylib too.

For libsodium.23.dylib, I would disable the dependency, but the autotools build does not support the same option as the cmake build: using the vendored-in tweetnacl library.

I don't know about libfmq.1.dylib and libzyre.1.dylib, dependencies of libsodium?

From past experience, something like python -m macholib standalone (from this package) would be a better alternative than hard-coding those things.

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

If you know of something that works and it's not too much effort, sounds good to me.

@benoit-pierre
Copy link
Contributor Author

OK, but I have some CI changes I'd prefer too PR first (to improve caching on CircleCI and add some caching to the macOS build).

And I'll need someone to test the result, as I don't have access to a macOS machine.

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

I have an old Macbook Air M1 with a broken screen I can test some things on, but it might be faster to ask if @ryanwwest is willing to lend a hand, depending on the question.

@ryanwwest
Copy link
Contributor

I'm happy to help test, but separated from my Macbook until Thursday.

@benoit-pierre
Copy link
Contributor Author

OK, thanks.

@benoit-pierre
Copy link
Contributor Author

@ryanwwest: could you give this build a try?

Known issues (from introspecting the result):

  • Why are we packaging the system tar instead of building & shipping our own? The system one depends on /usr/lib/libarchive.2.dylib, which might be present on a normal macOS system, but is missing when using Darling.
  • The runtime libs/path for sdcv does not look right (but the system probably has a compatible zlib, so it should still work):
sdcv:
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2048.1.255)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61040.1.3)
        @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.3.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1600.151.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

@ryanwwest
Copy link
Contributor

ryanwwest commented May 8, 2024

@benoit-pierre That build immediately crashes for me, the UI doesn't show up. I'm not sure how to get logs for that type of thing, maybe I can invoke it via terminal rather than double-clicking the app in the finder..

Edit: I can start it from the terminal with open but that doesn't give extra logs.

I have a MacBook Pro with M1 Max processor.

@benoit-pierre
Copy link
Contributor Author

I'm not sure how to get more traces. Does the latest master build work?

@benoit-pierre
Copy link
Contributor Author

I think you should be able to execute ./KOReader.app/Contents/MacOS/koreader directly.

@ryanwwest
Copy link
Contributor

Well, the latest build gets further... As I've mentioned earlier, it won't let me actually open documents, gives the error below. And I went to search for the menu item to enable logging using the Menu search, and searching 'log' itself actually crashed the app.

image

I'll run it directly next as you said.

@ryanwwest
Copy link
Contributor

Log running the previous build (not latest master):

rw@:~/Downloads$ ./KOReader.app/Contents/MacOS/koreader
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 05/07/24-19:21:20
 [*] Version: v2024.04-36-g978330a8_2024-05-08

ffi.load: libs/libutf8proc.3.dylib
ffi.load: blitbuffer
ffi.load: libs/libSDL2.dylib
ffi.load: SDL2
Starting SDL in /Users/rw/Downloads/KOReader.app/
ffi.load: libs/liblodepng.dylib
05/07/24-19:21:21 INFO  initializing for device Mac OS X 
05/07/24-19:21:21 INFO  framebuffer resolution: {
  h = 1848,
  w = 2140
} --[[table: 0x010969c3c0]] 
ffi.load: libs/libmupdf.dylib
ffi.load: libs/libwrap-mupdf.so
ffi.load (warning): dlopen(libs/libwrap-mupdf.so, 0x0005): tried: '/Users/ryanwest/Documents/GitHub/indy-sdk/libindy/target/debug/libwrap-mupdf.so' (no such file), '/Users/rw/Downloads/KOReader.app/Contents/MacOS/libs/libs/libwrap-mupdf.so' (no such file), '/Users/rw/Downloads/KOReader.app/Contents/MacOS/../koreader/libs/libs/libwrap-mupdf.so' (no such file), '/Users/rw/Downloads/KOReader.app/Contents/MacOS/libs/libs/libwrap-mupdf.so' (no such file), '/Users/rw/Downloads/KOReader.app/Contents/MacOS/../koreader/libs/libs/libwrap-mupdf.so' (no such file), 'libs/libwrap-mupdf.so' (no such file), '/Users/ryanwest/Documents/GitHub/indy-sdk/libindy/target/debug/libwrap-mupdf.so' (no such file), '/Users/rw/Downloads/KOReader.app/Contents/koreader/libs/libwrap-mupdf.so' (no such file)
failed to run lua chunk: ./setupkoenv.lua:27: Not able to load dynamic library: libs/libwrap-mupdf.so

That last line definitely has some unrelated missing files like from indy-sdk that you can ignore. But other parts of the line are relevant.

@benoit-pierre
Copy link
Contributor Author

Can you rename KOReader.app/Contents/koreader/libs/libs/libwrap-mupdf.dylib to KOReader.app/Contents/koreader/libs/libs/libwrap-mupdf.so and try again?

@ryanwwest
Copy link
Contributor

I ran:

rw@:~/Downloads/KOReader.app/Contents/koreader/libs$ ls
libSDL2.dylib*           libfribidi.0.dylib*      libkoreader-djvu.dylib*  libluajit.dylib*         libssl.1.1.dylib*        libwebpdemux.2.dylib*
libblitbuffer.dylib*     libgif.7.dylib*          libkoreader-lfs.so*      liblunasvg.dylib*        libtesseract.3.dylib*    libwrap-mupdf.dylib*
libcrypto.1.1.dylib*     libharfbuzz.0.dylib*     libkoreader-nnsvg.dylib* libmupdf.dylib*          libturbojpeg.dylib*      libz.1.dylib*
libczmq.1.dylib*         libjpeg.8.dylib*         libkoreader-xtext.dylib* libpng16.16.dylib*       libunibreak.6.dylib*     libzmq.4.dylib*
libdjvulibre.21.dylib*   libk2pdfopt.2.dylib*     liblept.5.dylib*         libsharpyuv.0.dylib*     libutf8proc.3.dylib*     libzstd.1.dylib*
libfreetype.6.dylib*     libkoreader-cre.dylib*   liblodepng.dylib*        libsqlite3.dylib*        libwebp.7.dylib*
rw@:~/Downloads/KOReader.app/Contents/koreader/libs$ mv libwrap-mupdf.dylib libwrap-mupdf.so

Error log:

rw@:~/Downloads/KOReader.app/Contents$ MacOS/koreader 
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 05/07/24-19:27:36
 [*] Version: v2024.04-36-g978330a8_2024-05-08

ffi.load: libs/libutf8proc.3.dylib
ffi.load: blitbuffer
ffi.load: libs/libSDL2.dylib
ffi.load: SDL2
Starting SDL in /Users/rw/Downloads/KOReader.app/
ffi.load: libs/liblodepng.dylib
05/07/24-19:27:37 INFO  initializing for device Mac OS X 
05/07/24-19:27:37 INFO  framebuffer resolution: {
  h = 1848,
  w = 2140
} --[[table: 0x010b85d360]] 
ffi.load: libs/libmupdf.dylib
ffi.load: libs/libwrap-mupdf.so
ffi.load: sqlite3
failed to run lua chunk: frontend/ui/bidi.lua:60: module 'libs/libkoreader-xtext' not found:
	no field package.preload['libs/libkoreader-xtext']
	no file 'common/libs/libkoreader-xtext.lua'
	no file 'frontend/libs/libkoreader-xtext.lua'
	no file './libs/libkoreader-xtext.lua'
	no file '/usr/local/share/luajit-2.1/libs/libkoreader-xtext.lua'
	no file '/usr/local/share/lua/5.1/libs/libkoreader-xtext.lua'
	no file '/usr/local/share/lua/5.1/libs/libkoreader-xtext/init.lua'
	no file 'common/libs/libkoreader-xtext.so'
	no file 'common/libs/libkoreader-xtext.dll'
	no file '/usr/lib/lua/libs/libkoreader-xtext.so'
	no file './libs/libkoreader-xtext.so'
	no file '/usr/local/lib/lua/5.1/libs/libkoreader-xtext.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'

@benoit-pierre
Copy link
Contributor Author

benoit-pierre commented May 8, 2024

OK, wrong extension again. Let me do a full pass…

@benoit-pierre
Copy link
Contributor Author

Try this build.

@ryanwwest
Copy link
Contributor

Opens, but same error not opening files. Menu search works. Log, when attempting to open a pdf:

rw@:~/Downloads/KOReader 3.app/Contents$ MacOS/koreader 
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 05/07/24-20:12:38
 [*] Version: v2024.04-37-g89196c8c_2024-05-08

ffi.load: libs/libutf8proc.3.dylib
ffi.load: blitbuffer
ffi.load: libs/libSDL2.dylib
ffi.load: SDL2
Starting SDL in /Users/rw/Downloads/KOReader 3.app/
ffi.load: libs/liblodepng.dylib
05/07/24-20:12:38 INFO  initializing for device Mac OS X 
05/07/24-20:12:38 INFO  framebuffer resolution: {
  h = 1848,
  w = 2140
} --[[table: 0x010b89f2c0]] 
ffi.load: libs/libmupdf.dylib
ffi.load: libs/libwrap-mupdf.so
ffi.load: sqlite3
ffi.load: libs/libfreetype.6.dylib
ffi.load: libs/libharfbuzz.0.dylib
ffi.load: libs/libzstd.1.dylib
05/07/24-20:12:38 INFO  Loading plugins from directory: plugins 
05/07/24-20:12:39 WARN  fts: Attemped to call boottime on a platform where it's unsupported! 
05/07/24-20:12:39 INFO  opening file /Users/rw/s/zk/docs/tmp/powder proposal 2022.pdf 
ffi.load: libs/liblept.5.dylib
ffi.load (warning): dlopen(libs/liblept.5.dylib, 0x0005): Library not loaded: '@rpath/png.framework/Versions/1.6.41/png'
  Referenced from: '/Users/rw/Downloads/KOReader 3.app/Contents/koreader/libs/liblept.5.dylib'
  Reason: tried: '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/../koreader/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/../koreader/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/../koreader/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/libs/png.framework/Versions/1.6.41/png' (no such file), '/Users/rw/Downloads/KOReader 3.app/Contents/MacOS/../koreader/libs/png.framework/Versions/1.6.41/png' (no such file), '/Library/Frameworks/png.framework/Versions/1.6.41/png' (no such file), '/System/Library/Frameworks/png.framework/Versions/1.6.41/png' (no such file)
05/07/24-20:12:39 WARN  cannot open document /Users/rw/s/zk/docs/tmp/powder proposal 2022.pdf ./setupkoenv.lua:27: Not able to load dynamic library: libs/liblept.5.dylib 

@benoit-pierre
Copy link
Contributor Author

benoit-pierre commented May 8, 2024

\o/ progress!

For some reason the build is selecting the framework version of libpng, and not our version:

Found PNG: /Users/runner/work/koreader/koreader/base/build/staging/lib/png.framework (found version "1.4.12")

What about opening an EPUB?

@ryanwwest
Copy link
Contributor

Ah you're right, epub, txt and html all work fine! Only PDFs are failing to open.

@benoit-pierre
Copy link
Contributor Author

Also, does dictionary lookups work? Does downloading a dictionary work?

@ryanwwest
Copy link
Contributor

All of that seems to work. And I'm very surprised that external dictionary opens up Apple's native dictionary app.

@benoit-pierre
Copy link
Contributor Author

And this one should hopefully take care of the PDF issue.

@ryanwwest
Copy link
Contributor

I thought it was solved but eventually found two PDFs where it still breaks. First one (first log) throws the error, second one crashes the program. ~30 other PDFs open fine. All PDFs and these two problematic ones open fine on my KOReader Android.

rw@:~/Downloads/KOReader 4.app/Contents$ MacOS/koreader 
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 05/07/24-21:21:40
 [*] Version: v2024.04-37-g96d64ade_2024-05-08

ffi.load: libs/libutf8proc.3.dylib
ffi.load: blitbuffer
ffi.load: libs/libSDL2.dylib
ffi.load: SDL2
Starting SDL in /Users/rw/Downloads/KOReader 4.app/
ffi.load: libs/liblodepng.dylib
05/07/24-21:21:40 INFO  initializing for device Mac OS X 
05/07/24-21:21:40 INFO  framebuffer resolution: {
  h = 1848,
  w = 2140
} --[[table: 0x010d111408]] 
ffi.load: libs/libmupdf.dylib
ffi.load: libs/libwrap-mupdf.so
ffi.load: sqlite3
ffi.load: libs/libfreetype.6.dylib
ffi.load: libs/libharfbuzz.0.dylib
ffi.load: libs/libzstd.1.dylib
05/07/24-21:21:41 INFO  Loading plugins from directory: plugins 
05/07/24-21:21:43 WARN  fts: Attemped to call boottime on a platform where it's unsupported! 
05/07/24-21:21:50 INFO  opening file /Users/rw/s/zk/docs/tmp/paper.pdf 
ffi.load: libs/liblept.5.dylib
ffi.load: libs/libk2pdfopt.2.dylib
05/07/24-21:21:50 INFO  Inhibiting user input 
[!] doShowReader coroutine crashed:
frontend/apps/reader/modules/readerannotation.lua:45: attempt to index field 'pos0' (a nil value)
stack traceback:
	frontend/apps/reader/modules/readerannotation.lua:80: in function 'getAnnotationsFromBookmarksHighlights'
	frontend/apps/reader/modules/readerannotation.lua:212: in function 'migrateToAnnotations'
	frontend/apps/reader/modules/readerannotation.lua:131: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	frontend/apps/reader/readerui.lua:467: in function 'init'
	frontend/ui/widget/widget.lua:46: in function 'new'
	frontend/apps/reader/readerui.lua:676: in function 'doShowReader'
	frontend/apps/reader/readerui.lua:629: in function <frontend/apps/reader/readerui.lua:628>05/07/24-21:21:50 INFO  Restoring user input handling 

Second one is 23MB, which seems to be too much for some cache?

rw@:~/Downloads/KOReader 4.app/Contents$ MacOS/koreader 
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 05/07/24-21:29:57
 [*] Version: v2024.04-37-g96d64ade_2024-05-08

ffi.load: libs/libutf8proc.3.dylib
ffi.load: blitbuffer
ffi.load: libs/libSDL2.dylib
ffi.load: SDL2
Starting SDL in /Users/rw/Downloads/KOReader 4.app/
ffi.load: libs/liblodepng.dylib
05/07/24-21:29:57 INFO  initializing for device Mac OS X 
05/07/24-21:29:57 INFO  framebuffer resolution: {
  h = 1848,
  w = 2140
} --[[table: 0x010d748a80]] 
ffi.load: libs/libmupdf.dylib
ffi.load: libs/libwrap-mupdf.so
ffi.load: sqlite3
ffi.load: libs/libfreetype.6.dylib
ffi.load: libs/libharfbuzz.0.dylib
ffi.load: libs/libzstd.1.dylib
05/07/24-21:29:57 INFO  Loading plugins from directory: plugins 
05/07/24-21:29:59 WARN  fts: Attemped to call boottime on a platform where it's unsupported! 
05/07/24-21:29:59 INFO  opening file /Users/rw/s/zk/docs/tmp-docs/test/a.pdf 
ffi.load: libs/liblept.5.dylib
ffi.load: libs/libk2pdfopt.2.dylib
05/07/24-21:29:59 INFO  Inhibiting user input 
05/07/24-21:29:59 INFO  setting zoom mode to page 
05/07/24-21:30:00 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
05/07/24-21:30:01 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
05/07/24-21:30:01 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
failed to run lua chunk: frontend/document/koptinterface.lua:367: aborting, since we don't have enough cache for this page
Segmentation fault: 11

@benoit-pierre
Copy link
Contributor Author

rw@:~/Downloads/KOReader 4.app/Contents$ MacOS/koreader 
[…]
05/07/24-21:21:50 INFO  Inhibiting user input 
[!] doShowReader coroutine crashed:
frontend/apps/reader/modules/readerannotation.lua:45: attempt to index field 'pos0' (a nil value)
stack traceback:
	frontend/apps/reader/modules/readerannotation.lua:80: in function 'getAnnotationsFromBookmarksHighlights'
	frontend/apps/reader/modules/readerannotation.lua:212: in function 'migrateToAnnotations'
	frontend/apps/reader/modules/readerannotation.lua:131: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	frontend/apps/reader/readerui.lua:467: in function 'init'
	frontend/ui/widget/widget.lua:46: in function 'new'
	frontend/apps/reader/readerui.lua:676: in function 'doShowReader'
	frontend/apps/reader/readerui.lua:629: in function <frontend/apps/reader/readerui.lua:628>05/07/24-21:21:50 INFO  Restoring user input handling 

An issue with annotations, I'm pretty sure this has nothing to do with the macOS version. Might be already fixed in master.

Second one is 23MB, which seems to be too much for some cache?

rw@:~/Downloads/KOReader 4.app/Contents$ MacOS/koreader 

[…]
05/07/24-21:30:00 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
05/07/24-21:30:01 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
05/07/24-21:30:01 WARN  Too much memory would be claimed by caching kctx|/Users/rw/s/zk/docs/tmp-docs/test/a.pdf|1649378188|12|0|1|1|1|eng|0.05|1.3|0|1|0|3|1.2|2|8|0.1|0|0|1|0|0|1|1|-0.2|0|7|1.5|4|2|36|36|2|82.1796875|69.957946777344|583|757.91967773438|2140|1848 
failed to run lua chunk: frontend/document/koptinterface.lua:367: aborting, since we don't have enough cache for this page
Segmentation fault: 11

That one I don't know. You say it works on Android? Not with the same settings I assume?

@benoit-pierre
Copy link
Contributor Author

benoit-pierre commented May 8, 2024

And does that second PDF work with your old version of koreader?

Additionally, what about your initial issue:

constant 'koreader quit unexpectedly' error message

Still present?

@ryanwwest
Copy link
Contributor

Actually, just tested that second PDF on the old version AND latest version of KOReader and now it opens find on each... maybe my system was low on memory (doubtful as it's 32GB RAM but possible).

And no, that message is gone :)

Aside from the few issues we've been working out, MacOS works pretty well. It would be awesome if at some point we officially released it as a supported platform.

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.

None yet

3 participants