guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs integration for 'guix shell'


From: zimoun
Subject: Re: Emacs integration for 'guix shell'
Date: Tue, 27 Sep 2022 16:39:29 +0200

Hi,

On Tue, 27 Sep 2022 at 08:06, Olivier Dion via "Development of GNU Guix and the 
GNU System distribution." <guix-devel@gnu.org> wrote:

> --8<---------------cut here---------------start------------->8---
> #!/bin/sh
>  guix time-machine -C channels.scm    \
>      -- shell --pure                  \
>      --development $(basename $(pwd)) \
>       -- $@
> --8<---------------cut here---------------end--------------->8---
>
> Of course you need to A) have a channels.scm in your project and B) have
> your project directory named after the package's name in your
> channel.

Personally, I prefer the ’-m manifest.scm’ approach.  Or maybe the ’-f
guix.scm’ approach.

Because I use ’guixify’ for more than just “developing“.  I mean
sometimes the manifest is just a list of packages, sometimes it contains
some development dependencies, sometimes some extra package definition,
etc.

Then this file manifest.scm or guix.scm is part of the project, i.e.,
included in the Git tree of the project.  I can re-use it for ‘guix pack
-f docker -m mnifest.scm’ and generate a Docker pack for colleagues.  I
can use it for ‘guix weather’ and know if the substitutes are there
before upgrading.  Etc.



> I was using channel too before!  It felt good to pin dependencies to a
> version so it does not break while you're developing.  Howeverff, I felt
> that the time-machine was taking enormous time everytime a push was made
> to a channel.

It is because you are not using a pinned channel and instead following
the HEAD of some channels.

Because if you store:

    guix describe -f channels.scm > channels.scm

then the first time you can ‘guix time-machine -C channels.scm’ I agree
it can take some time (because a compute derivation).  But then, each
new invocation should be faster because it is cached.

However, indeed it is possible that ‘guix gc’ cleans up the temporary
profile; depending on how often you are working inside this project
environment.

To avoid this issue, sometime I create a profile inside the project
directory,

    guix time-machine -C channels.scm \
         -- package -m manifest.scm   \
         -p profile

then sometime I run ‘guix package --search-paths -p profile’; using some
options of search-paths as prefix, suffix or exact.

Well, the point with this profile is to protect against garbage
collection; although it is not a bullet-proof protection.  I have never
really used ‘guix shell --root’ but it is probably what is needed.

All that to say that I am not totally happy with my workflow because I
do not know what interface I want. :-)


Cheers,
simon







reply via email to

[Prev in Thread] Current Thread [Next in Thread]