unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Re: How to install previous versions?
  2020-10-09 17:00 How to install previous versions? Zelphir Kaltstahl
@ 2020-10-09 16:37 ` zimoun
  2020-10-10 15:14   ` Zelphir Kaltstahl
  0 siblings, 1 reply; 6+ messages in thread
From: zimoun @ 2020-10-09 16:37 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

Hi,

On Fri, 9 Oct 2020 at 19:19, Zelphir Kaltstahl
<zelphirkaltstahl@posteo.de> wrote:

> http://data.guix.gnu.org/repository/1/branch/master/package/python-redis.

On this web page, you can click on the date: first commit and last
commit known to have this version.  You can even see the status
(build, failed, pending, etc.) on this web page (appending
'output-history')

http://data.guix.gnu.org/repository/1/branch/master/package/python-redis/output-history

For example, clicking leads to:

http://data.guix.gnu.org/revision/f5111b4d2b982d58387188bc3018e4dd2e9a9d4f

And this gives you the commit with 'python-redis@3.8', using the command:

  guix time-machine --commit=f5111b \
         -- environment --ad-hoc python-redis python \
         -- python


> So how would I need to write my manifest.scm or my one-liner to get back
> to that older version?

The best is to write a manifest file, say manifest.scm containing the
package you need:

--8<---------------cut here---------------start------------->8---
(specfications->manifest
  (list
   "python-redis"
   "python"
   "foo"
   "bar"
   "etc"))
--8<---------------cut here---------------end--------------->8---

The other no-so-said is to track "guix describe", you *should* _track_
the file channels.scm:

   guix describe -f channels.scm

Then later or on another machine, you simply run the command:

   guix time-machine -C path/to/channels.scm \
          -- <subcommand> -m path/to/manifest.scm <options>


Hope that helps,
simon


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

* How to install previous versions?
@ 2020-10-09 17:00 Zelphir Kaltstahl
  2020-10-09 16:37 ` zimoun
  0 siblings, 1 reply; 6+ messages in thread
From: Zelphir Kaltstahl @ 2020-10-09 17:00 UTC (permalink / raw)
  To: help-guix

Hello Guix Users!

I have not figured out yet how to install a specific version of a
package, that is not the newest available version.

For example I do the following:

~~~~
guix environment --ad-hoc 'python-redis@3.3.8' 'python@3.8.2' -- python3.8
~~~~

I had this version of python-redis in a manifest.scm file. However,
there seems to have been an update and now this manifest file cannot be
used any longer, as it references an old version. It will tell me the
same error as the one-liner above:

~~~~
guix environment: error: python-redis: package not found for version 3.3.8
~~~~

However, I think that is strange, because I can definitely see, that
version does exist on
http://data.guix.gnu.org/repository/1/branch/master/package/python-redis.
There are now the versions:

'(3.5.3 3.3.8 3.2.1 3.2.0 2.10.6)

So how would I need to write my manifest.scm or my one-liner to get back
to that older version?

I would like to have reproducible environments and I think that is also
a goal of GNU Guix package manager? Otherwise how could it ever
guarantee, that on 2 different machines at 2 different points in time, I
can build the same environment? A package could have been updated in
between the 2 setups and then the previously latest version would become
unavailable. I must be missing something.

Best regards,
Zelphir


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

* Re: How to install previous versions?
  2020-10-09 16:37 ` zimoun
@ 2020-10-10 15:14   ` Zelphir Kaltstahl
  2020-10-10 16:44     ` zimoun
  0 siblings, 1 reply; 6+ messages in thread
From: Zelphir Kaltstahl @ 2020-10-10 15:14 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

Hello Zimoun!

Thank you for your reply! I have a few follow up questions.

On 10/9/20 6:37 PM, zimoun wrote:
> Hi,
>
> On Fri, 9 Oct 2020 at 19:19, Zelphir Kaltstahl
> <zelphirkaltstahl@posteo.de> wrote:
>
>> http://data.guix.gnu.org/repository/1/branch/master/package/python-redis.
> On this web page, you can click on the date: first commit and last
> commit known to have this version.  You can even see the status
> (build, failed, pending, etc.) on this web page (appending
> 'output-history')
>
> http://data.guix.gnu.org/repository/1/branch/master/package/python-redis/output-history

So far so good, I get until this point.


> For example, clicking leads to:
>
> http://data.guix.gnu.org/revision/f5111b4d2b982d58387188bc3018e4dd2e9a9d4f

