unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* guidelines for package names (namespaces?)
@ 2023-07-03 20:55 Andy Tai
  2023-07-05 20:19 ` John Kehayias
  2023-07-06  9:28 ` Attila Lendvai
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Tai @ 2023-07-03 20:55 UTC (permalink / raw)
  To: guix-devel

Hi, in Guix there seems no guidelines for package  names/namespaces
although there are conventions like Python packages prefixed with
python-...  (good).  However, this does not cover cases like Gnome
applications. For example, I submitted the original definition for
(the GNOME terminal package) terminator, and later I tried to rename
that gnome-terminator but that was rejected by reviewers.

Or GNU Guix maintainers may want to consider some type of name space
support in the package name space because I think name collisions will
be more and more likely as more packages are submitted for inclusion
in Guix.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
@ 2023-07-04 18:30 Juliana Sims
  0 siblings, 0 replies; 7+ messages in thread
From: Juliana Sims @ 2023-07-04 18:30 UTC (permalink / raw)
  To: atai; +Cc: guix-devel

Hi Andy,

There are some guidelines for naming packages, as discussed in the 
manual: 
https://guix.gnu.org/en/manual/devel/en/html_node/Package-Naming.html. 
Ultimately, of course, the final say rests with the commiters who do or 
do not accept a given patch in a given state. As for namespaces, Guix 
packages being defined in Guile and thus in Guile modules provides 
namespacing in most contexts - if not operating at the command line, 
one need only use the correct module and reference a given package 
object directly.

That said, last night I was just considering the potential for name 
conflicts. If a given `guix package -i <package>` command would resolve 
equally well to two different packages, for example, it seems the 
priority goes to whichever one comes first in some alphabetic 
comparisons - or perhaps it's by the order of channels in the channel 
list; I didn't investigate much more than to find out if Guix offers 
any manual intervention.

I mused aloud about the possibility of adding a switch to specify 
channels in such situations and was offered the following addition to 
the command: `-e '(@ (my channel packages) foo)'`. This allows one to 
specify Scheme objects precisely. In this case, that code resolves to 
the package `foo` in the module `(my channel packages)`. Of course, 
this is not necessarily obvious or approachable to a relatively new or 
casual user - I had to test to understand the incantation above, and I 
would not have considered it without advice.

All of that to say, you raise some good questions. I hope these 
thoughts prove useful to you in your endeavors.

Best,
Juli




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
  2023-07-03 20:55 guidelines for package names (namespaces?) Andy Tai
@ 2023-07-05 20:19 ` John Kehayias
  2023-07-06  4:53   ` Csepp
  2023-07-06 14:23   ` Andreas Enge
  2023-07-06  9:28 ` Attila Lendvai
  1 sibling, 2 replies; 7+ messages in thread
From: John Kehayias @ 2023-07-05 20:19 UTC (permalink / raw)
  To: Andy Tai; +Cc: guix-devel

Hi Andy,

On Mon, Jul 03, 2023 at 01:55 PM, Andy Tai wrote:

> Hi, in Guix there seems no guidelines for package  names/namespaces
> although there are conventions like Python packages prefixed with
> python-...  (good).  However, this does not cover cases like Gnome
> applications. For example, I submitted the original definition for
> (the GNOME terminal package) terminator, and later I tried to rename
> that gnome-terminator but that was rejected by reviewers.
>

This is a good question and one I wonder about when packaging
sometimes. The general guideline I've seen expressed in Python land at
least (not sure if this is in the manual, but this discussion can go
towards clarifying) is that generally "libraries" get the "python-"
prefix but end user "applications" don't. I believe this is true for
Golang as well, though exceptions abound.

The line is not necessarily clear. As an example, the "autokey"
package is written in Python and I would guess almost always used as
an application as is, but you can script with autokey itself as well.

> Or GNU Guix maintainers may want to consider some type of name space
> support in the package name space because I think name collisions will
> be more and more likely as more packages are submitted for inclusion
> in Guix.

I don't have any insight or knowledge on the internals here but the
general practice of a language prefix for libraries and the like has
so far worked well I think.

John



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
  2023-07-05 20:19 ` John Kehayias
@ 2023-07-06  4:53   ` Csepp
  2023-07-06 14:23   ` Andreas Enge
  1 sibling, 0 replies; 7+ messages in thread
From: Csepp @ 2023-07-06  4:53 UTC (permalink / raw)
  To: John Kehayias; +Cc: Andy Tai, guix-devel


John Kehayias <john.kehayias@protonmail.com> writes:

> Hi Andy,
>
> On Mon, Jul 03, 2023 at 01:55 PM, Andy Tai wrote:
>
>> Hi, in Guix there seems no guidelines for package  names/namespaces
>> although there are conventions like Python packages prefixed with
>> python-...  (good).  However, this does not cover cases like Gnome
>> applications. For example, I submitted the original definition for
>> (the GNOME terminal package) terminator, and later I tried to rename
>> that gnome-terminator but that was rejected by reviewers.
>>
>
> This is a good question and one I wonder about when packaging
> sometimes. The general guideline I've seen expressed in Python land at
> least (not sure if this is in the manual, but this discussion can go
> towards clarifying) is that generally "libraries" get the "python-"
> prefix but end user "applications" don't. I believe this is true for
> Golang as well, though exceptions abound.
>
> The line is not necessarily clear. As an example, the "autokey"
> package is written in Python and I would guess almost always used as
> an application as is, but you can script with autokey itself as well.
>
>> Or GNU Guix maintainers may want to consider some type of name space
>> support in the package name space because I think name collisions will
>> be more and more likely as more packages are submitted for inclusion
>> in Guix.
>
> I don't have any insight or knowledge on the internals here but the
> general practice of a language prefix for libraries and the like has
> so far worked well I think.
>
> John

One problem: sometimes a package can be used both as a library and as a
command, which means that when you try to import something that depends
on it and you didn't follow the naming convention for libraries, Guix
will try to import it again.  I've ran into this with Yggdrasil.

But this might be a missing feature of importers and not a naming issue.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
  2023-07-03 20:55 guidelines for package names (namespaces?) Andy Tai
  2023-07-05 20:19 ` John Kehayias
