help-guix
[Top][All Lists]
Advanced

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

Re: How to run a program from an old generation?


From: Zelphir Kaltstahl
Subject: Re: How to run a program from an old generation?
Date: Sat, 8 Jan 2022 14:02:55 +0000

Hi Alex!

I'll describe a way, how I usually manage this. This might be a bad way. I don't
know. If anyone thinks, that I am doing it in an unnecessarily complicated way,
please tell me : )

You can use a channels.scm file, to refer to the commit, which your GNU Guix is
currently on as follows:

~~~~
guix describe --format=channels > channels.scm
~~~~

which results in something like:

~~~~
(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git";)
        (commit
          "893a31ec20f47b979c1be9fb8b942809228ba4c9")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
~~~~

Then you can specify the packages you need in some manifest.scm file, for 
example:

~~~~
(specifications->manifest
 '("guile"
   "guile-json"))
~~~~

Note, that you do not need to specify the versions in the manifest file, as the
are already clear/specified indirectly from the channel you have defined in
channels.scm. Then you can run the following command to get an environment with
the packages installed:

~~~~
guix time-machine \
     --channels="channels.scm" -- \
     environment \
     --manifest="manifest.scm"
~~~~

Now the question is, how you find the correct channel specification, for the GNU
Guix commit, which has the version of the package you need. There might be a
better way to search via command line or so, but I don't know it, or forgot it,
or it is still in development. Here is one way I know:

(1) Go to https://hpc.guix.info/browse <https://hpc.guix.info/browse>
(2) search for the package you need there and
(3) click the result which has the name of the package you are looking for. The
version should not matter yet.
(4) At the page loaded then, at the bottom, there should be a link "View package
version history.". Click that link.
(5) You should be seeing an overview of which versions were available on which
commit ranges. You need to look for the commit, which still has the package in
the version you need.
(6) Take that commit id.

Then you can for example run the following command:

~~~~
guix time-machine \
     --commit='7fb7384134d21e2d491e0d92a8d550fe3acaa682' -- \
     environment \
     --manifest="manifest.scm"
~~~~

If you need packages in versions, which do not have a shared/common commit id, I
am not sure how to handle it, but I am guessing, that you could put multiple
channels in a channels.scm file and run the time-machine command with that
channels.scm file.

(Can anyone confirm, that this is how it is done?)

I am also not sure, whether that could lead to any kind of conflicts between the
dependencies of specified packages.

I am not sure how to run guix time-machine with multiple commits. Have not tried
to do it yet.

After getting an environment with that commit id / revision, I am not sure how
to translate that back into a channels.scm file. The channels.scm file contains
the commit id, but it also contains another id, in (what follows is an example):

~~~~
(make-channel-introduction
  "9edb3f66fd807b096b48283debdcddccfea34bad"
  ...)
~~~~

which I am not sure what it is.

Can anyone explain how to get a channels.scm file from an environment or from a
commit id / revision?

Hope this helps and thanks!
Best regards,
Zelphir

On 1/7/22 6:01 PM, help-guix-request@gnu.org wrote:
> Dear all,
>
> I currently have an issue with nextcloud-client segfaulting in the
> current guix environment. Until this is fixed an option were to switch
> to the old generation where it still worked, start it and switch back to
> the current generation.  Is there an option to run a program in a
> specific generation without completely switching to it? I didn't found
> any so far.  I know that's a real hack but at least that way I could
> have my files synchronized without too much effort until the bug is
> fixed.
>
> Another question I have is: can I install version 3.1.3 of
> nextcloud-client in the current environment (without switching back to
> some old commit)? When I try to do so, I get
>
>> guix install: error: nextcloud-client: package not found for version 3.1.3
> because version 3.1.3 was replaced by 3.2.0.
>
> Cheers (and a happy new year!)
>
> Alex

-- 
repositories: https://notabug.org/ZelphirKaltstahl



reply via email to

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