GNU bug report logs -
#31118
27.0.50; Can't load/compile websocket in 32bit master
Previous Next
Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Date: Tue, 10 Apr 2018 03:04:01 UTC
Severity: normal
Found in version 27.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#31118: 27.0.50; Can't load/compile websocket in 32bit master
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 31118 <at> debbugs.gnu.org.
--
31118: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31118
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
I fixed that by installing the attached into ELPA.
I can't build ELPA from scratch on master now, for other reasons. The build
fails as follows:
In toplevel form:
packages/counsel-ebdb/counsel-ebdb.el:29:1:Error: Cannot open load file: No such
file or directory, ebdb
make: *** [GNUmakefile:171: packages/counsel-ebdb/counsel-ebdb.elc] Error 1
Is anybody building ELPA regularly? It looks like not.
[0001-Port-websocket-to-bleeding-edge-32-bit-Emacs.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
Package: Emacs
Version: 27.0.50
The websocket package available from GNU ELPA can't be used in a 32bit
build of master any more because of the #xffffffff constant in its code:
(defun websocket-to-bytes (val nbytes)
"Encode the integer VAL in NBYTES of data.
NBYTES much be a power of 2, up to 8.
This supports encoding values up to 536870911 bytes (2^29 - 1),
approximately 537M long."
(when (and (< nbytes 8)
(> val (expt 2 (* 8 nbytes))))
;; not a user-facing error, this must be caused from an error in
;; this library
(error "websocket-to-bytes: Value %d could not be expressed in %d bytes"
val nbytes))
(if (= nbytes 8)
(progn
(let ((hi-32bits (lsh val -32))
;; Test for systems that don't have > 32 bits, and
;; for those systems just return the value.
(low-32bits (if (= 0 (expt 2 32))
val
(logand #xffffffff val))))
(when (or (> hi-32bits 0) (> (lsh low-32bits -29) 0))
(signal 'websocket-frame-too-large val))
(bindat-pack `((:val vec 2 u32))
`((:val . [,hi-32bits ,low-32bits])))))
(bindat-pack
`((:val ,(cond ((= nbytes 1) 'u8)
((= nbytes 2) 'u16)
((= nbytes 4) 'u32)
;; Library error, not system error
(t (error "websocket-to-bytes: Unknown NBYTES: %S" nbytes)))))
`((:val . ,val)))))
The code used to compile&run correctly before both on 32bit and 64bit
systems (but admittedly, it failed to run correctly on 64bit systems
after having been compiled on a 32bit system).
Stefan
This bug report was last modified 7 years and 29 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.