unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, "Guix Devel" <guix-devel@gnu.org>
Subject: Re: [maintenance] Compressed JSON files and served file extension?
Date: Tue, 28 Nov 2023 16:57:04 +0100	[thread overview]
Message-ID: <ZWYN0LWCKfhnCYjl@ws> (raw)
In-Reply-To: <87ttp69ega.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

On 2023-11-28 14:48:05 +0100, Simon Tournier wrote:
> Hi Ludo,
> 
> On Thu, 16 Nov 2023 at 15:40, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> > That said, if you become aware of actual breakage, we can revisit this!
> 
> The actual breakage is my own interaction with this file. :-)
> 
> Again, it happened to me yesterday.  By habits, I do:
> 
>     $ wget https://guix.gnu.org/sources.json
>     $ cat sources.json | jq | head
> 
> Then,
> 
> --8<---------------cut here---------------start------------->8---
> parse error: Invalid numeric literal at line 1, column 16
> cat: write error: Broken pipe
> --8<---------------cut here---------------end--------------->8---
> 
> Well, we are 6 days later my last message, 12 days after your message
> and more than one month after my report; and again the same mistake.
> That’s mistake because it does not jump to my eyes that the file is
> compressed.  Yeah, I could do many on my side as change my habits, as
> use curl, as have a smarter cat, as write a note, as have a better
> memory, as …
> 
> However, the simplest still appears to me to have the extension
> reflecting the format of the file.  Similarly as it is ’sources.json’
> and not just ’sources’.

But the problem is that the extension does reflect the format of the file.  The
Content-Encoding is just for transmission, it does not describe the file itself.
It should be thought of as an implementation detail.  Same way you do not really
care if you get the file over HTTP 1.1 or HTTP 2.0.

This just sound like a bug in wget, I wonder if there is a bug report and/or
good reason to behave like this...

Would it be possible to provide both files?  Sources.json.gz would *not* set the
content-encoding (and I guess content-type would be gzip?), so that one could
pick between https://guix.gnu.org/sources.json and
https://guix.gnu.org/sources.json.gz depending on their preference?

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-11-28 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 13:15 [maintenance] Compressed JSON files and served file extension? Simon Tournier
2023-11-16 14:40 ` Ludovic Courtès
2023-11-20  9:49   ` Simon Tournier
2023-11-28 13:48   ` Simon Tournier
2023-11-28 15:57     ` Tomas Volf [this message]
2023-11-20 14:03 ` Attila Lendvai
2023-11-28 13:37   ` Simon Tournier
2023-11-28 15:50     ` Tomas Volf
2023-11-28 21:05     ` Attila Lendvai
2023-11-29  9:08       ` Simon Tournier

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWYN0LWCKfhnCYjl@ws \
    --to=~@wolfsden.cz \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).