diff mbox series

[bug#49517] gnu: txr: Build documentation and update to 265.

Message ID lkKu4cCvlVCKZHf_KZjvAknH_CGNYkXBxzN6ZqKiVi8rt3DSUFUsyo8eyklsX9hu-ax2vNVRa89nuZQeRW_3USrnCs5fwqYqk0vXQssOlqg=@apatience.com
State Accepted
Headers show
Series [bug#49517] gnu: txr: Build documentation and update to 265. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Paul A. Patience July 13, 2021, 11:45 p.m. UTC
On Sunday, July 11th, 2021 at 21:01, Paul A. Patience <paul@apatience.com> wrote:

> I've managed to fix one of the failing tests
> and narrowed down the problem of the others.

Kaz Kylheku has determined the cause of the failing tests,
so I've updated the comment to reflect his conclusions.

There has been a new release so I've updated the package
to TXR version 266.

Once again, only the second attached patch is different
from my initial submission.

Best regards,
Paul

Comments

Guillaume Le Vaillant July 17, 2021, 9:57 a.m. UTC | #1
Paul A. Patience <paul@apatience.com> skribis:

> On Sunday, July 11th, 2021 at 21:01, Paul A. Patience <paul@apatience.com> wrote:
>
>> I've managed to fix one of the failing tests
>> and narrowed down the problem of the others.
>
> Kaz Kylheku has determined the cause of the failing tests,
> so I've updated the comment to reflect his conclusions.
>
> There has been a new release so I've updated the package
> to TXR version 266.
>
> Once again, only the second attached patch is different
> from my initial submission.
>
> Best regards,
> Paul

Hi,

When testing the patch to build the HTML and PDF documentation,
I noticed that the 'share/doc/txr-263/txr-manpage.pdf' file is not
reproducible. There are some timestamps and UUIDs in it that change at
each build (diffoscope output attached).

Could you take a look at that and see if there's a way to make it
reproducible?
Thanks.
Kaz Kylheku July 17, 2021, 10:51 p.m. UTC | #2
On 2021-07-17 02:57, Guillaume Le Vaillant wrote:
> Hi,
> 
> When testing the patch to build the HTML and PDF documentation,
> I noticed that the 'share/doc/txr-263/txr-manpage.pdf' file is not
> reproducible. There are some timestamps and UUIDs in it that change at
> each build (diffoscope output attached).
> 
> Could you take a look at that and see if there's a way to make it
> reproducible?
> Thanks.

Hi Guillaume,

Thank you for your report. I don't see anything in the pdfroff 
documentation
about getting rid of this. I might use a program similar to this one
to just overwrite the UUIDs and dates:

(let* ((pdf (file-get-string "txr-manpage.pdf"))
        (start (search-str pdf "<?xpacket begin="))
        (end (if start (search-str pdf "<?xpacket end" start)))
        (xml (if end [pdf start..end]))
        (orig-len (len xml)))
   (unless xml
     (format *stderr* "XML block not found in PDF")
     (exit nil))
   (upd xml
     (regsub #/uuid:........-....-....-....-............/
             "uuid:00000000-0000-0000-0000-000000000000")
     (regsub #/Date>....-..-..T..:..:..-..:../
             "Date>1970-01-01T00:00:00-00:00"))
   (assert (eql (len xml) orig-len))
   (set [pdf start..end] xml)
   (file-put-string "txr-manpage.pdf.temp" pdf)
   (rename-path "txr-manpage.pdf.temp" "txr-manpage.pdf"))


I have some questions.

1. When, for the sake of reproducible binary builds,
    we replace date stamps with fixed dates, is there a preference for
    what date to use? I used the Unix epoch, as you can see.

    I'm aware of the convention involving the environment
    variable SOURCE_DATE_EPOCH.

    Should I use that?

2. Is there some recommended practice with regard to some
    ./configure option or environment/make variable to react to
    for ensuring reproducible builds? So that is to say, suppose
    I don't wish to do the above embedded XML cleaning, except
    when building for a distro that strives for reproducibility.

    For opting in to reproducibilty, should I again rely on
    SOURCE_DATE_EPOCH and have the build react to it?


Thanks ...
diff mbox series

Patch

From c1295a3b83c7d446ea42a683b1384acd5645bfe8 Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Tue, 13 Jul 2021 19:38:12 -0400
Subject: [PATCH 2/2] gnu: txr: Update to 266.

* gnu/packages/lisp.scm (txr)[version]: Update to 266.
[arguments]<#:phases>{inhibit-doc-syms-generation}: Correct the path to
doc-syms.tl to its new location.
{fix-tests}: Fix another test.
{disable-failing-tests}: New phase.
---
 gnu/packages/lisp.scm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 8f3be7dafe..8d2acc81e2 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -906,7 +906,7 @@  the HTML documentation of TXR.")
 (define-public txr
   (package
     (name "txr")
-    (version "263")
+    (version "266")
     (source
      (origin
        (method git-fetch)
@@ -915,7 +915,7 @@  the HTML documentation of TXR.")
              (commit (string-append "txr-" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "14zaziymnbr2ld79x4h7sf88bzzzj82w3xpavmcx7mhwannb2swh"))))
+        (base32 "1k9mj3zaxdsylgnb8g6cq0cmp6420x7fp3nnsqdmds4gh8ib95wn"))))
     (build-system gnu-build-system)
     (native-inputs
      ;; Required to build the documentation.
@@ -938,7 +938,7 @@  the HTML documentation of TXR.")
                ;; stdlib/doc-syms.tl, which is anyway kept up to date with
                ;; each release (and is already compiled to stdlib/doc-syms.tlo
                ;; when genman.txr is run).
-               (("^@\\(output \"share/txr/stdlib/doc-syms\\.tl\"\\).*" line)
+               (("^@\\(output \"stdlib/doc-syms\\.tl\"\\).*" line)
                 (string-append "@(do (exit))\n" line)))
              #t))
          (add-after 'unpack 'fix-tests
@@ -946,6 +946,22 @@  the HTML documentation of TXR.")
              (substitute* (list "tests/017/realpath.tl"
                                 "tests/017/realpath.expected")
                (("/usr/bin") "/"))
+             (substitute* "tests/018/path-test.tl"
+               (("/bin") (dirname (which "sh"))))
+             #t))
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (for-each delete-file
+                       ;; These tests fail because they call external commands
+                       ;; (like ls and cat) that don't run because the forked
+                       ;; child processes' execvp calls cannot find the
+                       ;; hardcoded /bin/sh.
+                       ;; (The tests pass when run manually in the directory
+                       ;; left by --keep-failed.)
+                       (map (lambda (f) (string-append "tests/" f))
+                            '("002/query-1.txr"
+                              "010/json.tl"
+                              "018/process.tl")))
              #t))
          (replace 'configure
            ;; ./configure is a hand-written script that can't handle standard
-- 
2.32.0