GNU bug report logs - #46376
[PATCH] gnu: tesseract-ocr: update to 4.1.1

Previous Next

Package: guix-patches;

Reported by: Andy Tai <atai <at> atai.org>

Date: Mon, 8 Feb 2021 06:45:01 UTC

Severity: normal

Tags: patch

Done: Jelle Licht <jlicht <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46376 in the body.
You can then email your comments to 46376 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Mon, 08 Feb 2021 06:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andy Tai <atai <at> atai.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 08 Feb 2021 06:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: tesseract-ocr: update to 4.1.1
Date: Sun, 7 Feb 2021 22:42:52 -0800
* gnu/packages/ocr.scm (tesseract-ocr): update to 4.1.1
---
 gnu/packages/ocr.scm | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/ocr.scm b/gnu/packages/ocr.scm
index dc4930918a..7fc3929684 100644
--- a/gnu/packages/ocr.scm
+++ b/gnu/packages/ocr.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Alex Vong <alexvong1995 <at> gmail.com>
+;;; Copyright © 2021 Andy Tai <atai <at> atai.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,7 +27,12 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages image))

@@ -52,25 +58,43 @@ it produces text in 8-bit or UTF-8 formats.")
     (license license:gpl3+)))

 (define-public tesseract-ocr
+  ;; some useful commits beyond last official stable release in release branch
+  (let ((commit "97079fa353557af6df86fd20b5d2e0dff5d8d5df"))
   (package
     (name "tesseract-ocr")
-    (version "3.04.01")
+    (version "4.1.1")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/tesseract-ocr/tesseract")
-              (commit version)))
-       (file-name (git-file-name name version))
+              (commit commit)
+              ;; Fetch git submodules otherwise typeshed is not fetched.
+              ;; Typeshed is a collection of Python sources type annotation
+              ;; (data) files.
+              (recursive? #t)))
+       (file-name (string-append name "-" version "-" commit "-checkout"))
        (sha256
-        (base32 "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv"))))
+        (base32 "0axwla82fpzp86lc553wp3hk0fz5dylw4as0jbf4hkqcyajlbzp4"))))
     (build-system gnu-build-system)
     (inputs
-     `(("leptonica" ,leptonica)))
+     `(  ("cairo" ,cairo)
+         ("icu" ,icu4c)
+         ("leptonica" ,leptonica)
+         ("pango" ,pango)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("autoconf-archive" ,autoconf-archive)
+       ("automake" ,automake)
+       ("googletest" ,googletest)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (arguments
      '(#:configure-flags
        (let ((leptonica (assoc-ref %build-inputs "leptonica")))
-         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
+         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))
+       ;; some test, applybox_test fails to build
+       #:tests? #f))
     (home-page "https://github.com/tesseract-ocr/tesseract")
     (synopsis "Optical character recognition engine")
     (description
@@ -79,7 +103,7 @@ high accuracy.  It supports many languages, output
text formatting, hOCR
 positional information and page layout analysis.  Several image formats are
 supported through the Leptonica library.  It can also detect whether text is
 monospaced or proportional.")
-    (license license:asl2.0)))
+    (license license:asl2.0))))

 (define-public zinnia
   (let* ((commit "581faa8f6f15e4a7b21964be3a5ec36265c80e5b")
--
2.30.0




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Mon, 08 Feb 2021 06:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: 46376 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Sun, 7 Feb 2021 22:51:45 -0800
* gnu/packages/ocr.scm (tesseract-ocr): update to 4.1.1
---
 gnu/packages/ocr.scm | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/ocr.scm b/gnu/packages/ocr.scm
index dc4930918a..b666ec5aab 100644
--- a/gnu/packages/ocr.scm
+++ b/gnu/packages/ocr.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Alex Vong <alexvong1995 <at> gmail.com>
+;;; Copyright © 2021 Andy Tai <atai <at> atai.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,7 +27,12 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages image))

@@ -52,25 +58,41 @@ it produces text in 8-bit or UTF-8 formats.")
     (license license:gpl3+)))

 (define-public tesseract-ocr
+  ;; some useful commits beyond last official stable release in release branch
+  (let ((commit "97079fa353557af6df86fd20b5d2e0dff5d8d5df"))
   (package
     (name "tesseract-ocr")
-    (version "3.04.01")
+    (version "4.1.1")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/tesseract-ocr/tesseract")
-              (commit version)))
-       (file-name (git-file-name name version))
+              (commit commit)
+              ;; Fetch git submodules
+              (recursive? #t)))
+       (file-name (string-append name "-" version "-" commit "-checkout"))
        (sha256
-        (base32 "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv"))))
+        (base32 "0axwla82fpzp86lc553wp3hk0fz5dylw4as0jbf4hkqcyajlbzp4"))))
     (build-system gnu-build-system)
     (inputs
-     `(("leptonica" ,leptonica)))
+     `(  ("cairo" ,cairo)
+         ("icu" ,icu4c)
+         ("leptonica" ,leptonica)
+         ("pango" ,pango)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("autoconf-archive" ,autoconf-archive)
+       ("automake" ,automake)
+       ("googletest" ,googletest)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
     (arguments
      '(#:configure-flags
        (let ((leptonica (assoc-ref %build-inputs "leptonica")))
-         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
+         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))
+       ;; some test, applybox_test fails to build
+       #:tests? #f))
     (home-page "https://github.com/tesseract-ocr/tesseract")
     (synopsis "Optical character recognition engine")
     (description
@@ -79,7 +101,7 @@ high accuracy.  It supports many languages, output
text formatting, hOCR
 positional information and page layout analysis.  Several image formats are
 supported through the Leptonica library.  It can also detect whether text is
 monospaced or proportional.")
-    (license license:asl2.0)))
+    (license license:asl2.0))))

 (define-public zinnia
   (let* ((commit "581faa8f6f15e4a7b21964be3a5ec36265c80e5b")
-- 
2.30.0




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Mon, 08 Feb 2021 22:38:01 GMT) Full text and rfc822 format available.

Message #11 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> posteo.net>
To: Andy Tai <atai <at> atai.org>, 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Mon, 08 Feb 2021 22:36:43 +0100
Hello Andy,

Thanks for working on this package! I was not able to cleanly apply any
of the patches, but that problem might be on my end though.

Something did seem to go wrong though, as I notice three patches that do
the same (from a quick glance).

I have some nitpicks, some of them more serious than others;

Andy Tai <atai <at> atai.org> writes:

> * gnu/packages/ocr.scm (tesseract-ocr): update to 4.1.1
                                          ^ This is usually capitalised.
> [snip]
>  (define-public tesseract-ocr
> +  ;; some useful commits beyond last official stable release in release branch
> +  (let ((commit "97079fa353557af6df86fd20b5d2e0dff5d8d5df"))
>    (package
>      (name "tesseract-ocr")
> -    (version "3.04.01")
> +    (version "4.1.1")
                ^ Since we are not _actually_ using version 4.1.1, but a
                  later commit, you could use
                  `(git-version "4.1.1" revision commit)' here instead


>      (source
>       (origin
>         (method git-fetch)
>         (uri (git-reference
>                (url "https://github.com/tesseract-ocr/tesseract")
> -              (commit version)))
> -       (file-name (git-file-name name version))
> +              (commit commit)
> +              ;; Fetch git submodules
> +              (recursive? #t)))

Instead of stating what the code does, would you consider adding a
comment why this is needed?

> +       (file-name (string-append name "-" version "-" commit "-checkout"))
                     ^ You can use `(git-file-name name version)' here.

>         (sha256
> -        (base32 "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv"))))
> +        (base32 "0axwla82fpzp86lc553wp3hk0fz5dylw4as0jbf4hkqcyajlbzp4"))))
>      (build-system gnu-build-system)
>      (inputs
> -     `(("leptonica" ,leptonica)))
> +     `(  ("cairo" ,cairo)
> +         ("icu" ,icu4c)
> +         ("leptonica" ,leptonica)
> +         ("pango" ,pango)))
> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("autoconf-archive" ,autoconf-archive)
> +       ("automake" ,automake)
> +       ("googletest" ,googletest)
> +       ("libtool" ,libtool)
> +       ("pkg-config" ,pkg-config)))
>      (arguments
>       '(#:configure-flags
>         (let ((leptonica (assoc-ref %build-inputs "leptonica")))
> -         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
> +         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))
> +       ;; some test, applybox_test fails to build
> +       #:tests? #f))
 2 nits: Is it possible to patch or disable only the failing tests?
 Is there a reason googletest is added if testing is subsequently disabled?

