ui: Fix port-buffering with guile@2.0.
* guix/status.scm (build-event-output-port)[guile@2.0]: Do not call 'setvbuf' on custom binary port. * tests/status.scm (current-build-output-port, UTF-8 + garbage)[guile@2.0]: Use "?" in place of REPLACEMENT CHARACTER.
This commit is contained in:
parent
6f1ce09d79
commit
278f86a43f
|
@ -588,8 +588,9 @@ The second return value is a thunk to retrieve the current state."
|
|||
|
||||
;; The build port actually receives Unicode strings.
|
||||
(set-port-encoding! port "UTF-8")
|
||||
(setvbuf port (cond-expand (guile-2.2 'line) (else _IOLBF)))
|
||||
|
||||
(cond-expand
|
||||
((and guile-2 (not guile-2.2)) #t)
|
||||
(else (setvbuf port 'line)))
|
||||
(values port (lambda () %state)))
|
||||
|
||||
(define (call-with-status-report on-event thunk)
|
||||
|
|
|
@ -125,7 +125,10 @@
|
|||
|
||||
(test-equal "current-build-output-port, UTF-8 + garbage"
|
||||
;; What about a mixture of UTF-8 + garbage?
|
||||
'((build-log #f "garbage: <20>lambda: λ\n"))
|
||||
(let ((replacement (cond-expand
|
||||
((and guile-2 (not guile-2.2)) "?")
|
||||
(else "<22>"))))
|
||||
`((build-log #f ,(string-append "garbage: " replacement "lambda: λ\n"))))
|
||||
(let-values (((port get-status) (build-event-output-port cons '())))
|
||||
(display "garbage: " port)
|
||||
(put-bytevector port #vu8(128))
|
||||
|
|
Loading…
Reference in New Issue