n***@8thwall.com
2018-02-21 18:39:06 UTC
Per capnp "evolving your schema" we tried changing the name of a struct but
keeping its id the same e.g. changing this:
struct MyMessageList {
mList @0: List(MyMessage);
}
struct MyMessage {
field0 @0: Int32;
}
to this:
struct MyMessageList {
mList @0: List(DeprectedMyMessage);
}
struct DeprectedMyMessage @0xd4201303ceef0b19 {
field0 @0: Int32;
}
We found that the generated header files were the same (modulo the name
change), but that the data section in the c++ files had changed values,
which was worrisome. For example:
static const ::capnp::_::AlignedData<58> b_b23f9d28332a82cf = {
| static const ::capnp::_::AlignedData<59>
b_b23f9d28332a82cf = {
static const ::capnp::_::AlignedData<58> b_b23f9d28332a82cf = {
| static const ::capnp::_::AlignedData<59>
b_b23f9d28332a82cf = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
{ 0, 0, 0, 0, 5, 0, 6, 0,
207, 130, 42, 51, 40, 157, 63, 178,
207, 130, 42, 51, 40, 157, 63, 178,
50, 0, 0, 0, 2, 0, 0, 0,
| 60, 0, 0, 0, 2, 0, 0, 0,
171, 205, 79, 88, 213, 104, 54, 210,
171, 205, 79, 88, 213, 104, 54, 210,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
21, 0, 0, 0, 50, 2, 0, 0,
| 21, 0, 0, 0, 130, 2, 0, 0,
53, 0, 0, 0, 7, 0, 0, 0,
| 57, 0, 0, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
49, 0, 0, 0, 175, 0, 0, 0,
| 53, 0, 0, 0, 175, 0, 0, 0,
Is it expected that the data section would change in this way? Does it
affect the serialization / deserialization in a safe or unsafe way? What is
the data section encoding anyway?
keeping its id the same e.g. changing this:
struct MyMessageList {
mList @0: List(MyMessage);
}
struct MyMessage {
field0 @0: Int32;
}
to this:
struct MyMessageList {
mList @0: List(DeprectedMyMessage);
}
struct DeprectedMyMessage @0xd4201303ceef0b19 {
field0 @0: Int32;
}
We found that the generated header files were the same (modulo the name
change), but that the data section in the c++ files had changed values,
which was worrisome. For example:
static const ::capnp::_::AlignedData<58> b_b23f9d28332a82cf = {
| static const ::capnp::_::AlignedData<59>
b_b23f9d28332a82cf = {
static const ::capnp::_::AlignedData<58> b_b23f9d28332a82cf = {
| static const ::capnp::_::AlignedData<59>
b_b23f9d28332a82cf = {
{ 0, 0, 0, 0, 5, 0, 6, 0,
{ 0, 0, 0, 0, 5, 0, 6, 0,
207, 130, 42, 51, 40, 157, 63, 178,
207, 130, 42, 51, 40, 157, 63, 178,
50, 0, 0, 0, 2, 0, 0, 0,
| 60, 0, 0, 0, 2, 0, 0, 0,
171, 205, 79, 88, 213, 104, 54, 210,
171, 205, 79, 88, 213, 104, 54, 210,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
21, 0, 0, 0, 50, 2, 0, 0,
| 21, 0, 0, 0, 130, 2, 0, 0,
53, 0, 0, 0, 7, 0, 0, 0,
| 57, 0, 0, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
49, 0, 0, 0, 175, 0, 0, 0,
| 53, 0, 0, 0, 175, 0, 0, 0,
Is it expected that the data section would change in this way? Does it
affect the serialization / deserialization in a safe or unsafe way? What is
the data section encoding anyway?
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.