unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Cannot build personal channel derivation during guix pull
@ 2024-01-23 15:17 Marek Paśnikowski
  2024-01-23 22:09 ` Felix Lechner via
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Marek Paśnikowski @ 2024-01-23 15:17 UTC (permalink / raw)
  To: help-guix

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

Dear All

This is my first attempt to connect to my personal Guix channel. After ironing 
out server-side inadequacies in my configuration code, I encountered a very 
resilient, cryptic error.

After one day of experimentation, where nothing I did made the error change, I 
turn to your experience and knowledge. Could I ask to take a look at my 
repository ( hosted on https://git.marekpasnikowski.pl/channel.git , branch 
wip-channel - master has incorrect parens in authorization code ) and see if I 
missed anything in the file structure?

Also, I would appreciate a confirmation whether the channel can be pulled on 
your system. I do keep in mind a possibility of a local impurity or cache 
poison.

Here is my current channels.scm:

( list
  ( channel
    ( name 'guix )
    ( branch "master" )
    ( url "https://git.savannah.gnu.org/git/guix.git" )
    ( introduction
      ( make-channel-introduction
        "9edb3f66fd807b096b48283debdcddccfea34bad"
        ( openpgp-fingerprint
          "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA" ) ) ) )
  ( channel
    ( name 'personal-channel )
    ( branch "wip-channel" )
    ( introduction
      ( make-channel-introduction
        "f8ccfe8f3e5c8bafe06665cbd4b0c9301e1a64b6"
        ( openpgp-fingerprint
          "590E 500F E39D 26B3 E60B 743B 6D81 B120 7711 899F" ) ) )
    ( url "https://git.marekpasnikowski.pl/git/channel.git" ) ) )

And this is the COMPLETE build log I receive every single time:

$ zcat /var/log/guix/drvs/hg/15jjf4dr5z7lsfvcj07z2mrw69kzvp-personal-
channel.drv.gz

(repl-version 0 1 1)
(exception unbound-variable (value #f) (value "Unbound variable: ~S") (value 
(channel)) (value #f))


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-23 15:17 Cannot build personal channel derivation during guix pull Marek Paśnikowski
@ 2024-01-23 22:09 ` Felix Lechner via
  2024-01-24  1:42 ` Clément Lassieur
  2024-01-26 21:32 ` Marek Paśnikowski
  2 siblings, 0 replies; 7+ messages in thread
From: Felix Lechner via @ 2024-01-23 22:09 UTC (permalink / raw)
  To: Marek Paśnikowski, help-guix

Hi Marek,

On Tue, Jan 23 2024, Marek Paśnikowski wrote:

