unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Phil <phil@beadling.co.uk>
To: zimoun <zimon.toutoune@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Channel details of profile generation
Date: Sat, 09 Jan 2021 13:34:12 +0000	[thread overview]
Message-ID: <85h7nqqlnv.fsf@beadling.co.uk> (raw)
In-Reply-To: <CAJ3okZ36AOc5_xZn4=gMZfMDDhooEgvyYr59kKO6txcpcX52yQ@mail.gmail.com>

Hi,

Thanks again for your help. Below I've split the question into PART 1 -
which what I originally asked, and PART 2 - which is trying to resolve
the backtrace seen using 'guix pull' that so far only I've reproduced.

PART 2 is a bit of a rabbit-hole and I don't come back with any
definitive answers - I recognize that my use of 'guix pull' was probably
inappropriate, so my only interest here now is I don't think that any
command should give a backtrace or hang indefinitely - even if I'm
asking it a stupid question.

So I'd like to understand why, and if needs be fix the code.  I
demonstrate below this is possible (at least on my use of on foreign distro
Ubuntu 18.04).  Apologies if my response it somewhat over-detailed!

The short answer to PART 2, I think, is probably don't use 'guix pull -p
profile -l' apart from on special guix profiles, but that doesn't
explain the backtrace.

zimoun writes:

PART 1:

> As I explained in the previous email, even if both are profiles, they
> are not the same.  Basically, "guix pull" is for
> "~/.config/guix/current" which is somehow special.  Therefore, I do
> not know what you want to achieve with "guix pull -p
> ~/guix-profiles/test-profile -l".  Maybe, what you want is instead:
> ""guix package -p ~/guix-profiles/test-profile -l".  Otherwise, could
> you explain which result you are expecting whatever the command to
> use?
>

Yep - I've muddled this a bit, so I'm going to try an explain from the
beginning what I'm trying to achieve.

Given a date/time and a profile, it should be possible not only to tell
me what generation of that profile was active at that date/time, but
also the corresponding commit ids on the heads of each channels used to
source the packages.

So my tool works like this - and, I believe, the output is correct and
methodology sane:


--8<---------------cut here---------------start------------->8---

ubuntu@test-image:~$ guix repl -- profile-generation-on-datetime.scm 2020-12-24T12:00:00 guix-profiles/py-test-pkg-profile

Profile Dir: guix-profiles/py-test-pkg-profile-39-link

\Generation 39  Dec 24 2020 11:24:23\

Package/Channel Details:
  py-test-pkg 1.53
     URL: https://git.savannah.gnu.org/git/guix.git
     Branch: master
     Commit: 13d532a91178be7b6919b85685b150f941116dfc

     URL: ssh://git@bbserver:7799/ea/guix-packages.git
     Branch: master
     Commit: ad21880272356219a9e33888cd0c237c8ece02d3

  python 3.8.2
     URL: https://git.savannah.gnu.org/git/guix.git
     Branch: master
     Commit: 13d532a91178be7b6919b85685b150f941116dfc

--8<---------------cut here---------------end--------------->8---

Now, ignoring the date/time logic, all my tool is doing is returning the
Package/Channel Details (via the profile manifest) as per above - when
provided with a profile and a generation number.

--8<---------------cut here---------------start------------->8---

(define my-manifest
  (manifest-entries
   (profile-manifest (generation-file-name my-profile generation-number))))

--8<---------------cut here---------------end--------------->8---

The command you suggested can also recover the details of 'Generation
39' like the below:


--8<---------------cut here---------------start------------->8---

ubuntu@test-image:~$ guix package -p ~/guix-profiles/py-test-pkg-profile -l | grep -A4 'Generation 39' 
Generation 39   Dec 24 2020 11:24:23
 + py-test-pkg 1.53    out     /gnu/store/1s9v8psy6pi404pfv51b14i1w11agy2i-py-test-pkg-1.53
 - py-test-pkg 1.52-3.45acac9  out     /gnu/store/ncwm84b3ax5n6y374043di54q47ar6w9-py-test-pkg-1.52-3.45acac9

Generation 40   Dec 24 2020 13:55:09

--8<---------------cut here---------------end--------------->8---

However this only provides the package diff rather than the absolute package
list, and more importantly (to me) it doesn't report the channel commit ids
used to create the generation as available from manifest-entries.


***This is the crux of my original question - can I get the commit id data
supplied by my script for a given profile/generation, from the command
line using already available guix tools?***

(I think the answer to this is - no you cannot do it from the command line)

The follow-up question was - if not, is my script's approach sane?

(I think/hope this answer to this - is yes, my approach is reasonable/sane)

Hopefully that bit is clearer now :-)


PART 2:

Separately I, probably incorrectly, thought that I might be able to use some
incantation of 'guix pull -l' to achieve the same ends as my script,
given pull's output does seem to include the channel commit ids.

The surprise was that not so much that 'guix pull -l' didn't do what I
was hoping (it was a shot in the dark), but that it crashed, rather than
exiting gracefully.  Now originally this was put down to
junk-in/junk-out - i.e. me providing a standard package profile to a
command expecting the 'special' guix profile. However as you've shown
below - this is not the case - in your attempt to recreate my error 'guix pull'
behaved well despite my dubious command use! 

>
> Even if I am not sure to understand what you want to do, I am not able
> to reproduce.  With /tmp/my-manifest-{1,2}.scm containing:
>
> $ guix package -p /tmp/foo -m /tmp/my-manifest-2.scm
> The following packages will be installed:
>    python              3.8.2
>    python-nose-exclude 0.5.0
>
> $ guix pull -p /tmp/foo -l
> Generation 1    Jan 05 2021 17:47:34
>   python 3.8.2
> Generation 2    Jan 05 2021 17:58:22    (current)
>   python-nose-exclude 0.5.0
>   python 3.8.2

I can't argue with this - I need to do some more digging here to see why
my use of guix pull is barfing, there are some differences between your
test and mine - for example the use of the ssh protocol in the second
channel, so the 2 tests are not identical, but as you see below I run
into issues replicating even with the guix-science channel.

I have tried a more detailed test below - my channels.scm now contains
guix, guix-science, and my private channel.

I do a guix pull to get the following:

--8<---------------cut here---------------start------------->8---
Building from these channels:
  guix-science https://github.com/guix-science/guix-science.git  cf87b05
  guix-packages ssh://git@bbserver:7799/ea/guix-packages.git    55312da
  guix      https://git.savannah.gnu.org/git/guix.git   13d532a
--8<---------------cut here---------------end--------------->8---

I will now create a new profile and use 'guix package' to install 3
manifests to it, after each install I'll list the contents with 'guix
package' and 'guix pull':

--8<---------------cut here---------------start------------->8---
$ cat my-manifest-?.scm
(specifications->manifest (list "python"))
(specifications->manifest (list "python" "python-nose-exclude"))
(specifications->manifest (list "python" "python-nose-exclude" "py-test-pkg"))
--8<---------------cut here---------------end--------------->8---

First manifest installs python without issue:

--8<---------------cut here---------------start------------->8---
$ guix package -m my-manifest-1.scm -p /tmp/test-profile
The following package will be installed:
   python 3.8.2

$ guix package -p /tmp/test-profile -l
\Generation 1   Jan 09 2021 11:39:07\   (current)
  python        3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

$ guix pull -p /tmp/test-profile -l
\Generation 1   Jan 09 2021 11:39:07\   (current)
  python 3.8.2
--8<---------------cut here---------------end--------------->8---

Second manifest - installs without issue BUT 'guix pull' now hangs after
producing the right output requiring me to ctrl-c out of it:

--8<---------------cut here---------------start------------->8---
$ guix package -m my-manifest-2.scm -p /tmp/test-profile
The following packages will be installed:
   python              3.8.2
   python-nose-exclude 0.5.0

$ guix package -p /tmp/test-profile -l                  
\Generation 1   Jan 09 2021 11:39:07\
  python        3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

\Generation 2   Jan 09 2021 11:43:58\   (current)
 + python-nose-exclude  0.5.0   out     /gnu/store/k3n4qxakw4rjjg81sfkaxcgln5xhaj3r-python-nose-exclude-0.5.0

$ guix pull -p /tmp/test-profile -l                     
\Generation 1   Jan 09 2021 11:39:07\
  python 3.8.2
\Generation 2   Jan 09 2021 11:43:58\   (current)
  python-nose-exclude 0.5.0
  python 3.8.2
^C <-- It's hanging here so I exit with ctrl-c
--8<---------------cut here---------------end--------------->8---

Third manifest - installs fine but 'guix pull' produces same result as
second manifest:

--8<---------------cut here---------------start------------->8---
$ guix package -m my-manifest-3.scm -p /tmp/test-profile
The following packages will be installed:
   py-test-pkg        1.65-1.e4c466a
   python              3.8.2
   python-nose-exclude 0.5.0

