From: "Sergio Pastor Pérez" <sergio.pastorperez@outlook.es>
To: AS8P251MB0337E3439FE24C98DA02D6BBF3F72@AS8P251MB0337.EURP251.PROD.OUTLOOK.COM
Cc: michal_atlas+gnu@posteo.net, guix-devel@gnu.org
Subject: Re: System deployment commands hoarding all RAM
Date: Mon, 10 Jun 2024 20:02:55 +0200 [thread overview]
Message-ID: <PAXP251MB03488126E676FD2D1E380C49F3C62@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AA4HES.7AELAWT9V99K3@incana.org>
Hi Juliana,
Thanks for your help on the matter!
After reading your explanation about tail recursion I understand the
concept much better.
I still need to find a way to implement the problematic code in a
tail-recursive fashion. But, I'm not convinced that it will solve the
problem. Specially since issuing the `apply-to-record-type` over an
operating system record yields a short computation time:
--8<---------------cut here---------------start------------->8---
scheme@(pastor utils gpu-specification)>
,time (begin ; Avoid printing the output
(apply-to-record-type
(lambda (pkg)
pkg)
(@ (guix packages) <package>)
(@ (base-system) %base-gnome-system))
#f)
$15 = #f
;; 0.007433s real time, 0.007428s run time. 0.000000s spent in GC.
--8<---------------cut here---------------end--------------->8---
I'm not able to use the profiler to display how deep the recursion
grows. In any case, I believe it should grow equally for the following
invocations:
--8<---------------cut here---------------start------------->8---
λ guix system build transformed-sheepbook.scm
/gnu/store/kpk9la4h9xwp6n7vabd5lfs6kbhb2f2d-system
λ guix system vm transformed-sheepbook.scm
Killed
--8<---------------cut here---------------end--------------->8---
Since the second one hoards the RAM, I'm guessing that the commands
operate differently over the resulting operating system record.
I'm not able to dig further since the `guix repl` does not support
tracing, and using a pure Guile REPL errors out whenever I try to use
trace points for this procedure:
--8<---------------cut here---------------start------------->8---
scheme@(pastor utils gpu-specification)> ,tracepoint apply-to-record-type
scheme@(pastor utils gpu-specification)> ((@ (guix scripts system) guix-system) "vm" "/home/pastor/.config/guix/systems/transformed-sheepbook.scm")
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure port-column: Wrong type argument in position 1: #<closed: string 7fa2d32dd000>
--8<---------------cut here---------------end--------------->8---
Interestingly, the traces work when using the `build` command instead of
the `vm` command:
--8<---------------cut here---------------start------------->8---
scheme@(pastor utils gpu-specification)> ((@ (guix scripts system) guix-system) "build" "/home/pastor/.config/guix/systems/transformed-sheepbook.scm")
Trap 0: (apply-to-record-type #<procedure 7fa2aed6e868 at transformed-sheep…> …)
Trap 0: | (apply-to-record-type #<procedure 7fa2aed6e868 at transformed-sh…> …)
...
/gnu/store/6xxzsp3grp53x9w49wh513i8sjyal3zg-system
--8<---------------cut here---------------end--------------->8---
I think I've hit a road block.
Does any fellow Guix hacker knows a way to debug `guix system` commands
or why the `vm` subcommand does not make the same computation over the
record as the `build` subcommand does?
Thanks again for your time.
Regards,
Sergio.
PS: I appreciate the book recommendations!
next prev parent reply other threads:[~2024-06-10 18:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-02 22:10 System deployment commands hoarding all RAM Juliana Sims
2024-06-10 18:02 ` Sergio Pastor Pérez [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-05-26 12:44 Sergio Pastor Pérez
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=PAXP251MB03488126E676FD2D1E380C49F3C62@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM \
--to=sergio.pastorperez@outlook.es \
--cc=AS8P251MB0337E3439FE24C98DA02D6BBF3F72@AS8P251MB0337.EURP251.PROD.OUTLOOK.COM \
--cc=guix-devel@gnu.org \
--cc=michal_atlas+gnu@posteo.net \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).