Skip to content

Commit 217fae4

Browse files
eira-franshamtomaka
authored andcommitted
Use pure-rust protoc (#255)
1 parent 1607fcb commit 217fae4

File tree

28 files changed

+1781
-345
lines changed

28 files changed

+1781
-345
lines changed

floodsub/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ protobuf = "2"
1717
smallvec = "0.6.0"
1818
tokio-io = "0.1"
1919
varint = { path = "../varint-rs" }
20+
21+
[build-dependencies]
22+
protobuf-codegen-pure = "2"
23+

floodsub/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extern crate protobuf_codegen_pure;
2+
3+
fn main() {
4+
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
5+
out_dir: "src/protobuf_structs",
6+
input: &["src/rpc.proto"],
7+
includes: &["src"],
8+
customize: Default::default(),
9+
}).expect("protoc failed to run");
10+
}

floodsub/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern crate smallvec;
3333
extern crate tokio_io;
3434
extern crate varint;
3535

36+
#[path = "protobuf_structs/rpc.rs"]
3637
mod rpc_proto;
3738
mod topic;
3839

floodsub/src/rpc_proto.rs renamed to floodsub/src/protobuf_structs/rpc.rs

Lines changed: 21 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is generated by rust-protobuf 2.0.0. Do not edit
1+
// This file is generated by rust-protobuf 2.0.2. Do not edit
22
// @generated
33

44
// https://github.com/Manishearth/rust-clippy/issues/702
@@ -1556,113 +1556,26 @@ impl ::protobuf::reflect::ProtobufValue for TopicDescriptor_EncOpts_EncMode {
15561556
}
15571557