> (exception unbound-variable (value #f) (value "Unbound variable: ~S")
> (value (channel)) (value #f))

Not sure how those get loaded on your side. In my setup using Guix home
[1] I load (guix channels) and get no such error.

Kind regards
Felix

[1] https://codeberg.org/lechner/home-config/src/branch/history/service/channels.scm


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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-23 15:17 Cannot build personal channel derivation during guix pull Marek Paśnikowski
  2024-01-23 22:09 ` Felix Lechner via
@ 2024-01-24  1:42 ` Clément Lassieur
  2024-01-24  6:28   ` Marek Paśnikowski
  2024-01-26 21:32 ` Marek Paśnikowski
  2 siblings, 1 reply; 7+ messages in thread
From: Clément Lassieur @ 2024-01-24  1:42 UTC (permalink / raw)
  To: Marek Paśnikowski; +Cc: help-guix

Hello Marek,

On Tue, Jan 23 2024, Marek Paśnikowski wrote:

> Dear All
>
> This is my first attempt to connect to my personal Guix channel. After ironing 
> out server-side inadequacies in my configuration code, I encountered a very 
> resilient, cryptic error.
>
> After one day of experimentation, where nothing I did made the error change, I 
> turn to your experience and knowledge. Could I ask to take a look at my 
> repository ( hosted on https://git.marekpasnikowski.pl/channel.git , branch 
> wip-channel - master has incorrect parens in authorization code ) and see if I 
> missed anything in the file structure?
>
> Also, I would appreciate a confirmation whether the channel can be pulled on 
> your system. I do keep in mind a possibility of a local impurity or cache 
> poison.

I cloned your "channel.git" and checked out branch "wip-channel" but I
found nothing there that looks like a channel.  There are dotfiles, a
home and an os file, but that's not what a channel is.  A channel is a
bunch of guix modules (usually packages) that are meant to be shared.
It typically looks like guix or nonguix.

Dotfiles should not be in a channel because you don't want them to be in
your store.

If things are not meant to be shared, then there is no need to do a
channel.

Hope it helps,
Clément

P.S. Your parenthesis style doesn't help to read your code ;)

> Here is my current channels.scm:
>
> ( list
>   ( channel
>     ( name 'guix )
>     ( branch "master" )
>     ( url "https://git.savannah.gnu.org/git/guix.git" )
>     ( introduction
>       ( make-channel-introduction
>         "9edb3f66fd807b096b48283debdcddccfea34bad"
>         ( openpgp-fingerprint
>           "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA" ) ) ) )
>   ( channel
>     ( name 'personal-channel )
>     ( branch "wip-channel" )
>     ( introduction
>       ( make-channel-introduction
>         "f8ccfe8f3e5c8bafe06665cbd4b0c9301e1a64b6"
>         ( openpgp-fingerprint
>           "590E 500F E39D 26B3 E60B 743B 6D81 B120 7711 899F" ) ) )
>     ( url "https://git.marekpasnikowski.pl/git/channel.git" ) ) )
>
> And this is the COMPLETE build log I receive every single time:
>
> $ zcat /var/log/guix/drvs/hg/15jjf4dr5z7lsfvcj07z2mrw69kzvp-personal-
> channel.drv.gz
>
> (repl-version 0 1 1)
> (exception unbound-variable (value #f) (value "Unbound variable: ~S") (value 
> (channel)) (value #f))


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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-24  1:42 ` Clément Lassieur
@ 2024-01-24  6:28   ` Marek Paśnikowski
  0 siblings, 0 replies; 7+ messages in thread
From: Marek Paśnikowski @ 2024-01-24  6:28 UTC (permalink / raw)
  To: help-guix

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

Dnia środa, 24 stycznia 2024 02:42:57 CET Clément Lassieur pisze:
> Hello Marek,
> 
> On Tue, Jan 23 2024, Marek Paśnikowski wrote:
> > Dear All
> > 
> > This is my first attempt to connect to my personal Guix channel. After
> > ironing out server-side inadequacies in my configuration code, I
> > encountered a very resilient, cryptic error.
> > 
> > After one day of experimentation, where nothing I did made the error
> > change, I turn to your experience and knowledge. Could I ask to take a
> > look at my repository ( hosted on
> > https://git.marekpasnikowski.pl/channel.git , branch wip-channel - master
> > has incorrect parens in authorization code ) and see if I missed anything
> > in the file structure?
> > 
> > Also, I would appreciate a confirmation whether the channel can be pulled
> > on your system. I do keep in mind a possibility of a local impurity or
> > cache poison.
> 
> I cloned your "channel.git" and checked out branch "wip-channel" but I
> found nothing there that looks like a channel.  There are dotfiles, a
> home and an os file, but that's not what a channel is.  A channel is a
> bunch of guix modules (usually packages) that are meant to be shared.
> It typically looks like guix or nonguix.
> 
> Dotfiles should not be in a channel because you don't want them to be in
> your store.

I think the last remark is the best hint here.

Does this mean a Guix channel is NOT the git repository itself? That it MUST 
be a subfolder? The Guix manual describes a channel in no certain terms.

Could you define for me what is the minimal requirement to turn a git 
repository into a proper channel?

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-23 15:17 Cannot build personal channel derivation during guix pull Marek Paśnikowski
  2024-01-23 22:09 ` Felix Lechner via
  2024-01-24  1:42 ` Clément Lassieur
@ 2024-01-26 21:32 ` Marek Paśnikowski
  2024-01-27 17:27   ` Parnikkapore via
  2 siblings, 1 reply; 7+ messages in thread
From: Marek Paśnikowski @ 2024-01-26 21:32 UTC (permalink / raw)
  To: help-guix

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

23.01.2024 16:17:48 CET Marek Paśnikowski:
> Dear All
> 
> This is my first attempt to connect to my personal Guix channel. After
> ironing out server-side inadequacies in my configuration code, I
> encountered a very resilient, cryptic error.
> 
> After one day of experimentation, where nothing I did made the error change,
> I turn to your experience and knowledge. Could I ask to take a look at my
> repository ( hosted on https://git.marekpasnikowski.pl/channel.git , branch
> wip-channel - master has incorrect parens in authorization code ) and see
> if I missed anything in the file structure?
> 
> Also, I would appreciate a confirmation whether the channel can be pulled on
> your system. I do keep in mind a possibility of a local impurity or cache
> poison.
> 
> Here is my current channels.scm:
> 
> ( list
>   ( channel
>     ( name 'guix )
>     ( branch "master" )
>     ( url "https://git.savannah.gnu.org/git/guix.git" )
>     ( introduction
>       ( make-channel-introduction
>         "9edb3f66fd807b096b48283debdcddccfea34bad"
>         ( openpgp-fingerprint
>           "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA" ) ) ) )
>   ( channel
>     ( name 'personal-channel )
>     ( branch "wip-channel" )
>     ( introduction
>       ( make-channel-introduction
>         "f8ccfe8f3e5c8bafe06665cbd4b0c9301e1a64b6"
>         ( openpgp-fingerprint
>           "590E 500F E39D 26B3 E60B 743B 6D81 B120 7711 899F" ) ) )
>     ( url "https://git.marekpasnikowski.pl/git/channel.git" ) ) )
> 
> And this is the COMPLETE build log I receive every single time:
> 
> $ zcat /var/log/guix/drvs/hg/15jjf4dr5z7lsfvcj07z2mrw69kzvp-personal-
> channel.drv.gz
> 
> (repl-version 0 1 1)
> (exception unbound-variable (value #f) (value "Unbound variable: ~S") (value
> (channel)) (value #f))

SOLVED

I am tired of still having to deal with this, so please forgive for using the 
minimal words to share the solution.



I have experimentally, in three reproduction cycles, found out the following 
"Laws of Guix Channel":

1. .guix-channel file must exist in the top directory, and must include as 
dependencies all other channels implied with (use-modules) or #:use-module in 
the file tree.

2. All .scm files in the file tree must be proper modules.

3. .guix-authorizations in the top directory is optional.

On top of this, Guix does not care if the given directory is version tracked. 
In my case, I was able to use my "secrets" directory (which is a plain, 
external subfolder), as a dependency of my channel, with no issues.



Thank you Felix, for making me aware of how to integrate the channels.scm file 
into the home-configuration data structure cleanly. I will use this 
information in future.

Thank you Clement for taking a look at my code. Even if your comments were not 
directly helpful, they were indeed a valuable input in my experimentation 
logic.



PS: If you are curious, here is a link to the code commit which documents this 
chain of error-solutions. Do note that the description chronology is reversed, 
due to git's behaviour when squashing. The referenced commits are archived in 
the museum-fix-channel-pull branch.

https://git.marekpasnikowski.pl/channel.git/commit/?
id=223caedde6ea3c4fb3a5c285a0f70ea443dd7ef0

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-26 21:32 ` Marek Paśnikowski
@ 2024-01-27 17:27   ` Parnikkapore via
  2024-01-28 12:23     ` Marek Paśnikowski
  0 siblings, 1 reply; 7+ messages in thread
From: Parnikkapore via @ 2024-01-27 17:27 UTC (permalink / raw)
  To: Marek Paśnikowski, help-guix

On Fri, 2024-01-26 at 22:32 +0100, Marek Paśnikowski wrote:
> 
> I have experimentally, in three reproduction cycles, found out the following <br>
> "Laws of Guix Channel":

Glad to hear that you have figured it out! Sorry about not emailling you earlier.

That "import a local directory with secrets" trick seems like a nice one to have in the bag!

There's an extra law of Guix channels: all files within the file tree whose name ends with .scm must be runnable in the build environment (i.e. no network, no access to e.g. your home directory, etc.). This means that `guix repl -L $FILE_TREE_ROOT $FILE_TREE_ROOT/any/file.scm` must run and terminate without throwing any unhandled exceptions. (passing this test doesn't guarantee that it will work, however.)

I'm not sure if having .scm files that are not modules within the file tree would themselves cause a problem, but doing so is definitely unsupported territory.

One more thing: the root of the "file tree" need not be the root of the Git repo; it can be a subdirectory inside the repo. See https://guix.gnu.org/manual/devel/en/html_node/Package-Modules-in-a-Sub_002ddirectory.html . In fact, this might be a more appropriate solution for your monorepo - see https://guix.gnu.org/en/blog/2023/from-development-environments-to-continuous-integrationthe-ultimate-guide-to-software-development-with-guix/ for an example.

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

* Re: Cannot build personal channel derivation during guix pull
  2024-01-27 17:27   ` Parnikkapore via
@ 2024-01-28 12:23     ` Marek Paśnikowski
  0 siblings, 0 replies; 7+ messages in thread
From: Marek Paśnikowski @ 2024-01-28 12:23 UTC (permalink / raw)
  To: help-guix

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

27.01.2024 18:27:23 CET Parnikkapore via:

> That "import a local directory with secrets" trick seems like a nice one to
> have in the bag!

It really is. Last night I also came up with a more general notion of "private 
inputs". Those could be not only secrets, but also things like channel branch 
names in the channels.scm files. Basically any data that does not really need 
to be version tracked, or data which you do not want to track, like options 
which you want to experiment with in a wip-branch, without having to commit 
every time you flip an A/B test...

The private inputs allow you to technically maintain functional purity, even 
if in the view of a particular repository, you create something that looks 
like side effects.
 
> There's an extra law of Guix channels: all files within the file tree whose
> name ends with .scm must be runnable in the build environment (i.e. no
> network, no access to e.g. your home directory, etc.). This means that
> `guix repl -L $FILE_TREE_ROOT $FILE_TREE_ROOT/any/file.scm` must run and
> terminate without throwing any unhandled exceptions. (passing this test
> doesn't guarantee that it will work, however.)

That makes total sense to me. I was not able to deduce that, because I only 
used "guix home reconfigure" and "guix pull" as my test suite. This means I 
was always using the isolated environment, and thus was not able to see the 
differences to a "guix repl".

> I'm not sure if having .scm files that are not modules within the file tree
> would themselves cause a problem, but doing so is definitely unsupported
> territory.

I have already proven that it is not possible to include .scm files which are 
not modules. Guix will complain that there is "no code for module (whatever 
file path)" when pulling.

> One more thing: the root of the "file tree" need not be the root of the Git
> repo; it can be a subdirectory inside the repo. See
> https://guix.gnu.org/manual/devel/en/html_node/Package-Modules-in-a-Sub_002
> ddirectory.html . In fact, this might be a more appropriate solution for
> your monorepo - see
> https://guix.gnu.org/en/blog/2023/from-development-environments-to-continuo
> us-integrationthe-ultimate-guide-to-software-development-with-guix/ for an
> example.

Yes, the (directory) field of (channel) in .guix-channel . This is why a guix 
channel must not be equal to a version tracked repository.

I would like to kindly remind everyone who reads this not to assume things too 
much. My personal /git/channel.git WAS not, IS not, and WILL not be a 
monorepo. What it happens to be is that it is my first stab at creation of a 
remote channel.

Right now it is catch-all for my existing system and home configurations. 
However, for every piece of software I package, I will do so in a new channel, 
which is a fork of the software's repository. And I do have a grand dream of 
writing my own distribution of Guix, which will warrant yet another channel, 
if not more.

Also, I personally dislike the monolith architecture. This is why my codebase 
right now is such a tangled mess - I tried using the noweb feature of Emacs 
Org, but that thing does not scale well... And now I have more pressing 
problems to solve than a refactor, which I will have to do regardless, when I 
eventually learn to define parameterized services.

:-)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-01-28 12:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 15:17 Cannot build personal channel derivation during guix pull Marek Paśnikowski
2024-01-23 22:09 ` Felix Lechner via
2024-01-24  1:42 ` Clément Lassieur
2024-01-24  6:28   ` Marek Paśnikowski
2024-01-26 21:32 ` Marek Paśnikowski
2024-01-27 17:27   ` Parnikkapore via
2024-01-28 12:23     ` Marek Paśnikowski

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