-
Notifications
You must be signed in to change notification settings - Fork 5
Updated rocksdb submodule to v4.11.2. #2
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
Open
alexreg
wants to merge
6
commits into
jsgf:master
Choose a base branch
from
alexreg:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a369c4f
Updated rocksdb submodule to v4.11.2.
alexreg f6e8de1
Removed Option<_> wrappers around function types.
alexreg 113e7ec
Enum variants now have CamelCase style.
alexreg bfecf0c
Added comments for various sections of functions.
alexreg 5edcb4a
Reverted to Option<_> types for function pointers.
alexreg ba1a11b
Added module documentation.
alexreg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ name = "rocksdb-sys" | |
| version = "0.2.2" | ||
| authors = ["Jeremy Fitzhardinge <[email protected]>"] | ||
| license = "MIT/Apache-2.0/BSD-3-Clause" | ||
| description = "Native bindings to the rocksdb library" | ||
| description = "Native bindings to the RocksDB library" | ||
| readme = "README.md" | ||
| repository = "https://github.com/jsgf/rocksdb-sys.git" | ||
| keywords = [ "ffi", "rocksdb" ] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, rocksdb was using its own allocator (tcmalloc), which conflicted with jemalloc used by Rust. The only way I could resolve it was by statically linking rocksdb into the crate so that it uses the Rust allocator.
Also I prefer static linking to avoid more dependencies for the executable. The c<->rust binding is pretty fragile, and I'm sure that the RocksDB ABI doesn't change from version to version, so independently updating rocksdb from the Rust code using it seems risky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. The problem with static linking is that there is no static libstdc++ on OS X...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, can you statically link rocksdb and dynamically link libstdc++? I think that's what happens on Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid you can't dynamically link to a library from a static library. Unless you do it at run-time (rather than load-time), using
dlopenor something. This is definitely a problem, although I see why you wanted to avoid bringing two different allocators into play.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but that's not quite what I'm talking about.
RocksDB is written in C++, so it has a dependency on
libstdc++, but the library itself (the.rlib) doesn't have a direct dependency on it - it just needs to make sure when your executable is finally linked it includes a linkage tolibstdc++. And because the rest of RocksDB is static, it effectively becomes part of your main executable.I believe that
rustcusesclang++as its linker on Mac OS, so the requirement forlibstdc++will be automatically fulfilled.Have you tried this and had it fail? If so, how did it fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been told
rustcusesldas the linker, in fact, but not 100% sure. Anyway, I got lots of "undefined symbol" errors if I tried to link it statically.