@ 2023-07-06  9:28 ` Attila Lendvai
  2023-07-06 15:24   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  1 sibling, 1 reply; 7+ messages in thread
From: Attila Lendvai @ 2023-07-06  9:28 UTC (permalink / raw)
  To: Andy Tai; +Cc: guix-devel

> Or GNU Guix maintainers may want to consider some type of name space
> support in the package name space because I think name collisions will
> be more and more likely as more packages are submitted for inclusion
> in Guix.


a related issue is that currently there are two parallel registries for guix packages:

 1) module-global variables in the guile module system

 2) the reified package registry of guix.

the relationship between these two is not clear, there are no formal rules, or even guidelines. they are pretty much orthogonal.

i don't have a specific issue with this, besides that it was rather confusing for me as a newcomer, and that it bothers the gut instinct of the engineer inside me.

the idea of namespaces is nothing new, and has already been solved by 1). i'm not sure about all the implications, but i think picking 1) and dropping 2) is worth considering. it would automatically keep track of a namespace hierarchy, and the guix GUI would have enough data to act intelligently in situations like package-name clashes.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“All experience is a drug experience. Whether it’s mediated by our own [endogenous] drugs, or whether it’s mediated by substances that we ingest that are found in plants, cognition, consciousness, the working of the brain, it’s all a chemically mediated process. Life itself is a drug experience.”
	— Dennis Mckenna (1950–)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
  2023-07-05 20:19 ` John Kehayias
  2023-07-06  4:53   ` Csepp
@ 2023-07-06 14:23   ` Andreas Enge
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Enge @ 2023-07-06 14:23 UTC (permalink / raw)
  To: John Kehayias; +Cc: Andy Tai, guix-devel

Am Wed, Jul 05, 2023 at 08:19:48PM +0000 schrieb John Kehayias:
> This is a good question and one I wonder about when packaging
> sometimes. The general guideline I've seen expressed in Python land at
> least (not sure if this is in the manual, but this discussion can go
> towards clarifying) is that generally "libraries" get the "python-"
> prefix but end user "applications" don't. I believe this is true for
> Golang as well, though exceptions abound.

See here:
   https://guix.gnu.org/de/manual/devel/en/html_node/Package-Naming.html
   https://guix.gnu.org/de/manual/devel/en/html_node/Python-Modules.html
   https://guix.gnu.org/de/manual/devel/en/html_node/Perl-Modules.html

I think there are no explicit rules for other languages, but the Perl and
Python approach has been taken as a general model.

> a related issue is that currently there are two parallel registries for guix packages:
>  1) module-global variables in the guile module system
>  2) the reified package registry of guix.
> the relationship between these two is not clear, there are no formal rules, or even guidelines. they are pretty much orthogonal.

See the first link above: "Both are usually the same and correspond to the
lowercase conversion of the project name chosen upstream (...)".

Andreas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guidelines for package names (namespaces?)
  2023-07-06  9:28 ` Attila Lendvai
@ 2023-07-06 15:24   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  0 siblings, 0 replies; 7+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2023-07-06 15:24 UTC (permalink / raw)
  To: Attila Lendvai; +Cc: Andy Tai, guix-devel

Hi,

On Thu, Jul 6, 2023 at 2:29 AM Attila Lendvai <attila@lendvai.name> wrote:
>
> a related issue is that currently there are two parallel registries for guix packages:
>
>  1) module-global variables in the guile module system
>  2) the reified package registry of guix.

Veering even further from Andy's topic of namespaces, please allow me
to suggest that we unite those two approaches.

Like Attila, I prefer the variables (except on the Guix command line).
Let's provide package variables—perhaps ending with asterisks—that
allow selections just like on the 'guix shell' command line.

They would look like that:

    (ldns* #:version "1.8.3" #:output "drill")   for   "ldns@1.8.3:drill"

Meaningful symbolic selections for the version would also be possible,
like 'stable or 'latest. When the field is omitted, the caller would
get the most recent stable version available.

Kind regards,
Felix


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-09 13:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-03 20:55 guidelines for package names (namespaces?) Andy Tai
2023-07-05 20:19 ` John Kehayias
2023-07-06  4:53   ` Csepp
2023-07-06 14:23   ` Andreas Enge
2023-07-06  9:28 ` Attila Lendvai
2023-07-06 15:24   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  -- strict thread matches above, loose matches on Subject: below --
2023-07-04 18:30 Juliana Sims

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).