Here is where I am lost. Where do I need to click?

I see a link named
`/gnu/store/wlj2bq4g9ki9iz6vqlv366c0v5qmszg7-python-redis-3.3.8`, which
seems to be the latest of the python-redis 3.3.8 version, but that one
leads me elsewhere, leads me to
`http://data.guix.gnu.org/gnu/store/wlj2bq4g9ki9iz6vqlv366c0v5qmszg7-python-redis-3.3.8`.

> And this gives you the commit with 'python-redis@3.8', using the command:
>
>   guix time-machine --commit=f5111b \
>          -- environment --ad-hoc python-redis python \
>          -- python

OK, assume I get the commit id.

I just tried this with the following command:

~~~~
guix time-machine --commit=f5111b -- environment --ad-hoc 'python-redis@3.3.8' 'python@3.8' -- python3.8
~~~~

That runs for a quite while and then I get:

~~~~
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guile: warning: failed to install locale
guix environment: error: python: package not found for version 3.8.2
~~~~

My guess is, that in this commit of Guix there was no Python 3.8.2 yet?
Or perhaps `python-redis` was not build for that Python version?

I do not have a specific use-case at this moment, but I would like to
know how to get those specific versions, the same every single time I
run the command. To compare, when I create a virtual environment using:

~~~~
python3 -m venv venv
source venv/bin/activate
pip install --requirement requirements.txt
~~~~

I can write the version of python-redis in my requirements.txt file and
it will install just fine. That means, that is it compatible, so it's
not a compatibility issue of python@3.8.2 and python-redis@3.3.8.
However, those virtual environments are not reproducible, as there are
no hashes stored or anything and everything relies on version numbers
only. If anyone changed the code behind a version number, it would
install different code. It would be cooler to have it in Guix and
reproducible.

>> So how would I need to write my manifest.scm or my one-liner to get back
>> to that older version?
> The best is to write a manifest file, say manifest.scm containing the
> package you need:
>
> --8<---------------cut here---------------start------------->8---
> (specfications->manifest
>   (list
>    "python-redis"
>    "python"
>    "foo"
>    "bar"
>    "etc"))
> --8<---------------cut here---------------end--------------->8---
But that is, what I already have, isn't it? There is no part in this,
that indicates `guix time-machine`. If time-machine is necessary to get
the older version of python-redis@3.3.8 in the command line, then there
must be something I need to write in the manifest.scm file to let Guix
know, that I want a specific commit id. Or perhaps this is not possible
with a manifest? Or is the idea, that I need to have a tracked channel
as well to achieve it?
> The other no-so-said is to track "guix describe", you *should* _track_
> the file channels.scm:
>
>    guix describe -f channels.scm
OK this is probably the part, where I need to read the docs about it. I
do not have a channels.scm and I do not know what does in there. I only
have a vague idea about channels in my head.
>
> Then later or on another machine, you simply run the command:
>
>    guix time-machine -C path/to/channels.scm \
>           -- <subcommand> -m path/to/manifest.scm <options>
If I understand this correctly, a manifest with specific versions can
only be guaranteed to work, if I track a channel as well. And somehow in
that channel definition, I must specify which commit of Guix I am on?
But wouldn't that limit my choice of libraries to what was available in
one commit?
> Hope that helps,
> simon

Thanks for all that info. There are still many things unclear to me, but
I hope to gain an understanding of those as well : )

Best regards,
Zelphir

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


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

