rust-rocksdb icon indicating copy to clipboard operation
rust-rocksdb copied to clipboard

Use bindgen to auto generate FFI

Open Connor1996 opened this issue 6 years ago • 4 comments

See https://github.com/rust-lang/rust-bindgen Also, notice that https://github.com/rust-rocksdb/rust-rocksdb is already using bindgen, maybe we can rebase to it and add what we need.

Connor1996 avatar Nov 11 '19 06:11 Connor1996

I would like to try it ~

fredchenbj avatar Nov 14 '19 01:11 fredchenbj

Please mind that the upstream c.cc has an issue where it will return incorrect bloom filter:https://github.com/facebook/rocksdb/issues/6129 The issue was fixed in our c.cc. I'm not sure if our fork has more fixes not included upstream. cc @Connor1996 @fredchenbj

yiwu-arbug avatar Dec 06 '19 20:12 yiwu-arbug

Oh, seems we should take a careful look at the difference when updating c.cc @fredchenbj

Connor1996 avatar Dec 09 '19 02:12 Connor1996

I make some general illustrations about this task here:

  • the migration plan has three steps:
  1. make some change in c.h & c.c to make bindgen work in pr https://github.com/tikv/rust-rocksdb/pull/401. Then use the old crocksdb's c.h and bindgen to generate ffi rust code, and make it work for all dependency code; this step now is in progress in pr https://github.com/tikv/rust-rocksdb/pull/398.
  2. replace with upstreams's c.h & c.cc, and make all code in c.h conform to rocksdb's style, here we would only include rocksdb's c.h and not change it at all. Here we would fix the problem caused by the difference of c.h & c.cc between here and upstream.
  3. try to use rocksdb cpp api to generate ffi rust code. This step would be some challenging, and i now have not taken too much consideration.

fredchenbj avatar Dec 09 '19 11:12 fredchenbj