unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Subject: Re: The `channels' field of `operating-system' record
Date: Wed, 10 Apr 2024 17:17:27 +0200	[thread overview]
Message-ID: <87y19li6wo.fsf@gnu.org> (raw)
In-Reply-To: <ZhLEZRLgYSlknetc@ws> (Tomas Volf's message of "Sun, 7 Apr 2024 18:05:57 +0200")

Hello,

Tomas Volf <~@wolfsden.cz> skribis:

> After ~2 hours of digging I realized this is caused by the changes in
> 883e69cdfd226c8f40b6e3b76ce0740b59857de6.
>
> I see couple of issues here (in no particular order, questions prefixed with Q):
>
> * My configuration file just *silently* stopped working.
>
> That is not great for obvious reasons.
>
> * There is no news entry

Oops, my apologies; the change felt pretty innocuous when I merged it,
but in hindsight, it seems clear that a news entry was warranted.
Lesson learned.

We can still add that news entry, though fewer people will see it now.

Thoughts?

> * Broken default behavior.
>
> Currently, out of the box, extra-special-file with "/etc/guix/channels.scm" just
> does not do anything.  No error, no warning.  That is pretty unexpected.

Yes, why is that?  At first sight, that’s because ‘extra-special-file’
does things at activation time; there’s no check happening at
configuration time.

It was really meant for /bin/sh, /usr/bin/env, and similar.  The reason
its effect is silently dismissed in this case is, I think, because its
activation runs before the /etc activation.  So it’s really bad luck.

I’m not sure what to do here, apart from maybe recommending against
broad use of this service.

> * There is no terse way to turn it off
>
> Currently my configuration contains this:
>
>       (modify-services %base-services
>         (guix-service-type
>          config => (guix-configuration
>                     (inherit config)
>                     (channels #f))))

Hmm right.  You do want to create /etc/guix/channels.scm though, right?
(Since you had it initially.)

> * Q: Is there an easy way to fill (channels)?
>
> After I learned that (channels) is a thing, I wanted to use it, but did not find
> any simple way how to do so.  My channels are in channels.scm produced by `guix
> describe --format=channels', and I do not see any simple way to pass the content
> of that file into (channels).  No, it does not accept (local-file).  I tried
> just (read)-ing it, but that too does not work.

That would be: (guix-configuration … (channels (load "channels.scm"))).

> * Q: Is the default value right?
>
> Currently it defaults to %default-channels, which causes all this magic.  Would
> it not be better to default to #f, so that it would do nothing magical out of
> the box and would be backwards compatible?  You could still turn it on by
> (Somehow?  See above.) providing desired value.

Yes, we could change the default to #f: it’s equivalent to
‘%default-channels’ but wouldn’t cause the undesirable side effect you
experienced.

Do you want to prepare a patch (or two)? :-)

Thanks for your feedback, and apologies again for the inconvenience!

Ludo’.


  reply	other threads:[~2024-04-10 15:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07 16:05 The `channels' field of `operating-system' record Tomas Volf
2024-04-10 15:17 ` Ludovic Courtès [this message]
2024-04-15 22:04   ` Tomas Volf
2024-04-19 20:10     ` Ludovic Courtès
2024-05-08 23:16   ` Tomas Volf
  -- strict thread matches above, loose matches on Subject: below --
2024-04-09  4:06 Nathan Dehnel
2024-04-09  4:16 ` Marek Paśnikowski
2024-04-09 12:28   ` Tomas Volf
2024-04-09 12:29 ` Tomas Volf
2024-04-09 12:33 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.

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=87y19li6wo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /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).