Test failure in tests/publish.scm with commit 1955ef93b76e51cab5bed4c90f7eb9df7035355a

  • Done
  • quality assurance status badge
Details
4 participants
  • Cees de Groot
  • Konrad Hinsen
  • Ludovic Courtès
  • zimoun
Owner
unassigned
Submitted by
Konrad Hinsen
Severity
normal
K
K
Konrad Hinsen wrote on 18 Mar 2021 16:05
(address . bug-guix@gnu.org)
m1sg4smria.fsf@ordinateur-de-catherine--konrad.home
Dear Guix Gurus,

I am trying to compile Guix (commit
1955ef93b76e51cab5bed4c90f7eb9df7035355a) from source, on a computer
running Ubuntu 20.04 with Guix added via a binary installation. I get
one test failure, whose test-suite.log is attached.

Cheers,
Konrad.
Attachment: test-suite.log
L
L
Ludovic Courtès wrote on 20 Mar 2021 21:41
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 47239@debbugs.gnu.org)
87zgyx4kyj.fsf@gnu.org
Hi Konrad,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

Toggle quote (77 lines)
> test-name: with cache
> location: /home/hinsen/src/guix/tests/publish.scm:417
> source:
> + (test-equal
> + "with cache"
> + (list #t
> + `(("StorePath" unquote %item)
> + ("URL"
> + unquote
> + (string-append "nar/gzip/" (basename %item)))
> + ("Compression" . "gzip"))
> + 200
> + #t
> + #t
> + 404)
> + (call-with-temporary-directory
> + (lambda (cache)
> + (let ((thread
> + (with-separate-output-ports
> + (call-with-new-thread
> + (lambda ()
> + (guix-publish
> + "--port=6797"
> + "-C2"
> + (string-append "--cache=" cache)
> + "--cache-bypass-threshold=0"))))))
> + (wait-until-ready 6797)
> + (let* ((base "http://localhost:6797/")
> + (part (store-path-hash-part %item))
> + (url (string-append base part ".narinfo"))
> + (nar-url
> + (string-append base "nar/gzip/" (basename %item)))
> + (cached
> + (string-append
> + cache
> + "/gzip/"
> + (basename %item)
> + ".narinfo"))
> + (nar (string-append
> + cache
> + "/gzip/"
> + (basename %item)
> + ".nar"))
> + (response (http-get url)))
> + (and (= 404 (response-code response))
> + (match (assq-ref
> + (response-headers response)
> + 'cache-control)
> + ((((quote max-age) . ttl)) (< ttl 3600)))
> + (wait-for-file cached)
> + (= 420 (stat:perms (lstat cached)))
> + (= 420 (stat:perms (lstat nar)))
> + (let* ((body (http-get-port url))
> + (compressed (http-get nar-url))
> + (uncompressed
> + (http-get
> + (string-append base "nar/" (basename %item))))
> + (narinfo (recutils->alist body)))
> + (list (file-exists? nar)
> + (filter
> + (lambda (item)
> + (match item
> + (("Compression" . _) #t)
> + (("StorePath" . _) #t)
> + (("URL" . _) #t)
> + (_ #f)))
> + narinfo)
> + (response-code compressed)
> + (= (response-content-length compressed)
> + (stat:size (stat nar)))
> + (= (string->number (assoc-ref narinfo "FileSize"))
> + (stat:size (stat nar)))
> + (response-code uncompressed)))))))))
> expected-value: (#t (("StorePath" . "/home/hinsen/src/guix/test-tmp/store/892j9b0gqgbj4a7sv40jif3yyv25sm90-item") ("URL" . "nar/gzip/892j9b0gqgbj4a7sv40jif3yyv25sm90-item") ("Compression" . "gzip")) 200 #t #t 404)
> actual-value: #f
> result: FAIL

Is it reproducible? (You can run “make check TESTS=tests/publish.scm”.)

If it is, could you add ‘pk’ calls here and there to see which of the
sub-expressions in (and …) returns false?

For example, replace:

(= 404 (response-code response)

by:

(pk 'four-oh-four (= 404 (response-code response)))

That’ll print a line in the test log with the value of that (= …)
expression.

TIA,
Ludo’.
K
K
Konrad Hinsen wrote on 21 Mar 2021 11:26
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47239@debbugs.gnu.org)
m1eeg8n6pr.fsf@ordinateur-de-catherine--konrad.home
Hi Ludo,

Toggle quote (2 lines)
> Is it reproducible? (You can run “make check TESTS=tests/publish.scm”.)

Yes.

Toggle quote (3 lines)
> If it is, could you add ‘pk’ calls here and there to see which of the
> sub-expressions in (and …) returns false?

'pk' shows nothing, but I rolled my own version using plain old
"display" and found that

(stat:perms (lstat nar))

is #o664 rather than the expected #o644.

Cheers,
Konrad.
Z
Z
zimoun wrote on 21 Mar 2021 15:25
(address . 47239@debbugs.gnu.org)
865z1kvb29.fsf@gmail.com
Hi,

On Sun, 21 Mar 2021 at 11:26, Konrad Hinsen <konrad.hinsen@fastmail.net> wrote:

Toggle quote (4 lines)
>> Is it reproducible? (You can run “make check TESTS=tests/publish.scm”.)
>
> Yes.

For the record, ’tests/publish.scm’ pass on Debian but not on Ubuntu.


Cheers,
simon
K
K
Konrad Hinsen wrote on 22 Mar 2021 08:54
(address . 47239@debbugs.gnu.org)
m11rc7mxmd.fsf@ordinateur-de-catherine--konrad.home
zimoun <zimon.toutoune@gmail.com> writes:

Toggle quote (2 lines)
> For the record, ’tests/publish.scm’ pass on Debian but not on Ubuntu.

One more data point: the tests pass under Ubuntu 18.04, but fail under
Ubuntu 20.04.

Cheers,
Konrad.
C
C
Cees de Groot wrote on 22 Mar 2021 17:04
Test failure in tests/publish.scm with commit 1955ef93b76e51cab5bed4c90f7eb9df7035355a
(name . 47239@debbugs.gnu.org)(address . 47239@debbugs.gnu.org)
dYL00NhLq9MmRs8ZO1NFa2YCS7H1L-U_bclkIYKd7cTsDdnBIrZ2dTRckvTGd-3eCIXnnB243CPLds9_b1zV838mJNdIUCP51wh4XW2WOxE=@evrl.com
FWIW, I can reproduce it on Ubuntu 20.10 as well.
Attachment: file
C
C
Cees de Groot wrote on 24 Mar 2021 03:32
(name . 47239@debbugs.gnu.org)(address . 47239@debbugs.gnu.org)
47SHfOqtf5hQVCuz4_qa5-l6KHlNdy4vCqvta2XchFJuC6e8U1QngEpPQLsMD2HeZVVSCqEpCnvu3YE8jItMMWHuRdzN7mKEUiW4307toxk=@evrl.com
I think this is a simple umask issue. Making the test check for just the bits worked for me:

Toggle diff (15 lines)
diff --git a/tests/publish.scm b/tests/publish.scm
index 52101876b5..3e67c435ac 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -452,8 +452,8 @@ References: ~%"
(wait-for-file cached)

;; Both the narinfo and nar should be world-readable.
- (= #o644 (stat:perms (lstat cached)))
- (= #o644 (stat:perms (lstat nar)))
+ (= #o444 (logand #o444 (stat:perms (lstat cached))))
+ (= #o444 (logand #o444 (stat:perms (lstat nar))))

(let* ((body (http-get-port url))
(compressed (http-get nar-url))
Attachment: file
Z
Z
zimoun wrote on 24 Mar 2021 04:05
control message for bug #47297
(address . control@debbugs.gnu.org)
86ft0li743.fsf@gmail.com
block 47297 by 47239
quit
L
L
Ludovic Courtès wrote on 31 Mar 2021 16:02
Re: bug#47239: Test failure in tests/publish.scm with commit 1955ef93b76e51cab5bed4c90f7eb9df7035355a
(name . Cees de Groot)(address . cg@evrl.com)(name . 47239@debbugs.gnu.org)(address . 47239-done@debbugs.gnu.org)
8735wba0bc.fsf@gnu.org
Hi,

Cees de Groot <cg@evrl.com> skribis:

Toggle quote (15 lines)
> I think this is a simple umask issue. Making the test check for just the bits worked for me:
>
> diff --git a/tests/publish.scm b/tests/publish.scm
> index 52101876b5..3e67c435ac 100644
> --- a/tests/publish.scm
> +++ b/tests/publish.scm
> @@ -452,8 +452,8 @@ References: ~%"
> (wait-for-file cached)
>
> ;; Both the narinfo and nar should be world-readable.
> - (= #o644 (stat:perms (lstat cached)))
> - (= #o644 (stat:perms (lstat nar)))
> + (= #o444 (logand #o444 (stat:perms (lstat cached))))
> + (= #o444 (logand #o444 (stat:perms (lstat nar))))

Indeed. Pushed as c536f0b217714917988d2f412999d978c2f2f495 on your
behalf.

Thanks!

Ludo’.
Closed
?