Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C Api and Rust bindings #44

Merged
merged 19 commits into from
Mar 16, 2018
Merged

Conversation

narekgharibyan
Copy link
Member

  • Keyvi C Api which can be utilized later on to add bindings to other languages (e.g. Go)
  • Keyvi Rust bindings,
  • Rust builds on Travis CI
  • Now style-check doesn't force short functions implemented outside of class to be merged to one line.

@hendrikmuhs This PR is same as cliqz-oss/keyvi#242 with addressed review comments. Also Rust package was renamed from rskeyvi to keyvi.

@coveralls
Copy link

coveralls commented Feb 17, 2018

Coverage Status

Coverage increased (+0.03%) to 93.517% when pulling 671515c on narekgharibyan:rust-final into 7aeddb3 on KeyviDev:master.

rust/Cargo.toml Outdated
@@ -0,0 +1,14 @@
[package]
name = "keyvi"
version = "0.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the semantics behind that version number. It would still make sense to have a unified version number.

rust/Cargo.toml Outdated

[build-dependencies]
bindgen = "0.30.0"
cmake = "*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you say something like > 2.8.12 (that's the minimum right now)?

rust/Cargo.lock Outdated
@@ -0,0 +1,549 @@
[root]
name = "keyvi"
version = "0.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version needs to be set twice (it is set in the ".toml" file below as well)?

rust/Cargo.lock Outdated
"serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these dependencies? Quite a lot, is that correct?

@hendrikmuhs
Copy link
Contributor

Look great!

I wonder a bit about:

  • version number, we should use the same version everywhere, why does it have to be set twice?
  • dependencies, I do not know much about rust, but that looks really strange to me
  • a Readme.md file in the rust folder with some basic getting started documentation would be nice (can be added later)

I would like to merge the index branch first in case of merge trouble. You introduced some style fixes - which are good - but if we merge this first I might have to reformat all files.

 - changed package version
 - removed Cargo.lock from VCS
@narekgharibyan
Copy link
Member Author

  • version number: Sure, that makes sense! It can be that in the future we will have a bug/fix in bindings part only, which I think will require patch version change and rerelease only for a particular binding. But that should be okay.
  • dependencies: I removed Cargo.lock file from VCS, as it is not needed for libraries, and is required only for executables, also added [dev-dependencies] section for test requirements. Now distribution package is dependent only on 3 packages.
  • Readme.md: Sure, need to add it! Probably along with release on https://crates.io/

Agree, I'll do the review next week, so we can first merge Index and then Rust and make the 0.3 release.

Copy link
Contributor

@hendrikmuhs hendrikmuhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

*  - fixed rust package build: workaround via symbolic links, so cargo
   will bundle keyvi source folder along with CMakeLists.txt into .crate
   file

*  - building only keyvi_c library, this reduces build time from 61s -> 7s
@narekgharibyan narekgharibyan merged commit 57464f8 into KeyviDev:master Mar 16, 2018
@narekgharibyan narekgharibyan deleted the rust-final branch March 16, 2018 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants