guix-devel
[Top][All Lists]
Advanced

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

Mysterious error while refactoring guix/scripts/system.scm


From: Chris Marusich
Subject: Mysterious error while refactoring guix/scripts/system.scm
Date: Wed, 03 Aug 2016 23:20:00 -0700

Hi,

In my local Guix git repo, I've made the attached change on top of
commit 7972d8a2e98af6592050a37036c2c80a01358fcf.  I was surprised to
find that when I built it and ran './pre-inst-env guix system
list-generations', the following error occurred:

--8<---------------cut here---------------start------------->8---
Backtrace:
In ice-9/boot-9.scm:
 157: 19 [catch system-error ...]
In guix/scripts/system.scm:
 884: 18 [#<procedure 43cdba0 at guix/scripts/system.scm:876:2 ()>]
 818: 17 [process-command list-generations () ...]
In guix/store.scm:
1182: 16 [run-with-store # ...]
In guix/scripts/system.scm:
 819: 15 [#<procedure 43d9f00 at guix/scripts/system.scm:819:6 (state)> #]
In guix/packages.scm:
1092: 14 [#<procedure 43d3940 at guix/packages.scm:1091:2 (store)> #]
 734: 13 [cache! #<weak-key-hash-table 1f79180 0/113> # # ...]
1038: 12 [thunk]
 970: 11 [bag->derivation # # #]
In srfi/srfi-1.scm:
 578: 10 [map #<procedure 43dc510 at guix/packages.scm:972:30 (t-1004895)> #]
In guix/packages.scm:
 794: 9 [expand-input # # # ...]
In guix/store.scm:
1182: 8 [run-with-store # ...]
In guix/packages.scm:
1140: 7 [#<procedure 43b10c0 at guix/packages.scm:1140:5 (state)> #]
In guix/download.scm:
 326: 6 [#<procedure 43b1120 at guix/download.scm:326:8 (state)> #]
In guix/store.scm:
1105: 5 [#<procedure 43dc390 at guix/store.scm:1104:28 (store)> #]
In guix/packages.scm:
 734: 4 [cache! #<weak-key-hash-table 1f79180 0/113> # # ...]
1038: 3 [thunk]
In gnu/packages/bootstrap.scm:
 191: 2 [raw-build #<build-daemon 256.15 43c72c0> "guile-bootstrap-2.0" ...]
In gnu/packages.scm:
  91: 1 [search-bootstrap-binary "tar" #<procedure system (#:optional _)>]
In unknown file:
   ?: 0 [string-append #<procedure system (#:optional _)> "/" "tar"]

ERROR: In procedure string-append:
ERROR: In procedure string-append: Wrong type (expecting string): #<procedure 
system (#:optional _)>
--8<---------------cut here---------------end--------------->8---

I don't have much experience (yet!) debugging Guile programs, so I
haven't been able to understand the cause of the issue despite my
attempts.  Can anyone help me understand the problem, or provide tips on
how to debug this more effectively?

The motivation for this refactoring is as follows.  I want to eventually
add procedures 'roll-back-system' and 'switch-to-system-generation',
which respectively roll the system back to a previous generation, and
switch to an existing generation.  These new procedures will require
access to the store (e.g., to regenerate grub.cfg).  I must invoke those
procedures somewhere in (guix scripts system), and the obvious place to
do that is inside the 'process-action' procedure.

However, that procedure is written with the assumption that the action
requires an operating system configuration file.  My two new procedures
don't require that.  So, instead, I thought it would be easiest to pull
the store monad setup logic (the 'with-store' stuff) up one level into
the procedure 'process-command' and call my two new procedures inside
the 'process-command' procedure.  It looked to me like there was nothing
specific about the store monad setup logic that required it to exist in
the 'process-action' procedure, so I thought this refactoring would be
simple and clean.  I was apparently wrong, but I can't see why.

This is the last thing blocking me from submitting patches to the email
list which add system roll-back and switch-generation commands to
GuixSD.  I have a series of commits on a branch in my Guix git repo
which implement system-rollback and switch-generation.  If you'd like to
see them for more context, please let me know and I'll provide them,
too.  Thank you!

-- 
Chris

Attachment: 0001-Refactor-process-action-and-process-command.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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