Conversation
Provides full pthread and inter-thread messaging
|
Fine by me in principle, welcome even, but pthread on Android can be a bit strange and limited. If it compiles with any luck that means it'll work, but that'll need testing for sure. It needs testing on all platforms of course, but Android is Android. ;-) Btw, could you briefly describe why you picked Lanes specifically? It may also be worth noting that Turbo already lives in the codebase, see https://github.com/koreader/koreader/blob/e0c85306513eedb00eaa197d4c1f91dbcd78f6ec/defaults.lua#L189-L191, though it may or may not be fully functional at the time of writing. |
| # mupdf | ||
| declare_project(thirdparty/mupdf DEPENDS freetype2 harfbuzz libarchive libjpeg-turbo libwebp minizip zlib) | ||
|
|
||
| # mupdf |
|
My experience with lua-lanes, when trying to build it for use by luacheck in our docker images, is a whole lot of crashing, including when trying to run their testsuite to determine if the build was functional. And newer / development versions necessitating a C/C++ standard version we don't support on all targets. But that was a while ago, before our latest koxtoolchain update. Have you tried building for, say, |
Hello, |
|
Building :) on Android. on kindle-legacy. ONLY KOBO TESTED (running well) |
|
It still not quite what we want on Android: we need a static library so the module can be part of the monolibtic library. See #2132 for that. I ran into other issues when trying your code on Android:
diff --git i/frontend/ui/translator.lua w/frontend/ui/translator.lua
index 732ede478..2dbb08201 100644
--- i/frontend/ui/translator.lua
+++ w/frontend/ui/translator.lua
@@ -473,8 +473,10 @@ function Translator:loadPage(text, target_lang, source_lang)
end
if trapper_status == "error" then
- logger.warn("Translator async operation failed:", async_result.error_message or "Unknown error")
- logger.dbg("Error details:", async_result.code, async_result.headers, async_result.http_status, async_result.content)
+ logger.warn("Translator async operation failed:", async_result and async_result.error_message or "Unknown error")
+ if async_result then
+ logger.dbg("Error details:", async_result.code, async_result.headers, async_result.http_status, async_result.content)
+ end
return false, nil
end
diff --git i/frontend/ui/trapper.lua w/frontend/ui/trapper.lua
index 6224466b0..52b47cb2a 100644
--- i/frontend/ui/trapper.lua
+++ w/frontend/ui/trapper.lua
@@ -694,8 +694,12 @@ end
--- It integrates with a UI manager for scheduling and displaying messages.
---
-local lanes = require("lanes").configure()
-local linda = lanes.linda()
+local lanes = require("lanes").configure{
+ on_state_create = function()
+ require "ffi/loadlib"
+ end
+}
+local linda = lanes.linda()
-- ticket generator
local _next_ticket = 0
diff --git i/frontend/ui/trapper.lua w/frontend/ui/trapper.lua
index 6224466b0..eee27da03 100644
--- i/frontend/ui/trapper.lua
+++ w/frontend/ui/trapper.lua
@@ -694,8 +694,17 @@ end
--- It integrates with a UI manager for scheduling and displaying messages.
---
-local lanes = require("lanes").configure()
-local linda = lanes.linda()
+local ffi = require "ffi"
+local android_nativeLibraryDir = ffi.os == "Linux" and os.getenv("IS_ANDROID") and require("android").nativeLibraryDir
+local lanes = require("lanes").configure{
+ on_state_create = function()
+ if android_nativeLibraryDir then
+ package.loaded.android = { nativeLibraryDir = android_nativeLibraryDir }
+ end
+ require "ffi/loadlib"
+ end
+}
+local linda = lanes.linda()
-- ticket generator
local _next_ticket = 0But this obviously won't work if some code depends on the real Consequently, I don't think lanes is a viable option. |
Provides full pthread and inter-thread messaging
This change is