feat: rocksdb linkage of existing static rocksdb library is missing stdc++#1607
Merged
Mirko-von-Leipzig merged 4 commits intonextfrom Jan 29, 2026
Merged
feat: rocksdb linkage of existing static rocksdb library is missing stdc++#1607Mirko-von-Leipzig merged 4 commits intonextfrom
Mirko-von-Leipzig merged 4 commits intonextfrom
Conversation
drahnr
commented
Jan 28, 2026
drahnr
commented
Jan 28, 2026
Collaborator
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
I think this is good. I just need to give it more time to percolate..
Also gees this sucks as an upstream bug :D
sergerad
approved these changes
Jan 28, 2026
Collaborator
|
Merging now, will update again after cache has been written. Ah nvm I believe the next step is required to actually CI/cache the rocks DB static lib? |
Mirko-von-Leipzig
approved these changes
Jan 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
rocksdb-rusthas an issue supplyingstdc++(for linux, differs for platforms) to rustc at linktime. This implies missing C++ standard library features which in turn causes missing symbols when linking an existingrocksdb.a.It doesn't show for me
Currently we do recompile both locally and in CI rocksdb with the cache (~1GB) and time (~50s) for each of those runs.
If you want to avoid this, the following has worked in the past and shaves off both:
compile once without the env vars in step 4
find the
rocksdb.ain yourtargetdircopy the
rocksdb.athe output should show
librocksdb-sys(build)for less than 100ms instead of 50secondsWhy do we need this change?
Upstream's last release (10th of August '25) has a bug, it's already fixed in
master, but there is no release including that, the relevant PR already landed:rust-rocksdb/rust-rocksdb#1029
tl;dr - this is a stopgap solution to allow us to save both time and space in CI, as well as locally
Next steps
Separate steps of building our code and rocksdb - the latter should provide a statically linked rocksdb.a in most (all?) CI steps.
Approach
Possible paths
.cargo/config.tomlentry - while it works it will become an issue once trying to link musl or custom toolchain paths since it doesn't supportCXXSTDenv var - we also cannot simply gate for specific targets iiucbuild.rsfor each binary to add the correct linkage flags - it's opt-in and doesn't break any other pathsChoosing the latter, it's more code, but it's both opt-in and very deliberate.