Skip to content

Take odrcore 6, which has no decoder engines and binds its own port - #544

Merged
andiwand merged 1 commit into
mainfrom
update-odrcore-6
Jul 27, 2026
Merged

Take odrcore 6, which has no decoder engines and binds its own port#544
andiwand merged 1 commit into
mainfrom
update-odrcore-6

Conversation

@andiwand

@andiwand andiwand commented Jul 27, 2026

Copy link
Copy Markdown
Member

Pulls the conan-odr-index submodule up to 08a9adc (bump odrcore 6.0.1) and moves the app onto it.

with_pdf2htmlEX / with_wvWare are gone from the recipe — 6.0.0 dropped both backends, so the options that used to switch them off no longer exist. The android build is unchanged by that; it never had them. 6.0.1 is that release plus opendocument-app/OpenDocument.core#628, without which libodr_jni.so does not compile for any ABI.

Two pieces of the API the app talks to went with the same release:

  • DecoderEngine is gone entirely. With the external backends removed the enum had a single value and could not select anything, so open() drops the DecodePreference that named it. It only existed to keep engines that are not compiled in from being offered.
  • HttpServer splits listen(host, port) into bind(host, port) + listen(), and Config.cachePath went with serveFile. This app translates through Html.translate and passes the cache path there already, so the core/server cache directory is simply no longer created.

bind is what the port handling was missing. It returns the port it actually got and throws when it cannot bind — which is what the ServerSocket probe in front of listen was approximating — so the probe goes, and with it the reasoning about which socket options it had to be at least as strict as. The core sets SO_REUSEADDR now instead of cpp-httplib's SO_REUSEPORT, so a port held only by TIME_WAIT sockets can be bound again and only a live server of the other flavor still sends us to a free one.

Test

  • ./gradlew assembleProDebug testProDebugUnitTest lintProDebug spotlessApply — green.
  • ./gradlew connectedProDebugAndroidTest on a Pixel 6 Pro AVD — 12/12, including the ODT/DOCX edit round trips and the spreadsheet sheet names, all of which fetch from the server this PR rewires the binding of.

Both ran against odrcore 6 built for armv8, armv7, x86 and x86_64 (NDK 28.2.13676358, api 26) — first on 6.0.0 with #628 as a local recipe patch, and re-run on the released 6.0.1 that carries it.

🤖 Generated with Claude Code

https://claude.ai/code/session_015CX6aCCt9pM9WaTF5MwM5o

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a84be6283

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread app/conanfile.txt Outdated
The index commit adds an odrcore/6 recipe and pins 6.0.1: 6.0.0 drops the
pdf2htmlEX and wvWare backends, so `with_pdf2htmlEX` and `with_wvWare` no
longer exist as options and the two `=False` lines have to go with them - the
build is exactly what it already was, the options just stopped being the way to
ask for it. 6.0.1 is that release plus the android build fix in
opendocument-app/OpenDocument.core#628, without which `libodr_jni.so` does not
compile for any ABI.

Two things the app talks to went with that release:

- `DecoderEngine` is gone entirely. With the external backends removed the enum
  had one value left and could not select anything, so `open()` drops the
  `DecodePreference` that named it. It only ever existed to keep the engines
  that are not compiled in from being offered.
- `HttpServer` splits `listen(host, port)` into `bind(host, port)` and
  `listen()`, and `Config.cachePath` is gone with `serveFile` - what a service
  was translated into belongs to whoever translated it, and this app translates
  through `Html.translate` and hands the cache path there already.

`bind` is what the port dance was missing. It returns the port it actually got
and throws when it cannot bind, which is what the ServerSocket probe in front
of `listen` was approximating - so the probe goes, along with the reasoning
about which socket options it had to match. The core sets SO_REUSEADDR now
rather than cpp-httplib's SO_REUSEPORT, so a port held only by TIME_WAIT
sockets is bindable again and only a live server of the other flavor still
sends us to a free one.

Verified with the four ABIs built against odrcore 6: unit tests, lint, and the
12 instrumented tests on a Pixel 6 Pro AVD, which load and edit real documents
off that server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CX6aCCt9pM9WaTF5MwM5o
@andiwand
andiwand enabled auto-merge (squash) July 27, 2026 22:57
@andiwand
andiwand merged commit 246381a into main Jul 27, 2026
7 checks passed
@andiwand
andiwand deleted the update-odrcore-6 branch July 27, 2026 23:10
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.

1 participant