* Re: How to install previous versions?
  2020-10-10 15:14   ` Zelphir Kaltstahl
@ 2020-10-10 16:44     ` zimoun
  2020-10-12 13:58       ` Zelphir Kaltstahl
  0 siblings, 1 reply; 6+ messages in thread
From: zimoun @ 2020-10-10 16:44 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

Dear,

On Sat, 10 Oct 2020 at 17:15, Zelphir Kaltstahl
<zelphirkaltstahl@posteo.de> wrote:

> For example, clicking leads to:
>
> http://data.guix.gnu.org/revision/f5111b4d2b982d58387188bc3018e4dd2e9a9d4f
>
> Here is where I am lost. Where do I need to click?

Click on one date.  The row is:

     Version Output Builds From To

and From mean the date of the first commit where the package is at the
version Version.
To is the date of the last commit.


> And this gives you the commit with 'python-redis@3.8', using the command:
>
>   guix time-machine --commit=f5111b \
>          -- environment --ad-hoc python-redis python \
>          -- python
>
> OK, assume I get the commit id.
>
> I just tried this with the following command:
>
> ~~~~
> guix time-machine --commit=f5111b -- environment --ad-hoc 'python-redis@3.3.8' 'python@3.8' -- python3.8
> ~~~~

Remove the '@X.Y'.  It does not make sense since it is somehow already
included by the specification of the commit.


> My guess is, that in this commit of Guix there was no Python 3.8.2 yet? Or perhaps `python-redis` was not build for that Python version?

The "guix time-machine" gives you the exact same Guix as it was at the
commit specification.  Therefore, since the commit f5111b provides the
version of python-redis you want, all the others do matter.


> I do not have a specific use-case at this moment, but I would like to know how to get those specific versions, the same every single time I run the command. To compare, when I create a virtual environment using:

As I have tried to explain. :-)

In your project directory, you have to add 2 files about Guix:

   guix describe -f channels > channels.scm

and the manifest.scm file containing the list of packages the project
requires.  Then at any point in time, you can always do:

   guix time-machine -C channels.scm -- <subcommand> -m manifest <options>


> ~~~~
> python3 -m venv venv
> source venv/bin/activate
> pip install --requirement requirements.txt
> ~~~~

The issue with this approach is that somehow you need a SAT solver.
But that's another story. ;-)

With Guix, AFAICT, the similar is:
 - channels.scm which specifies a Guix version and so packages versions
 - manifest.scm which specifies the list of packages.


> But that is, what I already have, isn't it? There is no part in this, that indicates `guix time-machine`. If time-machine is necessary to get the older version of python-redis@3.3.8 in the command line, then there must be something I need to write in the manifest.scm file to let Guix know, that I want a specific commit id. Or perhaps this is not possible with a manifest? Or is the idea, that I need to have a tracked channel as well to achieve it?

It is possible with the manifest but AFAIU it is a bit tricky and you
should write some Scheme.  The easiest is using a channels.scm file.
See above.


> The other no-so-said is to track "guix describe", you *should* _track_
> the file channels.scm:
>
>    guix describe -f channels.scm
>
> OK this is probably the part, where I need to read the docs about it. I do not have a channels.scm and I do not know what does in there. I only have a vague idea about channels in my head.

Maybe with the output is easier to get the point. :-)

--8<---------------cut here---------------start------------->8---
$ guix describe -f channels
(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git")
        (commit
          "a0d4aa2457d7e36012143ffe3fbc9dd4bc20ca4f")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
--8<---------------cut here---------------end--------------->8---

Basically, I have only one channel which is the official GNU Guix
"%default-channels".  The important information here are:

 - url: from where it fetch
 - commit: which checkout uses

Therefore, "guix time-machine -C the/channel./file.scm -- help" will
fetch from url and restore at the commit.

The other parts are important too. ;-)  But not for your question. :-)
Well, basically you can even drop them and it will be fine.

So yes, please go read the channel section.  It has recently been
reordered to be more "understandable".  Feedback is very welcome. :-)


> Then later or on another machine, you simply run the command:
>
>    guix time-machine -C path/to/channels.scm \
>           -- <subcommand> -m path/to/manifest.scm <options>
>
> If I understand this correctly, a manifest with specific versions can only be guaranteed to work, if I track a channel as well. And somehow in that channel definition, I must specify which commit of Guix I am on? But wouldn't that limit my choice of libraries to what was available in one commit?

Yes, the same way the choice of libraries is limited at each commit state. :-)

It is possible to mix libraries from different commits but the UI is
not as easy as it should be.

For example, imagine you are doing:

  guix pull
  guix install -m foo.scm /tmp/A
  [...] # time flies
  guix pull
  guix install -m bar.scm /tmp/B

And let assume that foo and bar are *not* coming from the same Guix
commit.  You can still do:

  guix package --search-paths -p /tmp/A -p /tmp/B

and therefore mix the two libraries.

Well, using the time-machine, you need to track the commit which
provided foo and the one of bar.  Then:

  guix time-machine --commit=commit-A -- install -m foo.scm -p /tmp/AA
  guix time-machine --commit=commit-B -- install -m bar.scm -p /tmp/BB

Then "guix package --search-paths -p /tmp/AA -p /tmp/BB" should
provide the exact same thing as before.

That's why it is important to track the Guix commit (guix describe -f
channels) of software you are installing.  Without this piece of
information, it is (almost) impossible to reinstall (other point in
time or space) the exact same version of the very software.

Hope that helps,
simon


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

* Re: How to install previous versions?
  2020-10-10 16:44     ` zimoun
