From 5b2b558d2e836caf1c411d96951ee597dc27d6f8 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 8 Nov 2026 14:00:00 -0500 Subject: [PATCH] Handle exited OCR descendants in package checks --- distro-packages/Arch-Linux/cthulhu/.SRCINFO | 4 +++- distro-packages/Arch-Linux/cthulhu/PKGBUILD | 13 ++++++++++--- .../Arch-Linux/cthulhu/ocr-descendant-test.patch | 14 ++++++++++++++ internal/ocr/engine_test.go | 3 ++- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 distro-packages/Arch-Linux/cthulhu/ocr-descendant-test.patch diff --git a/distro-packages/Arch-Linux/cthulhu/.SRCINFO b/distro-packages/Arch-Linux/cthulhu/.SRCINFO index 3f9078d..2a8dd5f 100644 --- a/distro-packages/Arch-Linux/cthulhu/.SRCINFO +++ b/distro-packages/Arch-Linux/cthulhu/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = cthulhu pkgdesc = Desktop-agnostic screen reader with speech, Braille, and Tentacle support pkgver = 2026.10.31 - pkgrel = 5 + pkgrel = 6 url = https://git.stormux.org/storm/cthulhu arch = x86_64 arch = aarch64 @@ -36,7 +36,9 @@ pkgbase = cthulhu options = !debug options = !lto source = cthulhu::git+https://git.stormux.org/storm/cthulhu.git#tag=2026.10.31 + source = ocr-descendant-test.patch sha512sums = SKIP + sha512sums = d733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e optdepends_x86_64 = wine-access: Wine, Proton, NVDA Controller, and Tolk integration pkgname = cthulhu diff --git a/distro-packages/Arch-Linux/cthulhu/PKGBUILD b/distro-packages/Arch-Linux/cthulhu/PKGBUILD index 5d5bef7..5272356 100644 --- a/distro-packages/Arch-Linux/cthulhu/PKGBUILD +++ b/distro-packages/Arch-Linux/cthulhu/PKGBUILD @@ -3,7 +3,7 @@ pkgname=cthulhu pkgver=2026.10.31 -pkgrel=5 +pkgrel=6 pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support" url="https://git.stormux.org/storm/cthulhu" arch=(x86_64 aarch64 armv7h) @@ -54,8 +54,15 @@ makedepends=( ) options=(!debug !lto) # The release tag must exist upstream before makepkg can fetch this source. -source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}") -sha512sums=('SKIP') +source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}" + "ocr-descendant-test.patch") +sha512sums=('SKIP' + 'd733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e') + +prepare() { + cd "${pkgname}" + patch -Np1 -i "${srcdir}/ocr-descendant-test.patch" +} build() { cd "${pkgname}" diff --git a/distro-packages/Arch-Linux/cthulhu/ocr-descendant-test.patch b/distro-packages/Arch-Linux/cthulhu/ocr-descendant-test.patch new file mode 100644 index 0000000..e5c0c9f --- /dev/null +++ b/distro-packages/Arch-Linux/cthulhu/ocr-descendant-test.patch @@ -0,0 +1,14 @@ +diff --git a/internal/ocr/engine_test.go b/internal/ocr/engine_test.go +index 950983b..24f845a 100644 +--- a/internal/ocr/engine_test.go ++++ b/internal/ocr/engine_test.go +@@ -313,7 +313,8 @@ func TestEngineRetiresDescendantsHoldingPipes(t *testing.T) { + defer poll.Stop() + for { + status, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) +- if errors.Is(err, os.ErrNotExist) { ++ // A process exiting during the proc read can report ESRCH instead of ENOENT. ++ if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ESRCH) { + break + } + if err != nil { diff --git a/internal/ocr/engine_test.go b/internal/ocr/engine_test.go index 950983b..24f845a 100644 --- a/internal/ocr/engine_test.go +++ b/internal/ocr/engine_test.go @@ -313,7 +313,8 @@ func TestEngineRetiresDescendantsHoldingPipes(t *testing.T) { defer poll.Stop() for { status, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) - if errors.Is(err, os.ErrNotExist) { + // A process exiting during the proc read can report ESRCH instead of ENOENT. + if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ESRCH) { break } if err != nil {