Thanks,
 - Jelle




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Mon, 08 Feb 2021 23:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Mon, 8 Feb 2021 15:14:22 -0800
[Message part 1 (text/plain, inline)]
updated patch attached


On Mon, Feb 8, 2021 at 1:36 PM Jelle Licht <jlicht <at> posteo.net> wrote:
>
>
> > * gnu/packages/ocr.scm (tesseract-ocr): update to 4.1.1
>                                           ^ This is usually capitalised.

capitalized

> > [snip]
> >  (define-public tesseract-ocr
> > +  ;; some useful commits beyond last official stable release in release branch
> > +  (let ((commit "97079fa353557af6df86fd20b5d2e0dff5d8d5df"))
> >    (package
> >      (name "tesseract-ocr")
> > -    (version "3.04.01")
> > +    (version "4.1.1")
>                 ^ Since we are not _actually_ using version 4.1.1, but a
>                   later commit, you could use
>                   `(git-version "4.1.1" revision commit)' here instead

changed as suggested
>
> >      (source
> >       (origin
> >         (method git-fetch)
> >         (uri (git-reference
> >                (url "https://github.com/tesseract-ocr/tesseract")
> > -              (commit version)))
> > -       (file-name (git-file-name name version))
> > +              (commit commit)
> > +              ;; Fetch git submodules
> > +              (recursive? #t)))
>
> Instead of stating what the code does, would you consider adding a
> comment why this is needed?
>

commented as suggested

> > +       (file-name (string-append name "-" version "-" commit "-checkout"))
>                      ^ You can use `(git-file-name name version)' here.
>

changed as suggested

> >         (sha256
> > -        (base32 "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv"))))
> > +        (base32 "0axwla82fpzp86lc553wp3hk0fz5dylw4as0jbf4hkqcyajlbzp4"))))
> >      (build-system gnu-build-system)
> >      (inputs
> > -     `(("leptonica" ,leptonica)))
> > +     `(  ("cairo" ,cairo)
> > +         ("icu" ,icu4c)
> > +         ("leptonica" ,leptonica)
> > +         ("pango" ,pango)))
> > +    (native-inputs
> > +     `(("autoconf" ,autoconf)
> > +       ("autoconf-archive" ,autoconf-archive)
> > +       ("automake" ,automake)
> > +       ("googletest" ,googletest)
> > +       ("libtool" ,libtool)
> > +       ("pkg-config" ,pkg-config)))
> >      (arguments
> >       '(#:configure-flags
> >         (let ((leptonica (assoc-ref %build-inputs "leptonica")))
> > -         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
> > +         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))
> > +       ;; some test, applybox_test fails to build
> > +       #:tests? #f))
>  2 nits: Is it possible to patch or disable only the failing tests?

tests failing to build probably due to some issue with parallel
builds; did not dig into it as probably will take much time; will be
TODO if time allows)

>  Is there a reason googletest is added if testing is subsequently disabled?
>

removed

> Thanks,
>  - Jelle



--
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
[0001-gnu-tesseract-ocr-Update-to-4.1.1.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Tue, 09 Feb 2021 11:57:02 GMT) Full text and rfc822 format available.

Message #17 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> posteo.net>
To: Andy Tai <atai <at> atai.org>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Tue, 09 Feb 2021 12:56:42 +0100
Hello Andy,

I have some additional questions about your updated patch.

Andy Tai <atai <at> atai.org> writes:

> updated patch attached
>> > -       (file-name (git-file-name name version))
>> > +              (commit commit)
>> > +              ;; Fetch git submodules
>> > +              (recursive? #t)))
>>
>> Instead of stating what the code does, would you consider adding a
>> comment why this is needed?
>>
>
> commented as suggested

I was unclear in my message: Of course there are some submodules that
are being fetched; why should we fetch them in the first place? From
a cursory glance, they seem required to do stuff such as running the
tests, which in this iteration of the patch are not being run.

FWIW, leaving out the `recursive? #t' still allows me to build
tesseract-ocr: could you try and see if it makes a difference in your
use of tesseract?

>> >      (inputs
>> > -     `(("leptonica" ,leptonica)))
>> > +     `(  ("cairo" ,cairo)
>> > +         ("icu" ,icu4c)
>> > +         ("leptonica" ,leptonica)
>> > +         ("pango" ,pango)))

I just built the package: no references are made to cairo, icu4c and
pango, and tesseract seems to build fine without them: is there a
specific reason why these were added to the inputs?

>> > +    (native-inputs
>> > +     `(("autoconf" ,autoconf)
>> > +       ("autoconf-archive" ,autoconf-archive)
>> > +       ("automake" ,automake)
>> > +       ("googletest" ,googletest)
>> > +       ("libtool" ,libtool)
>> > +       ("pkg-config" ,pkg-config)))
>> >      (arguments
>> >       '(#:configure-flags
>> >         (let ((leptonica (assoc-ref %build-inputs "leptonica")))
>> > -         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))))
>> > +         (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include")))
>> > +       ;; some test, applybox_test fails to build
>> > +       #:tests? #f))
>>  2 nits: Is it possible to patch or disable only the failing tests?
>
> tests failing to build probably due to some issue with parallel
> builds; did not dig into it as probably will take much time; will be
> TODO if time allows)

I'll defer to someone with more experience with tesseract, as I have no
experience to speak of on whether this leads to us having a (subtly)
broken package.

Adding the following arguments might help to validate your assumption:
`#:make-flags (list "-j" "1")'.

Thanks,
 - Jelle




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Tue, 09 Feb 2021 16:23:01 GMT) Full text and rfc822 format available.

Message #20 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Tue, 9 Feb 2021 08:22:00 -0800
[Message part 1 (text/plain, inline)]
Hi, I updated the patch to only build in serial, with "-j 1"

and with this, everything, including tests, builds successfully.

Not sure if there is a way to specify only building the tests with "-j 1"

In any case, the updated patch is attached

Thanks

On Tue, Feb 9, 2021 at 3:56 AM Jelle Licht <jlicht <at> posteo.net> wrote:
>
> Adding the following arguments might help to validate your assumption:
> `#:make-flags (list "-j" "1")'.
>
> Thanks,
>  - Jelle
[0001-gnu-tesseract-ocr-Update-to-4.1.1.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Tue, 09 Feb 2021 22:44:01 GMT) Full text and rfc822 format available.

Message #23 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> posteo.net>
To: Andy Tai <atai <at> atai.org>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Tue, 09 Feb 2021 23:43:06 +0100
Hi Andy,

Andy Tai <atai <at> atai.org> writes:

> Hi, I updated the patch to only build in serial, with "-j 1"
>
> and with this, everything, including tests, builds successfully.

No such luck, for me at least. Are you certain you got it to build on
your end? Could you try with `--check`?

I've had to work out the following things:

- Patched out "<tesseract/baseapi.h>" and "<tesseract/helpers.h>" to
  refer to "baseapi.h" and "helpers.h" in "unittest/pagesegmode_test.cc".

- Make sure the check phase takes place after running "make training" in
  a phase.

I still ended up with several failing tests, courtesy of it running
unsupported instructions on my cpu (educated guess: avx etc). Nothing
comes easy, I guess.

Thanks,
 - Jelle




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Tue, 09 Feb 2021 22:55:02 GMT) Full text and rfc822 format available.

Message #26 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Tue, 9 Feb 2021 14:53:31 -0800
Strange.  I did use --check to build,  And I need to make no changes
to the checked out sources.  So our environment seems to have
significant differences?

That under guix makes no sense.

On Tue, Feb 9, 2021 at 2:43 PM Jelle Licht <jlicht <at> posteo.net> wrote:
>
> Hi Andy,
>
> Andy Tai <atai <at> atai.org> writes:
>
> > Hi, I updated the patch to only build in serial, with "-j 1"
> >
> > and with this, everything, including tests, builds successfully.
>
> No such luck, for me at least. Are you certain you got it to build on
> your end? Could you try with `--check`?
>
> I've had to work out the following things:
>
> - Patched out "<tesseract/baseapi.h>" and "<tesseract/helpers.h>" to
>   refer to "baseapi.h" and "helpers.h" in "unittest/pagesegmode_test.cc".
>
> - Make sure the check phase takes place after running "make training" in
>   a phase.
>
> I still ended up with several failing tests, courtesy of it running
> unsupported instructions on my cpu (educated guess: avx etc). Nothing
> comes easy, I guess.
>
> Thanks,
>  - Jelle



-- 
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Wed, 10 Feb 2021 07:53:02 GMT) Full text and rfc822 format available.

Message #29 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Tue, 9 Feb 2021 23:52:00 -0800
[Message part 1 (text/plain, inline)]
updated patch, now tests build in parallel... the build order has to
be explicitly set to make the training target built first

also added some other optional dependencies; built in a GuixSD VM to
ensure no dependency on non-Guix tools from host

test run is disabled for now

On Tue, Feb 9, 2021 at 2:43 PM Jelle Licht <jlicht <at> posteo.net> wrote:
>
> Hi Andy,
>
> Andy Tai <atai <at> atai.org> writes:
>
> > Hi, I updated the patch to only build in serial, with "-j 1"
> >
> > and with this, everything, including tests, builds successfully.
>
> No such luck, for me at least. Are you certain you got it to build on
> your end? Could you try with `--check`?
>
> I've had to work out the following things:
>
> - Patched out "<tesseract/baseapi.h>" and "<tesseract/helpers.h>" to
>   refer to "baseapi.h" and "helpers.h" in "unittest/pagesegmode_test.cc".
>
> - Make sure the check phase takes place after running "make training" in
>   a phase.
>
> I still ended up with several failing tests, courtesy of it running
> unsupported instructions on my cpu (educated guess: avx etc). Nothing
> comes easy, I guess.
>
> Thanks,
>  - Jelle



-- 
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
[0001-gnu-tesseract-ocr-Update-to-4.1.1.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Thu, 11 Feb 2021 00:02:01 GMT) Full text and rfc822 format available.

Message #32 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Wed, 10 Feb 2021 16:00:54 -0800
[Message part 1 (text/plain, inline)]
updated patch:

unit tests run, with some failures due to illegal instruction and
others succeed, but these requires first manual downloading of the
training data; I am not sure how that can be done as part of Guix
package definition.  Help on that is much appreciated.  (details
commented in the patch)

On Tue, Feb 9, 2021 at 11:52 PM Andy Tai <atai <at> atai.org> wrote:
>
> updated patch, now tests build in parallel... the build order has to
> be explicitly set to make the training target built first
>
> also added some other optional dependencies; built in a GuixSD VM to
> ensure no dependency on non-Guix tools from host
>
> test run is disabled for now
>
> On Tue, Feb 9, 2021 at 2:43 PM Jelle Licht <jlicht <at> posteo.net> wrote:
> >
> > Hi Andy,
> >
> > Andy Tai <atai <at> atai.org> writes:
> >
> > > Hi, I updated the patch to only build in serial, with "-j 1"
> > >
> > > and with this, everything, including tests, builds successfully.
> >
> > No such luck, for me at least. Are you certain you got it to build on
> > your end? Could you try with `--check`?
> >
> > I've had to work out the following things:
> >
> > - Patched out "<tesseract/baseapi.h>" and "<tesseract/helpers.h>" to
> >   refer to "baseapi.h" and "helpers.h" in "unittest/pagesegmode_test.cc".
> >
> > - Make sure the check phase takes place after running "make training" in
> >   a phase.
> >
> > I still ended up with several failing tests, courtesy of it running
> > unsupported instructions on my cpu (educated guess: avx etc). Nothing
> > comes easy, I guess.
> >
> > Thanks,
> >  - Jelle
>
>
>
> --
> Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
> Year 2021 民國110年
> 自動的精神力是信仰與覺悟
> 自動的行為力是勞動與技能



-- 
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
[0001-gnu-tesseract-ocr-Update-to-4.1.1.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Thu, 11 Feb 2021 10:50:02 GMT) Full text and rfc822 format available.

Message #35 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> posteo.net>
To: Andy Tai <atai <at> atai.org>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Thu, 11 Feb 2021 11:48:52 +0100
Hey Andy,

Andy Tai <atai <at> atai.org> writes:

> updated patch:
>
> unit tests run, with some failures due to illegal instruction and
> others succeed, but these requires first manual downloading of the
> training data; I am not sure how that can be done as part of Guix
> package definition.  Help on that is much appreciated.  (details
> commented in the patch)

The illegal instruction stuff seems somehow problematic either way. The
training data seems to be generated via a not-really-trivial process, so
my guess is that to properly package this, we would really have to
generate the training data 'from source'. For now, it might make more
sense to have users "BYOTD" (bring your own training data) and leave it
out of the packaging story.

Andy, what would you think about dumbing down your patch so
tesseract-ocr simply doesn't run tests (or try to build them, for that
matter)? So sorry for sending you on this wild goose chase!

I'm willing to adjust and push such a change, unless someone has a
better idea.

Thanks,
 - Jelle




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Thu, 11 Feb 2021 18:36:01 GMT) Full text and rfc822 format available.

Message #38 received at 46376 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376 <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Thu, 11 Feb 2021 10:34:44 -0800
Hi, sure.  Since the tests are built, we can just skip running them by
deleting the check phase.   That would be minimal change from the
(otherwise working) patch, also with no trouble from the missing
training data.

On Thu, Feb 11, 2021 at 2:48 AM Jelle Licht <jlicht <at> posteo.net> wrote:
>
> Hey Andy,
>
> Andy Tai <atai <at> atai.org> writes:
>
> > updated patch:
> >
> > unit tests run, with some failures due to illegal instruction and
> > others succeed, but these requires first manual downloading of the
> > training data; I am not sure how that can be done as part of Guix
> > package definition.  Help on that is much appreciated.  (details
> > commented in the patch)
>
> The illegal instruction stuff seems somehow problematic either way. The
> training data seems to be generated via a not-really-trivial process, so
> my guess is that to properly package this, we would really have to
> generate the training data 'from source'. For now, it might make more
> sense to have users "BYOTD" (bring your own training data) and leave it
> out of the packaging story.
>
> Andy, what would you think about dumbing down your patch so
> tesseract-ocr simply doesn't run tests (or try to build them, for that
> matter)? So sorry for sending you on this wild goose chase!
>
> I'm willing to adjust and push such a change, unless someone has a
> better idea.
>
> Thanks,
>  - Jelle



-- 
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能




Reply sent to Jelle Licht <jlicht <at> posteo.net>:
You have taken responsibility. (Sat, 13 Feb 2021 14:35:01 GMT) Full text and rfc822 format available.

Notification sent to Andy Tai <atai <at> atai.org>:
bug acknowledged by developer. (Sat, 13 Feb 2021 14:35:02 GMT) Full text and rfc822 format available.

Message #43 received at 46376-done <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> posteo.net>
To: Andy Tai <atai <at> atai.org>
Cc: 46376-done <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Sat, 13 Feb 2021 15:34:19 +0100
Hey Andy,

Andy Tai <atai <at> atai.org> writes:

> Hi, sure.  Since the tests are built, we can just skip running them by
> deleting the check phase.   That would be minimal change from the
> (otherwise working) patch, also with no trouble from the missing
> training data.

I pushed a slightly modified version of your patch as 822cd628e6 to
master; Instead of building the tests for no reason, I reverted the
recursive git checkout and I removed dependencies that are not required
for building tesseract from a git checkout.

Additionally, the manpages are now generated and installed as well.

Thanks again,
 - Jelle




Information forwarded to guix-patches <at> gnu.org:
bug#46376; Package guix-patches. (Sat, 13 Feb 2021 20:39:01 GMT) Full text and rfc822 format available.

Message #46 received at 46376-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Jelle Licht <jlicht <at> posteo.net>
Cc: 46376-done <at> debbugs.gnu.org
Subject: Re: [bug#46376] [PATCH] gnu: tesseract-ocr: update to 4.1.1)
Date: Sat, 13 Feb 2021 12:37:53 -0800
[Message part 1 (text/plain, inline)]
Thanks!

On Sat, Feb 13, 2021 at 6:34 AM Jelle Licht <jlicht <at> posteo.net> wrote:

> Hey Andy,
>
> Andy Tai <atai <at> atai.org> writes:
>
> > Hi, sure.  Since the tests are built, we can just skip running them by
> > deleting the check phase.   That would be minimal change from the
> > (otherwise working) patch, also with no trouble from the missing
> > training data.
>
> I pushed a slightly modified version of your patch as 822cd628e6 to
> master; Instead of building the tests for no reason, I reverted the
> recursive git checkout and I removed dependencies that are not required
> for building tesseract from a git checkout.
>
> Additionally, the manpages are now generated and installed as well.
>
> Thanks again,
>  - Jelle
>


-- 
Andy Tai, atai <at> atai.org, Skype: licheng.tai, Line: andy_tai, WeChat:
andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Mar 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.