@ 2020-10-12 13:58       ` Zelphir Kaltstahl
  2020-10-12 14:29         ` zimoun
  0 siblings, 1 reply; 6+ messages in thread
From: Zelphir Kaltstahl @ 2020-10-12 13:58 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

Hi Zimoun!

Thank you for your detailed reply! You've given me something to chew on.
In the meantime I wrote down everything I understood so far here:
https://notabug.org/ZelphirKaltstahl/guix-package-manager-tutorials/src/master/guide.org

I'll try to get the "versions of packages from multiple GNU Guix
commits" part done there as well.

I also have another question: What is the best way to find out about
until which commit id a package was available in a specific version? Is
that website the only way, or is there a way from command line to search
for the GNU Guix commit? Something like:

~~~~
guix search-guix-commit-for-package-with-version python-redis@3.3.8 --last
--> Revision c7011ff850420fdbe1319b3d218bd362f2f9d618
guix search-guix-commit-for-package-with-version python-redis@3.3.8 --first
--> Revision f5111b4d2b982d58387188bc3018e4dd2e9a9d4f
~~~~

or at least something only involving command line and not requiring me
to bisect on GNU Guix commits ^^?

Best regards,
Zelphir

On 10/10/20 6:44 PM, zimoun wrote:
> Dear,
>
> On Sat, 10 Oct 2020 at 17:15, Zelphir Kaltstahl
> <zelphirkaltstahl@posteo.de> wrote:
>
>> For example, clicking leads to:
>>
>> http://data.guix.gnu.org/revision/f5111b4d2b982d58387188bc3018e4dd2e9a9d4f
>>
>> Here is where I am lost. Where do I need to click?
> Click on one date.  The row is:
>
>      Version Output Builds From To
>
> and From mean the date of the first commit where the package is at the
> version Version.
> To is the date of the last commit.
>
>
>> And this gives you the commit with 'python-redis@3.8', using the command:
>>
>>   guix time-machine --commit=f5111b \
>>          -- environment --ad-hoc python-redis python \
>>          -- python
>>
>> OK, assume I get the commit id.
>>
>> I just tried this with the following command:
>>
>> ~~~~
>> guix time-machine --commit=f5111b -- environment --ad-hoc 'python-redis@3.3.8' 'python@3.8' -- python3.8
>> ~~~~
> Remove the '@X.Y'.  It does not make sense since it is somehow already
> included by the specification of the commit.
>
>
>> My guess is, that in this commit of Guix there was no Python 3.8.2 yet? Or perhaps `python-redis` was not build for that Python version?
> The "guix time-machine" gives you the exact same Guix as it was at the
> commit specification.  Therefore, since the commit f5111b provides the
> version of python-redis you want, all the others do matter.
>
>
>> I do not have a specific use-case at this moment, but I would like to know how to get those specific versions, the same every single time I run the command. To compare, when I create a virtual environment using:
> As I have tried to explain. :-)
>
> In your project directory, you have to add 2 files about Guix:
>
>    guix describe -f channels > channels.scm
>
> and the manifest.scm file containing the list of packages the project
> requires.  Then at any point in time, you can always do:
>
>    guix time-machine -C channels.scm -- <subcommand> -m manifest <options>
>
>
>> ~~~~
>> python3 -m venv venv
>> source venv/bin/activate
>> pip install --requirement requirements.txt
>> ~~~~
> The issue with this approach is that somehow you need a SAT solver.
> But that's another story. ;-)
>
> With Guix, AFAICT, the similar is:
>  - channels.scm which specifies a Guix version and so packages versions
>  - manifest.scm which specifies the list of packages.
>
>
>> But that is, what I already have, isn't it? There is no part in this, that indicates `guix time-machine`. If time-machine is necessary to get the older version of python-redis@3.3.8 in the command line, then there must be something I need to write in the manifest.scm file to let Guix know, that I want a specific commit id. Or perhaps this is not possible with a manifest? Or is the idea, that I need to have a tracked channel as well to achieve it?
> It is possible with the manifest but AFAIU it is a bit tricky and you
> should write some Scheme.  The easiest is using a channels.scm file.
> See above.
>
>
>> The other no-so-said is to track "guix describe", you *should* _track_
>> the file channels.scm:
>>
>>    guix describe -f channels.scm
>>
>> OK this is probably the part, where I need to read the docs about it. I do not have a channels.scm and I do not know what does in there. I only have a vague idea about channels in my head.
> Maybe with the output is easier to get the point. :-)
>
> --8<---------------cut here---------------start------------->8---
> $ guix describe -f channels
> (list (channel
>         (name 'guix)
>         (url "https://git.savannah.gnu.org/git/guix.git")
>         (commit
>           "a0d4aa2457d7e36012143ffe3fbc9dd4bc20ca4f")
>         (introduction
>           (make-channel-introduction
>             "9edb3f66fd807b096b48283debdcddccfea34bad"
>             (openpgp-fingerprint
>               "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
> --8<---------------cut here---------------end--------------->8---
>
> Basically, I have only one channel which is the official GNU Guix
> "%default-channels".  The important information here are:
>
>  - url: from where it fetch
>  - commit: which checkout uses
>
> Therefore, "guix time-machine -C the/channel./file.scm -- help" will
> fetch from url and restore at the commit.
>
> The other parts are important too. ;-)  But not for your question. :-)
> Well, basically you can even drop them and it will be fine.
>
> So yes, please go read the channel section.  It has recently been
> reordered to be more "understandable".  Feedback is very welcome. :-)
>
>
>> Then later or on another machine, you simply run the command:
>>
>>    guix time-machine -C path/to/channels.scm \
>>           -- <subcommand> -m path/to/manifest.scm <options>
>>
>> If I understand this correctly, a manifest with specific versions can only be guaranteed to work, if I track a channel as well. And somehow in that channel definition, I must specify which commit of Guix I am on? But wouldn't that limit my choice of libraries to what was available in one commit?
> Yes, the same way the choice of libraries is limited at each commit state. :-)
>
> It is possible to mix libraries from different commits but the UI is
> not as easy as it should be.
>
> For example, imagine you are doing:
>
>   guix pull
>   guix install -m foo.scm /tmp/A
>   [...] # time flies
>   guix pull
>   guix install -m bar.scm /tmp/B
>
> And let assume that foo and bar are *not* coming from the same Guix
> commit.  You can still do:
>
>   guix package --search-paths -p /tmp/A -p /tmp/B
>
> and therefore mix the two libraries.
>
> Well, using the time-machine, you need to track the commit which
> provided foo and the one of bar.  Then:
>
>   guix time-machine --commit=commit-A -- install -m foo.scm -p /tmp/AA
>   guix time-machine --commit=commit-B -- install -m bar.scm -p /tmp/BB
>
> Then "guix package --search-paths -p /tmp/AA -p /tmp/BB" should
> provide the exact same thing as before.
>
> That's why it is important to track the Guix commit (guix describe -f
> channels) of software you are installing.  Without this piece of
> information, it is (almost) impossible to reinstall (other point in
> time or space) the exact same version of the very software.
>
> Hope that helps,
> simon

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


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

* Re: How to install previous versions?
  2020-10-12 13:58       ` Zelphir Kaltstahl
@ 2020-10-12 14:29         ` zimoun
  0 siblings, 0 replies; 6+ messages in thread
From: zimoun @ 2020-10-12 14:29 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

Hi,

On Mon, 12 Oct 2020 at 15:58, Zelphir Kaltstahl
<zelphirkaltstahl@posteo.de> wrote:

> ~~~~
> guix search-guix-commit-for-package-with-version python-redis@3.3.8 --last
> --> Revision c7011ff850420fdbe1319b3d218bd362f2f9d618
> guix search-guix-commit-for-package-with-version python-redis@3.3.8 --first
> --> Revision f5111b4d2b982d58387188bc3018e4dd2e9a9d4f
> ~~~~

Not implemented (yet).
Only via the website for now.


> or at least something only involving command line and not requiring me to bisect on GNU Guix commits ^^?

Note that there is JSON.  I have an unpolished attempt to fetch the
JSON files and then find the intersection of commits.  Well, not ready
yet.
BTW, note that using the Data Service, you can only find commit after
Dec. 2019, if I remember correctly.


All the best,
simon


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

end of thread, other threads:[~2020-10-12 14:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 17:00 How to install previous versions? Zelphir Kaltstahl
2020-10-09 16:37 ` zimoun
2020-10-10 15:14   ` Zelphir Kaltstahl
2020-10-10 16:44     ` zimoun
2020-10-12 13:58       ` Zelphir Kaltstahl
2020-10-12 14:29         ` zimoun

unofficial mirror of help-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git