unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Development repositories as Guix channels
@ 2023-07-06 14:35 Arun Isaac
  2023-07-06 17:40 ` Daniel Meißner
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2023-07-06 14:35 UTC (permalink / raw)
  To: guix-devel; +Cc: Ludovic Courtès, Efraim Flashner


Hi,

This is with reference to the "Level 2: The repository as a channel"
section in the Guix blog post "From development environments to
continuous integration—the ultimate guide to software development with
Guix"[1]. This section describes how to convert a project repository
into a Guix channel so that the repository can double as a way to
distribute packages. I have been trying to follow the instructions and
have hit a little snag.

The post says the source field of the package definition should be a
local-file file-like object. This is fine as long as we are using `guix
build' to build packages in the repository. But, when the repository is
distributed as a channel, the local-file becomes meaningless. The
channel only has access to the sources under the .guix/modules directory
and none of the sources required to build the package itself.

It seems to me that it is not possible to distribute project
repositories as Guix channels. But hopefully, I'm missing something
simple. Could anybody please clarify?

I'm CCing Ludo since they are the author of the blog post in question,
and I'm CCing Efraim since I know they are working on something similar.

Thanks,
Arun

[1]: https://guix.gnu.org/blog/2023/from-development-environments-to-continuous-integrationthe-ultimate-guide-to-software-development-with-guix/


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

* Re: Development repositories as Guix channels
  2023-07-06 14:35 Development repositories as Guix channels Arun Isaac
@ 2023-07-06 17:40 ` Daniel Meißner
  2023-07-09 23:07   ` Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Meißner @ 2023-07-06 17:40 UTC (permalink / raw)
  To: guix-devel, Arun Isaac; +Cc: Ludovic Courtès, Efraim Flashner

Hi Arun,

Am 6. Juli 2023 16:35:06 MESZ schrieb Arun Isaac <arunisaac@systemreboot.net>:
> 
> Hi,
> 
> This is with reference to the "Level 2: The repository as a channel"
> section in the Guix blog post "From development environments to
> continuous integration—the ultimate guide to software development with
> Guix"[1]. This section describes how to convert a project repository
> into a Guix channel so that the repository can double as a way to
> distribute packages. I have been trying to follow the instructions and
> have hit a little snag.
> 
> The post says the source field of the package definition should be a
> local-file file-like object. This is fine as long as we are using `guix
> build' to build packages in the repository. But, when the repository is
> distributed as a channel, the local-file becomes meaningless. The
> channel only has access to the sources under the .guix/modules directory
> and none of the sources required to build the package itself.
> 
> It seems to me that it is not possible to distribute project
> repositories as Guix channels. But hopefully, I'm missing something
> simple. Could anybody please clarify?

I have recently followed the instructions from this blog post as well and indeed you are right that it does not work as advertised. There's however only a small mistake in the changes for Level 2. You have to replace the relative path in the local-file form with "../.." as that gives you the root of your source tree relative to the new location of the Scheme file. Then everything works nicely. Even building the package with `guix build -f guix.scm' works from the root of the tree. Somehow Guile computes the directory relative to real file and not the symlink. Didn't expect.

Bonus: I have even setup CI via Cuirass which was surprisingly easy on a Guix system and now it rebuilds my package every time one of its inputs in Guix changes ❤️ This is awesome! Thanks for this blog post, it was inspiring.

Hope that helps

Best

-- 
Daniel


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

* Re: Development repositories as Guix channels
  2023-07-06 17:40 ` Daniel Meißner
@ 2023-07-09 23:07   ` Arun Isaac
  2023-07-16 13:22     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2023-07-09 23:07 UTC (permalink / raw)
  To: Daniel Meißner, guix-devel; +Cc: Ludovic Courtès, Efraim Flashner


Hi Daniel,

> You have to replace the relative path in the local-file form with
> "../.." as that gives you the root of your source tree relative to the
> new location of the Scheme file. Then everything works nicely.

Thank you! That's all I was missing. Now everything works perfectly!

> Bonus: I have even setup CI via Cuirass which was surprisingly easy on
> a Guix system and now it rebuilds my package every time one of its
> inputs in Guix changes ❤️

I'm working towards a CI system too. It's lovely!

Regards,
Arun


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

* Re: Development repositories as Guix channels
  2023-07-09 23:07   ` Arun Isaac
@ 2023-07-16 13:22     ` Ludovic Courtès
  2023-07-16 17:58       ` Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2023-07-16 13:22 UTC (permalink / raw)
  To: Arun Isaac; +Cc: Daniel Meißner, guix-devel, Efraim Flashner

Hi!

Arun Isaac <arunisaac@systemreboot.net> skribis:

>> You have to replace the relative path in the local-file form with
>> "../.." as that gives you the root of your source tree relative to the
>> new location of the Scheme file. Then everything works nicely.
>
> Thank you! That's all I was missing. Now everything works perfectly!

Another person reported that missing bit to me and I’ve now fixed the
blog post.  Apologies for the waste of time!

Ludo’.


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

* Re: Development repositories as Guix channels
  2023-07-16 13:22     ` Ludovic Courtès
@ 2023-07-16 17:58       ` Arun Isaac
  0 siblings, 0 replies; 5+ messages in thread
From: Arun Isaac @ 2023-07-16 17:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Daniel Meißner, guix-devel, Efraim Flashner


> Another person reported that missing bit to me and I’ve now fixed the
> blog post.  Apologies for the waste of time!

No worries! It's been a very enlightening blog post. Thanks for writing
it!


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

end of thread, other threads:[~2023-07-16 18:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 14:35 Development repositories as Guix channels Arun Isaac
2023-07-06 17:40 ` Daniel Meißner
2023-07-09 23:07   ` Arun Isaac
2023-07-16 13:22     ` Ludovic Courtès
2023-07-16 17:58       ` Arun Isaac

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