unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Saku Laesvuori <saku@laesvuori.fi>
To: Kaelyn <kaelyn.alexi@protonmail.com>
Cc: "Eidvilas Markevičius" <markeviciuseidvilas@gmail.com>,
	"Nathan Dehnel" <ncdehnel@gmail.com>,
	guix-devel@gnu.org
Subject: Re: Relaxing the restrictions for store item names
Date: Fri, 25 Aug 2023 21:14:03 +0300	[thread overview]
Message-ID: <20230825181403.w3xzklltma73bbei@X-kone> (raw)
In-Reply-To: <tyehX2kH-_fvWsBZ0i1cyuxIN05sDzirMmNQ6Tyuh9Xbzm_Z39XLOS2ItlHOkjw9LIv5JuKUU3ZBCYoAoAd1HbYhKAPOw5dHwScLLMXd8wU=@protonmail.com>

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

> > Although now, just a few hours later, I'm having second thoughts on
> > this. When you really think about it, it's very unlinkely that some
> > user would prefer typing something like
> > 
> > guix install %D0%B8%D0%BC%D0%B0%D0%B3%D0%B8%D0%BD%D0%B0%D1%80%D0%B8-%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC
> > 
> > over
> > 
> > guix install имагинари-програм
> 
> I imagine that, for usability, the percent encoding (or other encoding
> or transliteration) of non-ASCII characters could be handled
> transparently, i.e. for "guix install имагинари-програм", guix would
> translate "имагинари-програм" to the encoded form for operations. And
> if the escape character (e.g. the "%" in percent encoding) isn't also
> a valid character for store or package names then the values can be
> handled transparently. For example, both "guix install git" and "guix
> install %67%69%74" and "guix install g%69t" would all install git.
>
> > [...]
>
> > It would also make
> > store name unnecessarily long (they're already long as is), and
> > there's a 255 char limit for filenames that we have to keep in mind as
> > well. Searching the store using standard utilities such as find and
> > grep would too, as a consequence,
> 
> I split out the quote above as a bit of reference. While I agree that
> we have to keep in mind the 255 char limit for filenames, with percent
> encoding causing a single byte in ASCII or UTF-8 to become ~3 bytes
> (with iirc most non-latin characters having multi-byte encodings in
> UTF-8) and the store hashes being a 33 byte prefix (counting the
> dash), 255 chars is still quite a bit. Specifically, the extracted
> quote above--without the "> " prefixes and with line breaks treated as
> single characters--is exactly 255 characters. (I find a bit of
> readable text to be helpful for wrapping my brain around a value like
> "255 characters".)
>
> > break... There's just too many problems with this.

The encoding could also be transparent in the other direction so the
percent encoded form would be usable on the command line (in addition to
the UTF-8 one, of course), but guix would translate it to UTF-8 for
operations. This would allow typing all package names with only ascii
characters but still keep the store readable and grepable. There are
most likely simple utility programs that can decode precent encoding, so
the store is also grepable with only ascii characters. 

There is no reason (that I can see) not to allow UTF-8 in the store
paths, other than it being hard to type with a keyboard for a different
locale. But how often do people actually want to type store paths by
hand? I at least avoid it at all times possible by using $(guix build ...), 
$(herd configuration ...), $(realpath /var/guix/profiles/...) etc.
Even when recovering a broken system the only store path you really need to
type is that of a working guix (and /var/guix/profiles/... probably also
works in a broken system).

> > even if they don't have the russian (or whatever other language)
> > keyboard layout set up on their system, so just for accessability
> > purposes, the solution wouldn't be all that great.

I agree. It is really annyoing and hard to write percent encoding by
hand, so this doesn't really solve the issue of UTF-8 being hard to
write with an ASCII keyboard.

Maybe some sort of fuzzy character matching could be used in guix search
instead of percent encoding. That way people could find the packages
even if they can't type the entire name and then use the name from guix
search (by copy-pasting or shell piping) to install it (or do whatever
operation they want to it).

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

  parent reply	other threads:[~2023-08-25 18:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25  8:37 Relaxing the restrictions for store item names Nathan Dehnel
2023-08-25  9:14 ` Eidvilas Markevičius
2023-08-25 14:01   ` Eidvilas Markevičius
2023-08-25 16:32     ` Kaelyn
2023-08-25 17:44       ` Eidvilas Markevičius
2023-08-25 18:14       ` Saku Laesvuori [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-22  6:49 Eidvilas Markevičius
2023-08-23 19:04 ` jbranso
2023-08-24  6:56 ` (
2023-08-24  7:16   ` MSavoritias
2023-08-24  7:31     ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-08-24  7:35       ` Fannys
2023-08-24  7:41       ` MSavoritias
2023-08-24  8:10         ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-08-24  8:18           ` MSavoritias
2023-08-24  8:41             ` Msavoritias
2023-08-24 10:21               ` Julien Lepiller
2023-08-24 10:36                 ` MSavoritias
2023-08-24 19:38                   ` (
2023-08-27 15:27                 ` wolf
2023-08-24 10:33 ` Simon Tournier
2023-08-24 16:30 ` Kaelyn
2023-08-24 18:26   ` Eidvilas Markevičius
2023-09-02 20:02 ` Eidvilas Markevičius

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=20230825181403.w3xzklltma73bbei@X-kone \
    --to=saku@laesvuori.fi \
    --cc=guix-devel@gnu.org \
    --cc=kaelyn.alexi@protonmail.com \
    --cc=markeviciuseidvilas@gmail.com \
    --cc=ncdehnel@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).