From: Lukas Gradl <lgradl@openmailbox.org>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] Add msgpack
Date: Sat, 11 Jun 2016 23:24:23 -0500 [thread overview]
Message-ID: <87eg836nm3.fsf@openmailbox.org> (raw)
In-Reply-To: <20160612001750.GA9854@jasmine> (Leo Famulari's message of "Sat, 11 Jun 2016 20:17:50 -0400")
Leo Famulari <leo@famulari.name> writes:
> On Sat, Jun 11, 2016 at 06:56:38PM -0500, Lukas Gradl wrote:
>> It seems that zlib is only required for tests. In README and README.md
>> zlib is never mentioned among the dependencies, which also supports
>> that it is only needed for tests. I was not aware of that before (Shame
>> on me).
>
> Is zlib really only required for tests? I see this:
>
> $ grep -rIi zlib /gnu/store/xn8z7k6j7zm4qz14bm29fgk0kwwvz3c4-msgpack-1.4.1
> /gnu/store/xn8z7k6j7zm4qz14bm29fgk0kwwvz3c4-msgpack-1.4.1/include/msgpack/zbuffer.h:#include <zlib.h>
> /gnu/store/xn8z7k6j7zm4qz14bm29fgk0kwwvz3c4-msgpack-1.4.1/include/msgpack/zbuffer.hpp:#include <zlib.h>
>
> So, there are headers in the msgpack output that require zlib.
Oh, that is true. I searched around, but I could not find anything
about zbuffer.h[pp]. I am not sure what it is used for. FWIW, it is
only referenced in src/Makefile, src/Makefile.in, src/Makefile.am
CMakeLists.txt and in the tests:
$ grep -ri zbuffer
src/Makefile: ../include/msgpack/zbuffer.hpp \
src/Makefile: ../include/msgpack/vrefbuffer.h ../include/msgpack/zbuffer.h \
src/Makefile: ../include/msgpack/zbuffer.hpp ../include/msgpack/zone.hpp \
src/Makefile: ../include/msgpack/vrefbuffer.h ../include/msgpack/zbuffer.h \
src/Makefile.in:@ENABLE_CXX_TRUE@ ../include/msgpack/zbuffer.hpp \
src/Makefile.in: ../include/msgpack/vrefbuffer.h ../include/msgpack/zbuffer.h \
src/Makefile.in: ../include/msgpack/zbuffer.hpp ../include/msgpack/zone.hpp \
src/Makefile.in: ../include/msgpack/vrefbuffer.h ../include/msgpack/zbuffer.h \
src/Makefile.am: ../include/msgpack/zbuffer.h \
src/Makefile.am: ../include/msgpack/zbuffer.hpp \
ChangeLog: * Fix zbuffer with empty string problem (#303)
include/msgpack/zbuffer.hpp:#ifndef MSGPACK_ZBUFFER_HPP
include/msgpack/zbuffer.hpp:#define MSGPACK_ZBUFFER_HPP
include/msgpack/zbuffer.hpp:#ifndef MSGPACK_ZBUFFER_RESERVE_SIZE
include/msgpack/zbuffer.hpp:#define MSGPACK_ZBUFFER_RESERVE_SIZE 512
include/msgpack/zbuffer.hpp:#ifndef MSGPACK_ZBUFFER_INIT_SIZE
include/msgpack/zbuffer.hpp:#define MSGPACK_ZBUFFER_INIT_SIZE 8192
include/msgpack/zbuffer.hpp:class zbuffer {
include/msgpack/zbuffer.hpp: zbuffer(int level = Z_DEFAULT_COMPRESSION,
include/msgpack/zbuffer.hpp: size_t init_size = MSGPACK_ZBUFFER_INIT_SIZE)
include/msgpack/zbuffer.hpp: ~zbuffer()
include/msgpack/zbuffer.hpp: if(m_stream.avail_out < MSGPACK_ZBUFFER_RESERVE_SIZE) {
include/msgpack/zbuffer.hpp: zbuffer(const zbuffer&);
include/msgpack/zbuffer.hpp: zbuffer& operator=(const zbuffer&);
include/msgpack/zbuffer.hpp: zbuffer(const zbuffer&) = delete;
include/msgpack/zbuffer.hpp: zbuffer& operator=(const zbuffer&) = delete;
include/msgpack/zbuffer.hpp:#endif /* msgpack/zbuffer.hpp */
include/msgpack/zbuffer.h:#ifndef MSGPACK_ZBUFFER_H
include/msgpack/zbuffer.h:#define MSGPACK_ZBUFFER_H
include/msgpack/zbuffer.h: * @defgroup msgpack_zbuffer Compressed buffer
include/msgpack/zbuffer.h:typedef struct msgpack_zbuffer {
include/msgpack/zbuffer.h:} msgpack_zbuffer;
include/msgpack/zbuffer.h:#ifndef MSGPACK_ZBUFFER_INIT_SIZE
include/msgpack/zbuffer.h:#define MSGPACK_ZBUFFER_INIT_SIZE 8192
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_init(
include/msgpack/zbuffer.h: msgpack_zbuffer* zbuf, int level, size_t init_size);
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_destroy(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline msgpack_zbuffer* msgpack_zbuffer_new(int level, size_t init_size);
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_free(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline const char* msgpack_zbuffer_data(const msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline size_t msgpack_zbuffer_size(const msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_reset(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_reset_buffer(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:#ifndef MSGPACK_ZBUFFER_RESERVE_SIZE
include/msgpack/zbuffer.h:#define MSGPACK_ZBUFFER_RESERVE_SIZE 512
include/msgpack/zbuffer.h:static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len);
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf);
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_init(msgpack_zbuffer* zbuf,
include/msgpack/zbuffer.h: memset(zbuf, 0, sizeof(msgpack_zbuffer));
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_destroy(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:static inline msgpack_zbuffer* msgpack_zbuffer_new(int level, size_t init_size)
include/msgpack/zbuffer.h: msgpack_zbuffer* zbuf = (msgpack_zbuffer*)malloc(sizeof(msgpack_zbuffer));
include/msgpack/zbuffer.h: if(!msgpack_zbuffer_init(zbuf, level, init_size)) {
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_free(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h: msgpack_zbuffer_destroy(zbuf);
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len)
include/msgpack/zbuffer.h: msgpack_zbuffer* zbuf = (msgpack_zbuffer*)data;
include/msgpack/zbuffer.h: if(zbuf->stream.avail_out < MSGPACK_ZBUFFER_RESERVE_SIZE) {
include/msgpack/zbuffer.h: if(!msgpack_zbuffer_expand(zbuf)) {
include/msgpack/zbuffer.h:static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h: if(!msgpack_zbuffer_expand(zbuf)) {
include/msgpack/zbuffer.h:static inline const char* msgpack_zbuffer_data(const msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:static inline size_t msgpack_zbuffer_size(const msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:static inline void msgpack_zbuffer_reset_buffer(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:static inline bool msgpack_zbuffer_reset(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h: msgpack_zbuffer_reset_buffer(zbuf);
include/msgpack/zbuffer.h:static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf)
include/msgpack/zbuffer.h:#endif /* msgpack/zbuffer.h */
CMakeLists.txt: include/msgpack/zbuffer.h
CMakeLists.txt: include/msgpack/zbuffer.hpp
test/buffer.cpp:#include <msgpack/zbuffer.hpp>
test/buffer.cpp:#include <msgpack/zbuffer.h>
test/buffer.cpp:TEST(buffer, zbuffer)
test/buffer.cpp: msgpack::zbuffer zbuf;
test/buffer.cpp:TEST(buffer, zbuffer_c)
test/buffer.cpp: msgpack_zbuffer zbuf;
test/buffer.cpp: EXPECT_TRUE(msgpack_zbuffer_init(&zbuf, 1, MSGPACK_ZBUFFER_INIT_SIZE));
test/buffer.cpp: EXPECT_EQ(0, msgpack_zbuffer_write(&zbuf, "a", 1));
test/buffer.cpp: EXPECT_EQ(0, msgpack_zbuffer_write(&zbuf, "a", 1));
test/buffer.cpp: EXPECT_EQ(0, msgpack_zbuffer_write(&zbuf, "a", 1));
test/buffer.cpp: EXPECT_EQ(0, msgpack_zbuffer_write(&zbuf, "", 0));
test/buffer.cpp: EXPECT_TRUE(msgpack_zbuffer_flush(&zbuf) != NULL);
test/buffer.cpp: msgpack_zbuffer_destroy(&zbuf);
Judging from this, I am inclined to think that msgpack does not use
these two headers for anything but tests. But I am not sure about
this.
> If you are at the stage where you are using Ring based on these
> packages, I wonder if it is not using the part of msgpack that uses
> zlib? Or, if it's finding zlib in the environment (if you are on a
> foreign distro)?
I am on GuixSD, but I do not have any packages besides opendht that
would depend on msgpack, yet. I do not have a working definition for
Ring. At this point, I do not see any way I could really test if
msgpack works properly with/without zlib.
FWIW, I looked at what other distributions do:
The Arch PKGBUILD does not refer to Zlib at all:
https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/msgpack-c
Gentoo has Zlib for tests:
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/msgpack/msgpack-1.1.0.ebuild
Debian seems to not refer to Zlib:
https://packages.debian.org/jessie/libmsgpackc2
https://packages.debian.org/jessie/libmsgpack3
https://packages.debian.org/jessie/libmsgpack-dev
This Nix expression does not mention zlib:
https://github.com/NixOS/nixpkgs/blob/f199be0fafcff0713dd4340b4373e575294aad58/pkgs/development/libraries/libmsgpack/generic.nix#L41
However, all of these seem to be different versions of msgpack.
On one hand, since these distributions seem to not include zlib as a
dependency, maybe zbuffer.h and zbuffer.hpp are not meant to be used or are
seldom used by other projects. On the other hand msgpack installs these
headers, so they should be useful.
>
> Or have I misunderstood?
No, I missed that. My mistake. But I am not sure what to do about
this.
I am working on packaging pjproject now. After that I think I will have
most of the dependencies of libring. At that point I could probably
test if msgpack works the way it is now. I am perfectly fine if we wait
with the inclusion of msgpack until then. What do you think?
Best,
Lukas
next prev parent reply other threads:[~2016-06-12 4:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-30 20:50 [PATCH] Add msgpack Lukas Gradl
2016-05-31 21:45 ` Leo Famulari
2016-06-01 4:49 ` Efraim Flashner
2016-06-03 0:50 ` Lukas Gradl
2016-06-06 14:07 ` Leo Famulari
2016-06-11 3:06 ` Leo Famulari
2016-06-11 23:56 ` Lukas Gradl
2016-06-12 0:17 ` Leo Famulari
2016-06-12 4:24 ` Lukas Gradl [this message]
2016-06-13 16:58 ` Leo Famulari
2016-06-13 17:59 ` Leo Famulari
2016-06-17 15:13 ` Lukas Gradl
2016-06-19 3:44 ` Lukas Gradl
2016-06-20 17:09 ` Leo Famulari
2016-06-21 13:55 ` Lukas Gradl
2016-06-21 16:06 ` Leo Famulari
2016-06-21 15:59 ` Lukas Gradl
2016-06-21 16:49 ` Efraim Flashner
2016-06-22 6:05 ` Lukas Gradl
2016-06-22 5:56 ` Lukas Gradl
2016-06-21 8:38 ` Ludovic Courtès
2016-06-21 13:31 ` Lukas Gradl
2016-06-21 14:11 ` Ludovic Courtès
2016-06-25 15:31 ` Leo Famulari
2016-06-25 16:40 ` Lukas Gradl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eg836nm3.fsf@openmailbox.org \
--to=lgradl@openmailbox.org \
--cc=guix-devel@gnu.org \
--cc=leo@famulari.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.