15581558
static file_descriptor_proto_data: &'static [u8] = b"\
1559-
\n\trpc.proto\x12\x0bfloodsub.pb\"\xb8\x01\n\x03RPC\x12>\n\rsubscription\
1560-
s\x18\x01\x20\x03(\x0b2\x18.floodsub.pb.RPC.SubOptsR\rsubscriptions\x12.\
1561-
\n\x07publish\x18\x02\x20\x03(\x0b2\x14.floodsub.pb.MessageR\x07publish\
1562-
\x1aA\n\x07SubOpts\x12\x1c\n\tsubscribe\x18\x01\x20\x01(\x08R\tsubscribe\
1563-
\x12\x18\n\x07topicid\x18\x02\x20\x01(\tR\x07topicid\"c\n\x07Message\x12\
1564-
\x12\n\x04from\x18\x01\x20\x01(\x0cR\x04from\x12\x12\n\x04data\x18\x02\
1565-
\x20\x01(\x0cR\x04data\x12\x14\n\x05seqno\x18\x03\x20\x01(\x0cR\x05seqno\
1566-
\x12\x1a\n\x08topicIDs\x18\x04\x20\x03(\tR\x08topicIDs\"\xbe\x03\n\x0fTo\
1567-
picDescriptor\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x129\n\x04au\
1568-
th\x18\x02\x20\x01(\x0b2%.floodsub.pb.TopicDescriptor.AuthOptsR\x04auth\
1569-
\x126\n\x03enc\x18\x03\x20\x01(\x0b2$.floodsub.pb.TopicDescriptor.EncOpt\
1570-
sR\x03enc\x1a\x8a\x01\n\x08AuthOpts\x12B\n\x04mode\x18\x01\x20\x01(\x0e2\
1571-
..floodsub.pb.TopicDescriptor.AuthOpts.AuthModeR\x04mode\x12\x12\n\x04ke\
1572-
ys\x18\x02\x20\x03(\x0cR\x04keys\"&\n\x08AuthMode\x12\x08\n\x04NONE\x10\
1573-
\0\x12\x07\n\x03KEY\x10\x01\x12\x07\n\x03WOT\x10\x02\x1a\x96\x01\n\x07En\
1574-
cOpts\x12@\n\x04mode\x18\x01\x20\x01(\x0e2,.floodsub.pb.TopicDescriptor.\
1575-
EncOpts.EncModeR\x04mode\x12\x1c\n\tkeyHashes\x18\x02\x20\x03(\x0cR\tkey\
1576-
Hashes\"+\n\x07EncMode\x12\x08\n\x04NONE\x10\0\x12\r\n\tSHAREDKEY\x10\
1577-
\x01\x12\x07\n\x03WOT\x10\x02J\xc2\x10\n\x06\x12\x04\0\0.\x01\n\x08\n\
1578-
\x01\x02\x12\x03\0\x08\x13\n\n\n\x02\x04\0\x12\x04\x02\0\n\x01\n\n\n\x03\
1579-
\x04\0\x01\x12\x03\x02\x08\x0b\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x08+\
1580-
\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x08\x10\n\x0c\n\x05\x04\0\x02\0\
1581-
\x06\x12\x03\x03\x11\x18\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x19&\n\
1582-
\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03)*\n\x0b\n\x04\x04\0\x02\x01\x12\
1583-
\x03\x04\x08%\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x04\x08\x10\n\x0c\n\
1584-
\x05\x04\0\x02\x01\x06\x12\x03\x04\x11\x18\n\x0c\n\x05\x04\0\x02\x01\x01\
1585-
\x12\x03\x04\x19\x20\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04#$\n\x0c\n\
1586-
\x04\x04\0\x03\0\x12\x04\x06\x08\t\t\n\x0c\n\x05\x04\0\x03\0\x01\x12\x03\
1587-
\x06\x10\x17\n(\n\x06\x04\0\x03\0\x02\0\x12\x03\x07\x10,\"\x19\x20subscr\
1588-
ibe\x20or\x20unsubcribe\n\n\x0e\n\x07\x04\0\x03\0\x02\0\x04\x12\x03\x07\
1589-
\x10\x18\n\x0e\n\x07\x04\0\x03\0\x02\0\x05\x12\x03\x07\x19\x1d\n\x0e\n\
1590-
\x07\x04\0\x03\0\x02\0\x01\x12\x03\x07\x1e'\n\x0e\n\x07\x04\0\x03\0\x02\
1591-
\0\x03\x12\x03\x07*+\n\r\n\x06\x04\0\x03\0\x02\x01\x12\x03\x08\x10,\n\
1592-
\x0e\n\x07\x04\0\x03\0\x02\x01\x04\x12\x03\x08\x10\x18\n\x0e\n\x07\x04\0\
1593-
\x03\0\x02\x01\x05\x12\x03\x08\x19\x1f\n\x0e\n\x07\x04\0\x03\0\x02\x01\
1594-
\x01\x12\x03\x08\x20'\n\x0e\n\x07\x04\0\x03\0\x02\x01\x03\x12\x03\x08*+\
1595-
\n\n\n\x02\x04\x01\x12\x04\x0c\0\x11\x01\n\n\n\x03\x04\x01\x01\x12\x03\
1596-
\x0c\x08\x0f\n\x0b\n\x04\x04\x01\x02\0\x12\x03\r\x08\x20\n\x0c\n\x05\x04\
1597-
\x01\x02\0\x04\x12\x03\r\x08\x10\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\r\
1598-
\x11\x16\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\r\x17\x1b\n\x0c\n\x05\x04\
1599-
\x01\x02\0\x03\x12\x03\r\x1e\x1f\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0e\
1600-
\x08\x20\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03\x0e\x08\x10\n\x0c\n\x05\
1601-
\x04\x01\x02\x01\x05\x12\x03\x0e\x11\x16\n\x0c\n\x05\x04\x01\x02\x01\x01\
1602-
\x12\x03\x0e\x17\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0e\x1e\x1f\
1603-
\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x0f\x08!\n\x0c\n\x05\x04\x01\x02\
1604-
\x02\x04\x12\x03\x0f\x08\x10\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x0f\
1605-
\x11\x16\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x0f\x17\x1c\n\x0c\n\x05\
1606-
\x04\x01\x02\x02\x03\x12\x03\x0f\x1f\x20\n\x0b\n\x04\x04\x01\x02\x03\x12\
1607-
\x03\x10\x08%\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x03\x10\x08\x10\n\x0c\
1608-
\n\x05\x04\x01\x02\x03\x05\x12\x03\x10\x11\x17\n\x0c\n\x05\x04\x01\x02\
1609-
\x03\x01\x12\x03\x10\x18\x20\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\x10\
1610-
#$\nC\n\x02\x04\x02\x12\x04\x14\0.\x01\x1a7\x20topicID\x20=\x20hash(topi\
1611-
cDescriptor);\x20(not\x20the\x20topic.name)\n\n\n\n\x03\x04\x02\x01\x12\
1612-
\x03\x14\x08\x17\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x15\x08!\n\x0c\n\x05\
1613-
\x04\x02\x02\0\x04\x12\x03\x15\x08\x10\n\x0c\n\x05\x04\x02\x02\0\x05\x12\
1614-
\x03\x15\x11\x17\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x15\x18\x1c\n\x0c\
1615-
\n\x05\x04\x02\x02\0\x03\x12\x03\x15\x1f\x20\n\x0b\n\x04\x04\x02\x02\x01\
1616-
\x12\x03\x16\x08#\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03\x16\x08\x10\n\
1617-
\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03\x16\x11\x19\n\x0c\n\x05\x04\x02\
1618-
\x02\x01\x01\x12\x03\x16\x1a\x1e\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\
1619-
\x16!\"\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\x17\x08!\n\x0c\n\x05\x04\x02\
1620-
\x02\x02\x04\x12\x03\x17\x08\x10\n\x0c\n\x05\x04\x02\x02\x02\x06\x12\x03\
1621-
\x17\x11\x18\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x17\x19\x1c\n\x0c\n\
1622-
\x05\x04\x02\x02\x02\x03\x12\x03\x17\x1f\x20\n\x0c\n\x04\x04\x02\x03\0\
1623-
\x12\x04\x19\x08\"\t\n\x0c\n\x05\x04\x02\x03\0\x01\x12\x03\x19\x10\x18\n\
1624-
\r\n\x06\x04\x02\x03\0\x02\0\x12\x03\x1a\x10+\n\x0e\n\x07\x04\x02\x03\0\
1625-
\x02\0\x04\x12\x03\x1a\x10\x18\n\x0e\n\x07\x04\x02\x03\0\x02\0\x06\x12\
1626-
\x03\x1a\x19!\n\x0e\n\x07\x04\x02\x03\0\x02\0\x01\x12\x03\x1a\"&\n\x0e\n\
1627-
\x07\x04\x02\x03\0\x02\0\x03\x12\x03\x1a)*\n#\n\x06\x04\x02\x03\0\x02\
1628-
\x01\x12\x03\x1b\x10(\"\x14\x20root\x20keys\x20to\x20trust\n\n\x0e\n\x07\
1629-
\x04\x02\x03\0\x02\x01\x04\x12\x03\x1b\x10\x18\n\x0e\n\x07\x04\x02\x03\0\
1630-
\x02\x01\x05\x12\x03\x1b\x19\x1e\n\x0e\n\x07\x04\x02\x03\0\x02\x01\x01\
1631-
\x12\x03\x1b\x1f#\n\x0e\n\x07\x04\x02\x03\0\x02\x01\x03\x12\x03\x1b&'\n\
1632-
\x0e\n\x06\x04\x02\x03\0\x04\0\x12\x04\x1d\x10!\x11\n\x0e\n\x07\x04\x02\
1633-
\x03\0\x04\0\x01\x12\x03\x1d\x15\x1d\n8\n\x08\x04\x02\x03\0\x04\0\x02\0\
1634-
\x12\x03\x1e\x18!\"'\x20no\x20authentication,\x20anyone\x20can\x20publis\
1635-
h\n\n\x10\n\t\x04\x02\x03\0\x04\0\x02\0\x01\x12\x03\x1e\x18\x1c\n\x10\n\
1636-
\t\x04\x02\x03\0\x04\0\x02\0\x02\x12\x03\x1e\x1f\x20\nT\n\x08\x04\x02\
1637-
\x03\0\x04\0\x02\x01\x12\x03\x1f\x18\x20\"C\x20only\x20messages\x20signe\
1638-
d\x20by\x20keys\x20in\x20the\x20topic\x20descriptor\x20are\x20accepted\n\
1639-
\n\x10\n\t\x04\x02\x03\0\x04\0\x02\x01\x01\x12\x03\x1f\x18\x1b\n\x10\n\t\
1640-
\x04\x02\x03\0\x04\0\x02\x01\x02\x12\x03\x1f\x1e\x1f\nM\n\x08\x04\x02\
1641-
\x03\0\x04\0\x02\x02\x12\x03\x20\x18\x20\"<\x20web\x20of\x20trust,\x20ce\
1642-
rtificates\x20can\x20allow\x20publisher\x20set\x20to\x20grow\n\n\x10\n\t\
1643-
\x04\x02\x03\0\x04\0\x02\x02\x01\x12\x03\x20\x18\x1b\n\x10\n\t\x04\x02\
1644-
\x03\0\x04\0\x02\x02\x02\x12\x03\x20\x1e\x1f\n\x0c\n\x04\x04\x02\x03\x01\
1645-
\x12\x04$\x08-\t\n\x0c\n\x05\x04\x02\x03\x01\x01\x12\x03$\x10\x17\n\r\n\
1646-
\x06\x04\x02\x03\x01\x02\0\x12\x03%\x10*\n\x0e\n\x07\x04\x02\x03\x01\x02\
1647-
\0\x04\x12\x03%\x10\x18\n\x0e\n\x07\x04\x02\x03\x01\x02\0\x06\x12\x03%\
1648-
\x19\x20\n\x0e\n\x07\x04\x02\x03\x01\x02\0\x01\x12\x03%!%\n\x0e\n\x07\
1649-
\x04\x02\x03\x01\x02\0\x03\x12\x03%()\n<\n\x06\x04\x02\x03\x01\x02\x01\
1650-
\x12\x03&\x10-\"-\x20the\x20hashes\x20of\x20the\x20shared\x20keys\x20use\
1651-
d\x20(salted)\n\n\x0e\n\x07\x04\x02\x03\x01\x02\x01\x04\x12\x03&\x10\x18\
1652-
\n\x0e\n\x07\x04\x02\x03\x01\x02\x01\x05\x12\x03&\x19\x1e\n\x0e\n\x07\
1653-
\x04\x02\x03\x01\x02\x01\x01\x12\x03&\x1f(\n\x0e\n\x07\x04\x02\x03\x01\
1654-
\x02\x01\x03\x12\x03&+,\n\x0e\n\x06\x04\x02\x03\x01\x04\0\x12\x04(\x10,\
1655-
\x11\n\x0e\n\x07\x04\x02\x03\x01\x04\0\x01\x12\x03(\x15\x1c\n1\n\x08\x04\
1656-
\x02\x03\x01\x04\0\x02\0\x12\x03)\x18!\"\x20\x20no\x20encryption,\x20any\
1657-
one\x20can\x20read\n\n\x10\n\t\x04\x02\x03\x01\x04\0\x02\0\x01\x12\x03)\
1658-
\x18\x1c\n\x10\n\t\x04\x02\x03\x01\x04\0\x02\0\x02\x12\x03)\x1f\x20\n9\n\
1659-
\x08\x04\x02\x03\x01\x04\0\x02\x01\x12\x03*\x18&\"(\x20messages\x20are\
1660-
\x20encrypted\x20with\x20shared\x20key\n\n\x10\n\t\x04\x02\x03\x01\x04\0\
1661-
\x02\x01\x01\x12\x03*\x18!\n\x10\n\t\x04\x02\x03\x01\x04\0\x02\x01\x02\
1662-
\x12\x03*$%\nM\n\x08\x04\x02\x03\x01\x04\0\x02\x02\x12\x03+\x18\x20\"<\
1663-
\x20web\x20of\x20trust,\x20certificates\x20can\x20allow\x20publisher\x20\
1664-
set\x20to\x20grow\n\n\x10\n\t\x04\x02\x03\x01\x04\0\x02\x02\x01\x12\x03+\
1665-
\x18\x1b\n\x10\n\t\x04\x02\x03\x01\x04\0\x02\x02\x02\x12\x03+\x1e\x1f\
1559+
\n\trpc.proto\x12\x0bfloodsub.pb\"\x9c\x01\n\x03RPC\x123\n\rsubscription\
1560+
s\x18\x01\x20\x03(\x0b2\x18.floodsub.pb.RPC.SubOptsB\x02\x18\0\x12)\n\
1561+
\x07publish\x18\x02\x20\x03(\x0b2\x14.floodsub.pb.MessageB\x02\x18\0\x1a\
1562+
5\n\x07SubOpts\x12\x15\n\tsubscribe\x18\x01\x20\x01(\x08B\x02\x18\0\x12\
1563+
\x13\n\x07topicid\x18\x02\x20\x01(\tB\x02\x18\0\"V\n\x07Message\x12\x10\
1564+
\n\x04from\x18\x01\x20\x01(\x0cB\x02\x18\0\x12\x10\n\x04data\x18\x02\x20\
1565+
\x01(\x0cB\x02\x18\0\x12\x11\n\x05seqno\x18\x03\x20\x01(\x0cB\x02\x18\0\
1566+
\x12\x14\n\x08topicIDs\x18\x04\x20\x03(\tB\x02\x18\0\"\xb4\x03\n\x0fTopi\
1567+
cDescriptor\x12\x10\n\x04name\x18\x01\x20\x01(\tB\x02\x18\0\x127\n\x04au\
1568+
th\x18\x02\x20\x01(\x0b2%.floodsub.pb.TopicDescriptor.AuthOptsB\x02\x18\
1569+
\0\x125\n\x03enc\x18\x03\x20\x01(\x0b2$.floodsub.pb.TopicDescriptor.EncO\
1570+
ptsB\x02\x18\0\x1a\x8a\x01\n\x08AuthOpts\x12@\n\x04mode\x18\x01\x20\x01(\
1571+
\x0e2..floodsub.pb.TopicDescriptor.AuthOpts.AuthModeB\x02\x18\0\x12\x10\
1572+
\n\x04keys\x18\x02\x20\x03(\x0cB\x02\x18\0\"*\n\x08AuthMode\x12\x08\n\
1573+
\x04NONE\x10\0\x12\x07\n\x03KEY\x10\x01\x12\x07\n\x03WOT\x10\x02\x1a\x02\
1574+
\x10\0\x1a\x91\x01\n\x07EncOpts\x12>\n\x04mode\x18\x01\x20\x01(\x0e2,.fl\
1575+
oodsub.pb.TopicDescriptor.EncOpts.EncModeB\x02\x18\0\x12\x15\n\tkeyHashe\
1576+
s\x18\x02\x20\x03(\x0cB\x02\x18\0\"/\n\x07EncMode\x12\x08\n\x04NONE\x10\
1577+
\0\x12\r\n\tSHAREDKEY\x10\x01\x12\x07\n\x03WOT\x10\x02\x1a\x02\x10\0B\0b\
1578+
\x06proto2\
16661579
";
16671580

16681581
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
File renamed without changes.

identify/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ varint = { path = "../varint-rs" }
1717
[dev-dependencies]
1818
libp2p-tcp-transport = { path = "../tcp-transport" }
1919
tokio-core = "0.1.0"
20+
21+
[build-dependencies]
22+
protobuf-codegen-pure = "2"
23+

identify/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extern crate protobuf_codegen_pure;
2+
3+
fn main() {
4+
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
5+
out_dir: "src/protobuf_structs",
6+
input: &["src/structs.proto"],
7+
includes: &["src"],
8+
customize: Default::default(),
9+
}).expect("protoc failed to run");
10+
}

identify/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@ pub use self::protocol::{IdentifyInfo, IdentifyOutput, IdentifyProtocolConfig, I
8080
pub use self::transport::IdentifyTransport;
8181

8282
mod protocol;
83+
#[path = "protobuf_structs/structs.rs"]
8384
mod structs_proto;
8485
mod transport;

0 commit comments

Comments
 (0)