unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: gyps@member.fsf.org
Cc: help-guix <help-guix@gnu.org>
Subject: Re: How to run a program from an old generation?
Date: Sat,  8 Jan 2022 14:02:55 +0000	[thread overview]
Message-ID: <07cae27e-c1e9-b87e-81a6-502565236965@posteo.de> (raw)
In-Reply-To: <mailman.81.1641574883.4865.help-guix@gnu.org>

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	other threads:[~2022-01-08 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.81.1641574883.4865.help-guix@gnu.org>
2022-01-08 14:02 ` Zelphir Kaltstahl [this message]
2022-01-06 10:29 How to run a program from an old generation? Γυψ
2022-01-06 11:18 ` Γυψ
2022-01-07 18:11 ` Wiktor Żelazny

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=07cae27e-c1e9-b87e-81a6-502565236965@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=gyps@member.fsf.org \
    --cc=help-guix@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.
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).