jacquesg / p5-msgpack-raw Goto Github PK
View Code? Open in Web Editor NEWPerl bindings to the msgpack C library
Perl bindings to the msgpack C library
Error log from cpanm
cpanm (App::cpanminus) 1.7046 on perl 5.030003 built for darwin-thread-multi-2level
Work directory is /Users/benhengst/.cpanm/work/1706753197.89345
You have make /usr/bin/make
You have LWP 6.68
You have /usr/bin/tar: bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
Searching Neovim::Ext () on cpanmetadb ...
--> Working on Neovim::Ext
Fetching http://www.cpan.org/authors/id/J/JA/JACQUESG/Neovim-Ext-0.06.tar.gz
-> OK
Unpacking Neovim-Ext-0.06.tar.gz
Entering Neovim-Ext-0.06
Checking configure dependencies from META.json
Checking if you have MsgPack::Raw 0.01 ... No
Checking if you have ExtUtils::MakeMaker 6.63_03 ... Yes (7.68)
Checking if you have Class::Accessor 0.34 ... Yes (0.51)
Checking if you have Eval::Safe 0.02 ... Yes (0.02)
Checking if you have IO::Async 0.74 ... Yes (0.802)
==> Found dependencies: MsgPack::Raw
Searching MsgPack::Raw (0.01) on cpanmetadb ...
--> Working on MsgPack::Raw
Fetching http://www.cpan.org/authors/id/J/JA/JACQUESG/MsgPack-Raw-0.05.tar.gz
-> OK
Unpacking MsgPack-Raw-0.05.tar.gz
Entering MsgPack-Raw-0.05
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.63_03 ... Yes (7.68)
Configuring MsgPack-Raw-0.05
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for MsgPack::Raw
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.68)
Checking if you have IPC::Open3 0 ... Yes (1.20)
Checking if you have IO::Handle 0 ... Yes (1.40)
Checking if you have overload 0 ... Yes (1.30)
Checking if you have warnings 0 ... Yes (1.44)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have XSLoader 0 ... Yes (0.30)
Checking if you have File::Spec 0 ... Yes (3.78)
Checking if you have Test::More 0 ... Yes (1.302194)
Checking if you have Encode 0 ... Yes (3.01)
Checking if you have Test::Pod 0.0 ... Yes (1.52)
Checking if you have Test::Pod::Coverage 0.0 ... Yes (1.10)
Building and testing MsgPack-Raw-0.05
cp lib/MsgPack/Raw/Ext.pm blib/lib/MsgPack/Raw/Ext.pm
cp lib/MsgPack/Raw.pm blib/lib/MsgPack/Raw.pm
cp lib/MsgPack/Raw/Unpacker.pm blib/lib/MsgPack/Raw/Unpacker.pm
cp lib/MsgPack/Raw/Bool.pm blib/lib/MsgPack/Raw/Bool.pm
cp lib/MsgPack/Raw/Packer.pm blib/lib/MsgPack/Raw/Packer.pm
Running Mkbootstrap for Raw ()
chmod 644 "Raw.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Raw.bs blib/arch/auto/MsgPack/Raw/Raw.bs 644
"/usr/bin/perl" "/System/Library/Perl/5.30/ExtUtils/xsubpp" -typemap '/System/Library/Perl/5.30/ExtUtils/typemap' -typemap '/Users/benhengst/.cpanm/work/1706753197.89345/MsgPack-Raw-0.05/typemap' Raw.xs > Raw.xsc
Please specify prototyping behavior for Raw.xs (see perlxs manual)
mv Raw.xsc Raw.c
cc -c -I. -Ideps -Ideps/msgpack-c/include -g -pipe -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -Os -DVERSION=\"0.05\" -DXS_VERSION=\"0.05\" "-I/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE" Raw.c -o Raw.o
Raw.xs:1:10: fatal error: 'EXTERN.h' file not found
#include "EXTERN.h"
^~~~~~~~~~
1 error generated.
make: *** [Raw.o] Error 1
-> FAIL Installing MsgPack::Raw failed. See /Users/benhengst/.cpanm/work/1706753197.89345/build.log for details. Retry with --force to force install it.
-> FAIL Installing the dependencies failed: Module 'MsgPack::Raw' is not installed
-> FAIL Bailing out the installation for Neovim-Ext-0.06.
Machine details:
Software:
System Software Overview:
System Version: macOS 14.3 (23D56)
Kernel Version: Darwin 23.3.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 2 days, 12 hours, 34 minutes
Hardware:
Hardware Overview:
Model Name: MacBook Air
Model Identifier: MacBookAir10,1
Model Number: Z125000DLLL/A
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
System Firmware Version: 10151.81.1
OS Loader Version: 10151.81.1
perl details
Platform:
osname=darwin
osvers=21.2.0
archname=darwin-2level
uname='darwin bens-macbook-air.local 21.2.0 darwin kernel version 21.2.0: sun nov 28 20:29:10 pst 2021; root:xnu-8019.61.5~1release_arm64_t8101 arm64 '
config_args='-Dprefix=/Users/benhengst/.plenv/versions/5.26.3 -de -Dversiononly -A'eval:scriptdir=/Users/benhengst/.plenv/versions/5.26.3/bin''
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=12.1 -fno-strict-aliasing -pipe -fstack-protector-strong -DPERL_USE_SAFE_PUTENV'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=12.1 -fno-strict-aliasing -pipe -fstack-protector-strong'
ccversion=''
gccversion='Apple LLVM 13.0.0 (clang-1300.0.29.30)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=8
longdblkind=0
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -mmacosx-version-min=12.1 -fstack-protector-strong -L/usr/local/lib'
libpth=/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/lib /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib /Library/Developer/CommandLineTools/usr/lib /usr/local/lib /usr/lib
libs=
perllibs=
libc=
so=dylib
useshrplib=false
libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -mmacosx-version-min=12.1 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Locally applied patches:
Devel::PatchPerl 2.08
Built under darwin
Compiled at Feb 7 2022 08:59:57
%ENV:
PERL5LIB="/Users/benhengst/perl5/lib/perl5:/Users/benhengst/ndn/perl:/Users/benhengst/perl5/lib/perl5/darwin-thread-multi-2level/"
PERL_LOCAL_LIB_ROOT="/Users/benhengst/perl5"
PERL_MB_OPT="--install_base "/Users/benhengst/perl5""
PERL_MM_OPT="INSTALL_BASE=/Users/benhengst/perl5"
@INC:
/Users/benhengst/perl5/lib/perl5/5.26.3/darwin-2level
/Users/benhengst/perl5/lib/perl5/5.26.3
/Users/benhengst/perl5/lib/perl5/darwin-2level
/Users/benhengst/perl5/lib/perl5
/Users/benhengst/ndn/perl
/Users/benhengst/perl5/lib/perl5/darwin-thread-multi-2level/
/Users/benhengst/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3/darwin-2level
/Users/benhengst/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3
/Users/benhengst/.plenv/versions/5.26.3/lib/perl5/5.26.3/darwin-2level
/Users/benhengst/.plenv/versions/5.26.3/lib/perl5/5.26.3
On some of my smokers the test suite fails:
# Failed test at t/03-unpacker_scalar.t line 20.
# got: '3.14000000000000012'
# expected: '3.14'
# Looks like you failed 1 test of 7.
t/03-unpacker_scalar.t ......
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
This seems to happen if perl is compiled with increased floating point accuracy (i.e. with -Duselongdouble).
Certain datastructures won't deserialize correctly using the standard MsgPack JavaScript library (msgpack.org)
This datastructure deserializes just fine:
perl -MMsgPack::Raw -E 'say MsgPack::Raw::Packer->new->pack( { a => 1, b => 2 } )'
While this one will not:
perl -MMsgPack::Raw -E 'say MsgPack::Raw::Packer->new->pack( {"foo" => "bar"} )'
And this one will not:
perl -MMsgPack::Raw -E 'say MsgPack::Raw::Packer->new->pack( { "foo" => "bar", baz => [ 2.4, 7, "wibble", { "color" => "red", "theskyis" => "blue " } ] } )'
The issue appears to happen when any value in a dictionary is something other than an integer. No exceptions thrown, but the deserialization yields an object with key values that don't completely deserialize. To the best of my knowledge, this doesn't happen when encoding similar datastructures using standard MsgPack libraries in other languages. Here is the result of deserialization:
{
"baz": [
2.4,
7,
{
"type": "Buffer",
"data": [
119,
105,
98,
98,
108,
101
]
},
{
"theskyis": {
"type": "Buffer",
"data": [
98,
108,
117,
101,
32
]
},
"color": {
"type": "Buffer",
"data": [
114,
101,
100
]
}
}
],
"foo": {
"type": "Buffer",
"data": [
98,
97,
114
]
}
}
Here is the HTML code where the deserialization is peformed:
html>
<head>
<title>MessagePack Testing</title>
<script
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script>
$( init_all )
function init_all ()
{
const req = new XMLHttpRequest();
req.open("GET", "/msg.bin", true);
req.responseType = "arraybuffer";
req.onload = (event) => {
const data = new Uint8Array(req.response);
console.log( msgpack.decode(data) );
};
req.send(null);
}
</script>
</head>
<body>
<h1>Hello MessagePack World</h1>
</body>
</html>
I'm not entirely certain whether or not the problem lies in the packing or in the unpacking, but I would appreciate any thoughts and feedback anyone can offer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.