[PATCH 3/3] ui: Fix port-buffering with guile@2.0.

  • Done
  • quality assurance status badge
Details
2 participants
  • ericbavier
  • Ludovic Courtès
Owner
unassigned
Submitted by
ericbavier
Severity
normal

Debbugs page

ericbavier wrote 6 years ago
(address . guix-patches@gnu.org)(name . Eric Bavier)(address . bavier@cray.com)
20181011015246.24964-4-ericbavier@centurylink.net
From: Eric Bavier <bavier@cray.com>

* 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.
---
guix/status.scm | 5 +++--
tests/status.scm | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)

Toggle diff (34 lines)
diff --git a/guix/status.scm b/guix/status.scm
index 13537c70c..6dba7e049 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -502,8 +502,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)
diff --git a/tests/status.scm b/tests/status.scm
index 486ad04dd..846a6f415 100644
--- a/tests/status.scm
+++ b/tests/status.scm
@@ -124,7 +124,10 @@
(test-equal "current-build-output-port, UTF-8 + garbage"
;; What about a mixture of UTF-8 + garbage?
- '((build-log "garbage: �lambda: λ\n"))
+ (let ((replacement (cond-expand
+ ((and guile-2 (not guile-2.2)) "?")
+ (else "�"))))
+ `((build-log ,(string-append "garbage: " replacement "lambda: λ\n"))))
(let-values (((port get-status) (build-event-output-port cons '())))
(display "garbage: " port)
(put-bytevector port #vu8(128))
--
2.19.0
Ludovic Courtès wrote 6 years ago
(address . ericbavier@centurylink.net)
875zy4dx1b.fsf@gnu.org
ericbavier@centurylink.net skribis:

Toggle quote (7 lines)
> From: Eric Bavier <bavier@cray.com>
>
> * 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.

LGTM, thanks!

Ludo'.
Eric Bavier wrote 6 years ago
(address . 33012-done@debbugs.gnu.org)
20181016173123.1d333201@centurylink.net
On Sun, 14 Oct 2018 23:43:28 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (13 lines)
> ericbavier@centurylink.net skribis:
>
> > From: Eric Bavier <bavier@cray.com>
> >
> > * 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.
>
> LGTM, thanks!
>
> Ludo'.

Pushed in 278f86a43f1561b1c064ce88da012db414ec7efc
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlvGZrsACgkQ/XPKxxnT
JWZmhBAAluIdWRXG2oK9Q66NKGH0AHR7c0oVvhJB+MBarJJ0N84KcgpK5Lb/5Zkg
oYl6ChIiY3UizFQuHN++3n5tzgdIMdKfYuIShxjKnvQFcGzeUXRzSpAsBYUcn+d0
ISroHvZcPXOt28Vxsd2eOKWkDpjI4DXfWduR+dOPGPjJapshKJeNxEqmYjlSLGDk
x/bG5wK2T2bY/Yn2nzDXSpB99Z/hMbaJ0qagbv2yrCRM6EbCtMNHevhnjJCFmmc7
w3n+SguQFEo7CaUNIUOatvC/kTvRuTRrTwPaFquTWUElBgwtlmH8w12BTmSl/Hqf
nWlQp9PypeaCKSL4+YAhbqpflCQndUHasD91TYOcy6q+jsomaYKIw24UPwpseE4J
+FZ2ElLUdKAt1P+bTDMtmP0As9S3Z1jSJRedeRexTvs2aAa7PEKzxVvAKDDLdYCw
BmZd8G3CGQ+ksm/SHXbxidr6x+RbdXHA1l5yrEFmc1p/mRlGAAAcKBDmflzKqVoy
3gcHchGadDnTwq9O5/MHtrSqSxMdF27RW8Qmr9dqTE/IiPtuTTAKjpXB3w92NmsP
8Re8fN/puW4nqSaIKEdXBwtZCm0GMc+Jy6PtKPRI1GFkdZ7sK4PnIMZBqHkJqreI
kqpIqHXWw6WczkL3QojzXvAU/mpKqlbS6AUaZY7IIfjJw2qVLRA=
=eE2w
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 33012@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 33012
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help