( )⚙ D2750 thirdparty: start vendoring cbor python library

This is an archive of the discontinued Mercurial Phabricator instance.

thirdparty: start vendoring cbor python library
ClosedPublic

Authored by pulkit on Mar 9 2018, 5:54 AM.

Details

Summary

CBOR stands for Concise Binary Object Representation, which is a data format
which is very compact and extensible.

This patch moves the python library which can serilaize and deserialize python
objects to/from cbor formats. The library is taken from
https://github.com/agronholm/cbor2/ from changeset
6dad14d08b841dbbacefa08f4b3505d68072b753.

There is another python library for cbor at
https://github.com/brianolson/cbor_py/ which is used in evolve extension and was
imported in initial version of this series. That library though contains C code
and is bit faster, but has known bugs around serializing nested structures, is
unmaintained, raises an Exception object instead of a more dedicated Error type.

So, it's better to use a bug free and actively maintained library.

This library is not yet used and will be used in later commits.

  1. no-check-commit because we are importing a third library module

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Mar 9 2018, 5:54 AM

A gentle reminder to get this series reviewed.

Seems like a good idea to me. I had missed this series, but I just started thinking about having a state file for undo state and was not looking forward to coming up with another on-disk format.

indygreg accepted this revision.Mar 26 2018, 11:28 AM
indygreg added a subscriber: indygreg.

Having looked at the CBOR specification, I really like it! It is a better version of JSON and MessagePack. It's a reasonable format for at-rest storage and for exchange. While you may want to use it for state files, I think I'll use it for the wire protocol. It sure beats rolling custom data formats.

When I queue this, I'm going to roll the deletes from the next commit into this one because I don't see any value having the files in the final repo history. I'll also fold in upstream Git commit 84181540f6eb650437e3f73cd104a65661fe8e67, which switches to relative imports.

This revision is now accepted and ready to land.Mar 26 2018, 11:28 AM
This revision was automatically updated to reflect the committed changes.