document-archive: services.paperless.settings.PAPERLESS_OCR_LANGUAGE rebuilds paperless-ngx from source for ANY value (55.7 min deploy with plain eng) — OCR choice must ride as unit environment #1290

Closed
opened 2026-09-07 18:14:08 +00:00 by ben · 0 comments
Owner

Drive 20260907T133810Z (#1277 run 10), deploy-document-archive green in 55.7 min with the eng-only default #1285 said would substitute.

Cause: the pinned nixpkgs module applies services.paperless.package as pkg.override { tesseract5 = tesseract5.override { enableLanguages = if cfg.settings ? PAPERLESS_OCR_LANGUAGE then [...] else null } } — it branches on the settings KEY's presence, so any value (eng included) makes paperless-ngx a new derivation; the guest compiled it 14:03→14:55 on 2 vCPUs (/nix/var/log/nix/drvs/…paperless-ngx-2.20.15.drv.bz2). #1285's inference was wrong.

Ruling (ADR 0174, two-way — Ben: veto anytime): the render never emits the settings key; a carried OCR choice rides as systemd.services.paperless-*.environment (the stock tesseract carries every traineddata, so it resolves at runtime and a change is a restart), the default renders nothing (Paperless's own eng). #1286's chooser becomes restart-class.

Landed: 96a3397c (render + tests; GOTCHAS #155 corrected, #183 added). Proof = the next drive's deploy-document-archive duration.

**Drive 20260907T133810Z (#1277 run 10), `deploy-document-archive` green in 55.7 min** with the eng-only default #1285 said would substitute. **Cause:** the pinned nixpkgs module applies `services.paperless.package` as `pkg.override { tesseract5 = tesseract5.override { enableLanguages = if cfg.settings ? PAPERLESS_OCR_LANGUAGE then [...] else null } }` — it branches on the settings KEY's presence, so any value (`eng` included) makes paperless-ngx a new derivation; the guest compiled it 14:03→14:55 on 2 vCPUs (`/nix/var/log/nix/drvs/…paperless-ngx-2.20.15.drv.bz2`). #1285's inference was wrong. **Ruling (ADR 0174, two-way — Ben: veto anytime):** the render never emits the settings key; a carried OCR choice rides as `systemd.services.paperless-*.environment` (the stock tesseract carries every traineddata, so it resolves at runtime and a change is a restart), the default renders nothing (Paperless's own eng). #1286's chooser becomes restart-class. **Landed:** `96a3397c` (render + tests; GOTCHAS #155 corrected, #183 added). Proof = the next drive's `deploy-document-archive` duration.
ben closed this issue 2026-09-07 18:14:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1290
No description provided.