guix-devel
[Top][All Lists]
Advanced

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

Errors with (display) when building derivations from the REPL.


From: Brian Cully
Subject: Errors with (display) when building derivations from the REPL.
Date: Thu, 28 Apr 2022 10:00:01 -0400
User-agent: mu4e 1.6.10; emacs 28.1


I’m trying to do some work on Guix with Emacs and Geiser, and while a lot of things work fairly well, I consistently run into problems when trying to build derivations from the Geiser REPL. From what I can tell by looking at where it’s breaking, it seems to me like the output of the build process is supposed to be captured for display by the client, but (for whatever reason) the output port its supposed to go to is closed. The failing line appears to be these (found in guix/store.scm:758):

--8<---------------cut here---------------start------------->8---
          (let ((s (read-maybe-utf8-string p)))
            (display s (current-build-output-port))
--8<---------------cut here---------------end--------------->8---

I don’t know if this is an actual bug, or if I’m expected to set up the output port myself before attempting to do a build from the REPL. If it is an actual bug, I’ll be happy to submit this to the issue tracker. If it’s not, can someone tell me what I’m supposed to be doing for this to work? Also, is there a reason that the build’s output port doesn’t just default to standard output so no setup would be necessary?

Sample code:

--8<---------------cut here---------------start------------->8---
(define-module (bjc repltest)
 #:use-module (guix derivations)
 #:use-module (guix gexp)
 #:use-module (guix monads)
 #:use-module (guix store))

(define (m)
 (with-store store
   (run-with-store store
     (mlet %store-monad ((drv (lower-object
                               (computed-file "test"
#~(mkdir #$output)))))
       (mbegin %store-monad
         (built-derivations (list drv)))))))
--8<---------------cut here---------------end--------------->8---

Backtrace:

--8<---------------cut here---------------start------------->8---
scheme@(bjc repltest)> (m)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure display: Wrong type argument in position 2: #<closed: string 7f38350291c0>

Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(bjc repltest) [1]> ,bt
In ice-9/boot-9.scm:
1752:10 8 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/store.scm:
  658:37  7 (thunk)
In guix/monads.scm:
560:2 6 (run-with-store #<store-connection 256.99 7f382193fb90> _ #:guile-for-build _ #:system _ #:target _)
In guix/store.scm:
 2001:38  5 (_ #<store-connection 256.99 7f3822eae9b0>)
 1421:15  4 (_ #<store-connection 256.99 7f3822eae9b0> _ _)
  759:14  3 (process-stderr _ _)
In unknown file:
2 (display "substitute: \r" #<closed: string 7f38350291c0>)
In ice-9/boot-9.scm:
 1685:16  1 (raise-exception _ #:continuable? _)
 1685:16  0 (raise-exception _ #:continuable? _)
--8<---------------cut here---------------end--------------->8---


-bjc



reply via email to

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