$ guix package -p /tmp/test-profile -l                  
\Generation 1   Jan 09 2021 11:39:07\
  python        3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

\Generation 2   Jan 09 2021 11:43:58\
 + python-nose-exclude  0.5.0   out     /gnu/store/k3n4qxakw4rjjg81sfkaxcgln5xhaj3r-python-nose-exclude-0.5.0

\Generation 3   Jan 09 2021 12:00:11\   (current)
 + py-test-pkg 1.65-1.e4c466a  out     /gnu/store/vz138cjpkv2m0d1xpq16g6f7ch2c8s86-py-test-pkg-1.65-1.e4c466a

$ guix pull -p /tmp/test-profile -l                     
\Generation 1   Jan 09 2021 11:39:07\
  python 3.8.2
\Generation 2   Jan 09 2021 11:43:58\
  python-nose-exclude 0.5.0
  python 3.8.2
^C
--8<---------------cut here---------------end--------------->8---

Finally just to recreate the original error I create a fourth manifest
in a new profile - but everything works fine now!

--8<---------------cut here---------------start------------->8---
$ cat my-manifest-4.scm 
(specifications->manifest (list "python" "py-test-pkg"))

$ guix package -m my-manifest-4.scm -p /tmp/test-profile2
The following packages will be installed:
   py-test-pkg 1.65-1.e4c466a
   python       3.8.2

$ guix package -p /tmp/test-profile2 -l
\Generation 1   Jan 09 2021 12:06:49\   (current)
  py-test-pkg  1.65-1.e4c466a  out     /gnu/store/vz138cjpkv2m0d1xpq16g6f7ch2c8s86-py-test-pkg-1.65-1.e4c466a
  python        3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

$ guix pull -p /tmp/test-profile2 -l                     
\Generation 1   Jan 09 2021 12:06:49\   (current)
  py-test-pkg 1.65-1.e4c466a
  python 3.8.2
--8<---------------cut here---------------end--------------->8---


So I try creating a second generation and this doesn't barf, it halts
just like the guix-science example and requires a ctrl-c.  This somewhat
suggests that the 'ssh' repo isn't the sole cause of the issue - the
issue is something to do with outputting a second generation - this is
the common thread in every test I've done.

--8<---------------cut here---------------start------------->8---
$ guix remove python -p /tmp/test-profile2
The following package will be removed:
   python 3.8.2

$ guix package -p /tmp/test-profile2 -l   
\Generation 1   Jan 09 2021 12:06:49\
  py-test-pkg  1.65-1.e4c466a  out     /gnu/store/vz138cjpkv2m0d1xpq16g6f7ch2c8s86-py-test-pkg-1.65-1.e4c466a
  python        3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

\Generation 2   Jan 09 2021 12:11:16\   (current)
 - python       3.8.2   out     /gnu/store/9h5pjxj879y9rzy04m1v9835l4fblw95-python-3.8.2

$ guix pull -p /tmp/test-profile2 -l      
\Generation 1   Jan 09 2021 12:06:49\
  py-test-pkg 1.65-1.e4c466a
  python 3.8.2
\Generation 2   Jan 09 2021 12:11:16\   (current)
  py-test-pkg 1.65-1.e4c466a
^C
--8<---------------cut here---------------end--------------->8---


Finally I tried pulling the latest version of guix to check the issue
was still current - same result was seen.

--8<---------------cut here---------------start------------->8---
$ guix pull --commit=0fab032ae3849a8827b4ccf40d7a8f70090b4255 
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Authenticating channel 'guix', commits 9edb3f6 to 0fab032 (1,047 new commits)...
--8<---------------cut here---------------end--------------->8---


Here's the final bit of the strace from the last output to stdout to the
'guix pull' hanging:

--8<---------------cut here---------------start------------->8---
write(1, "  py-test-pkg 1.65-1.e4c466a\n", 30  py-test-pkg 1.65-1.e4c466a
) = 30
stat("/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/share/guile/site/3.0/guix/inferior.scm", {st_mode=S_IFREG|0444, st_size=30370, ...}) = 0
stat("/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/lib/guile/3.0/site-ccache/guix/inferior.go", {st_mode=S_IFREG|0444, st_size=333037, ...}) = 0
openat(AT_FDCWD, "/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/lib/guile/3.0/site-ccache/guix/inferior.go", O_RDONLY|O_CLOEXEC) = 14
lseek(14, 0, SEEK_END)                  = 333037
mmap(NULL, 333037, PROT_READ, MAP_PRIVATE, 14, 0) = 0x7f3e8e605000
close(14)                               = 0
mprotect(0x7f3e8e635000, 89200, PROT_READ|PROT_WRITE) = 0
pipe([14, 15])                          = 0
fstat(14, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(15, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
pipe([16, 17])                          = 0
fstat(16, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(17, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3e9faae3d0) = 15339
close(15)                               = 0
close(16)                               = 0
read(14, "", 16384)                     = 0
close(14)                               = 0
close(17)                               = 0
wait4(15339, [{WIFEXITED(s) && WEXITSTATUS(s) == 127}], 0, NULL) = 15339
stat("/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/share/guile/site/3.0/guix/repl.scm", {st_mode=S_IFREG|0444, st_size=4925, ...}) = 0
pipe([14, 15])                          = 0
fstat(14, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(15, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
pipe([16, 17])                          = 0
fstat(16, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(17, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3e9faae3d0) = 15340
close(15)                               = 0
close(16)                               = 0
read(14, "(repl-version 0 1 1)\n", 16384) = 21
write(17, "(() repl-version 0 1 1)\n", 24) = 24
write(17, "(use-modules (guix))\n", 21) = 21
read(14, 
--8<---------------cut here---------------end--------------->8---


When killing the halted process:

ab+ 16058 16046  0 12:35 pts/3    00:00:00 guile -L /tmp/test-profile2-1-link/share/guile/site/3.0 -C /tmp/test-profile2-1-link/share/guile/site/3.0 -C /tmp/test-profile2-1-link/lib/guile/3.0/site-ccache -c (begin (primitive-load "/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/share/guile/site/3.0/guix/repl.scm") ((@ (guix repl) machine-repl)))
kill 16058

I get:

--8<---------------cut here---------------start------------->8---
read(14, "", 16384)                     = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16057, si_uid=1002, si_status=127, si_utime=0, si_stime=0} ---
close(14)                               = 0
close(17)                               = 0
wait4(16057, [{WIFEXITED(s) && WEXITSTATUS(s) == 127}], 0, NULL) = 16057
stat("/gnu/store/ar2hw6xc1ipskrqf9nc3nz2mc780phgd-guix-module-union/share/guile/site/3.0/guix/repl.scm", {st_mode=S_IFREG|0444, st_size=4925, ...}) = 0
pipe([14, 15])                          = 0
fstat(14, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(15, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
pipe([16, 17])                          = 0
fstat(16, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
fstat(17, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb63c0093d0) = 16058
close(15)                               = 0
close(16)                               = 0
read(14, "(repl-version 0 1 1)\n", 16384) = 21
write(17, "(() repl-version 0 1 1)\n", 24) = 24
write(17, "(use-modules (guix))\n", 21) = 21
read(14, "", 16384)                     = 0
write(2, "Backtrace:\n", 11Backtrace:
)            = 11
futex(0x7fb63c773648, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2, "          11 (primitive-load \"/h"..., 74          11 (primitive-load "/home/ubuntu/.config/guix/curre…")
) = 74
write(2, "In guix/ui.scm:\n", 16In guix/ui.scm:
)       = 16
mmap(0x7fb62ad12000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb62ace0000
write(2, "  2154:12 10 (run-guix-command _"..., 38  2154:12 10 (run-guix-command _ . _)
) = 38
write(2, "In ice-9/boot-9.scm:\n", 21In ice-9/boot-9.scm
--8<---------------cut here---------------end--------------->8---

I'm running out of steam a bit here but both this error in ui.scm@2154
and the original backtrace I posted ui.scm@2127 come from the
run-guix-command function on attempting a primitive-load of, I assume,
the current guix script.




  reply	other threads:[~2021-01-09 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 17:52 Channel details of profile generation Phil
2020-12-30 13:41 ` zimoun
2021-01-04 17:29   ` Phil
2021-01-05 17:01     ` zimoun
2021-01-09 13:34       ` Phil [this message]
2021-01-11 17:34         ` zimoun
2021-01-12 19:16           ` Phil
2021-01-13 14:28             ` Phil
2021-01-13 20:15             ` zimoun

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=85h7nqqlnv.fsf@beadling.co.uk \
    --to=phil@beadling.co.uk \
    --cc=help-guix@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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).