GNU bug report logs - #50874
[PATCH] lint: Check if HTTPS version of HTTP URL exists.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Tue, 28 Sep 2021 19:10:02 UTC

Severity: normal

Tags: moreinfo, patch

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 50874 <at> debbugs.gnu.org
Subject: [bug#50874] [PATCH] lint: Check if HTTPS version of HTTP URL exists.
Date: Sun, 10 Oct 2021 15:12:43 +0200
Hi!

Xinglu Chen <public <at> yoctocell.xyz> skribis:

> On Sat, Oct 02 2021, Ludovic Courtès wrote:
>
>> Hi,
>>
>> Xinglu Chen <public <at> yoctocell.xyz> skribis:
>>
>>> * guix/lint.scm (check-if-https-uri-exists?): New procedure.
>>> (check-home-page, check-source): Use it.
>>
>> Applied, thanks!
>
> Was it?  I don’t see it in the log.

Actually no.  :-)  I initially applied it, started replying, noticed
there was a problem, and then sent that inconsistent reply.

>>> I don’t really know how to test this while making it future-proof, any
>>> suggestions?
>>
>> I don’t know either, since we don’t have an easy way to spin up an HTTPS
>> server.  I think it’s okay to leave it as is, for lack of a better idea.
>>
>> However, this version of the patch leads to test failures in
>> tests/lint.scm (“Connection refused”).
>
> Thanks for catching this; I will look into it.  Good that you didn’t
> apply it then.  :-)

Here’s what I see (among others):

--8<---------------cut here---------------start------------->8---
test-name: home-page: 200
location: /home/ludo/src/guix/tests/lint.scm:650
source:
+ (test-equal
+   "home-page: 200"
+   '()
+   (with-http-server
+     `((200 ,%long-string))
+     (let ((pkg (package
+                  (inherit (dummy-package "x"))
+                  (home-page (%local-url)))))
+       (check-home-page pkg))))
expected-value: ()
actual-value: #f
actual-error:
+ (system-error
+   connect*
+   "~A"
+   ("Connection refused")
+   (111))
result: FAIL

[…]

test-name: source: 200
location: /home/ludo/src/guix/tests/lint.scm:917
source:
+ (test-equal
+   "source: 200"
+   '()
+   (with-http-server
+     `((200 ,%long-string))
+     (let ((pkg (package
+                  (inherit (dummy-package "x"))
+                  (source
+                    (origin
+                      (method url-fetch)
+                      (uri (%local-url))
+                      (sha256 %null-sha256))))))
+       (check-source pkg))))
expected-value: ()
actual-value: #f
actual-error:
+ (system-error
+   connect*
+   "~A"
+   ("Connection refused")
+   (111))
result: FAIL
--8<---------------cut here---------------end--------------->8---

I believe that’s because, in addition to (%local-url), ‘check-home-page’
& co. now try to connect on port 443 of the same host, and there’s
nothing listening to that port on my machine.

Ludo’.




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

Previous Next


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