From: zimoun <zimon.toutoune@gmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>, 44906@debbugs.gnu.org
Subject: bug#44906: Substitute requests fail if URL has trailing slash
Date: Sat, 28 Nov 2020 00:37:22 +0100 [thread overview]
Message-ID: <86a6v2qslp.fsf@gmail.com> (raw)
In-Reply-To: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@crazy-compilers.com>
Dear,
Thank you for the report.
Tweaking the function such as:
--8<---------------cut here---------------start------------->8---
(define (narinfo-request cache-url path)
"Return an HTTP request for the narinfo of PATH at CACHE-URL."
(let ((url (string-append cache-url "/" (store-path-hash-part path)
".narinfo"))
(headers '((User-Agent . "GNU Guile"))))
(format #t "~%Narinfo request: ~a~%~%" url)
(build-request (string->uri url) #:method 'GET #:headers headers)))
--8<---------------cut here---------------end--------------->8---
and removing the cache adequately, then running:
--8<---------------cut here---------------start------------->8---
./pre-inst-env guix weather \
--substitute-urls="https://ci.guix.gnu.org/ https://ci.guix.gnu.org" \
hello
computing 1 package derivations for x86_64-linux...
looking for 1 store items on https://ci.guix.gnu.org/...
Narinfo request: https://ci.guix.gnu.org//a462kby1q51ndvxdv3b6p0rsixxrgx1h.narinfo
updating substitutes from 'https://ci.guix.gnu.org/'... 100.0%
https://ci.guix.gnu.org/
0.0% substitutes available (0 out of 1)
[...]
'https://ci.guix.gnu.org//api/queue?nr=1000' returned 400 ("Bad Request")
looking for 1 store items on https://ci.guix.gnu.org...
Narinfo request: https://ci.guix.gnu.org/a462kby1q51ndvxdv3b6p0rsixxrgx1h.narinfo
updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
https://ci.guix.gnu.org
100.0% substitutes available (1 out of 1)
[...]
at least 1,000 queued builds
[...]
build rate: 36.89 builds per hour
[...]
--8<---------------cut here---------------end--------------->8---
On Fri, 27 Nov 2020 at 22:19, Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:
> According to RFC 7230, sec 2.7.3 "http and https URI Normalization and
> Comparison" [1]:
>
> […] an empty
> path component is equivalent to an absolute path of "/", so the
> normal form is to provide a path of "/" instead.
>
> [1] https://tools.ietf.org/html/rfc7230#section-2.7.3
Now, the question is where should the fix go? “guix publish” exposing
the narinfos or “guix weather“? Or both?
From my understanding, one fix should go to ‘guix publish’ exposing the
narinfos since:
https://ci.guix.gnu.org//a462kby1q51ndvxdv3b6p0rsixxrgx1h.narinfo
should be a valid URL and return the narinfo file. However, taking this
road, it means that the cache folder will not be the same:
~/.cache/guix/substitute/x2wcz6gz3evwlqcrz3fqstmezkfcfnpfb5kfyxbz7kjikc7upkiq/
~/.cache/guix/substitute/4refhwxbjmeua2kwg2nmzhv4dg4d3dorpjefq7kiciw2pfhaf26a/
https://ci.guix.gnu.org/ resp. https://ci.guix.gnu.org Therefore, ‘guix
weather’ should be fixed too.
WDYT?
All the best,
simon
next prev parent reply other threads:[~2020-11-27 23:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 21:19 bug#44906: Substitute requests fail if URL has trailing slash Hartmut Goebel
2020-11-27 23:37 ` zimoun [this message]
2020-11-28 9:47 ` Hartmut Goebel
2020-12-03 17:01 ` Ludovic Courtès
2020-12-04 4:15 ` Mark H Weaver
2021-07-09 8:38 ` bug#44906: [PATCH 0/3] Properly construct URLs if base-url " Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86a6v2qslp.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=44906@debbugs.gnu.org \
--cc=h.goebel@crazy-compilers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.