File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ default = [
3232]
3333jemalloc = [" rust-librocksdb-sys/jemalloc" ]
3434io-uring = [" rust-librocksdb-sys/io-uring" ]
35+ io-uring-static = [" rust-librocksdb-sys/io-uring-static" ]
3536numa = [" rust-librocksdb-sys/numa" ]
3637valgrind = []
3738snappy = [" rust-librocksdb-sys/snappy" ]
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ bindgen-runtime = ["bindgen/runtime"]
3535bindgen-static = [" bindgen/static" ]
3636mt_static = []
3737io-uring = [" pkg-config" ]
38+ io-uring-static = []
3839numa = [" pkg-config" ]
3940snappy = []
4041lz4 = [" lz4-sys" ]
Original file line number Diff line number Diff line change @@ -304,16 +304,22 @@ fn build_rocksdb() {
304304
305305 #[ cfg( feature = "io-uring" ) ]
306306 if target. contains ( "linux" ) {
307- pkg_config:: probe_library ( "liburing" )
308- . expect ( "The io-uring feature was requested but the library is not available" ) ;
307+ // probe_library() only looks for shared objects, so this is misleading when statically
308+ // linking
309+ if cfg ! ( not( feature = "io-uring-static" ) ) {
310+ pkg_config:: probe_library ( "liburing" )
311+ . expect ( "The io-uring feature was requested but the library is not available" ) ;
312+ }
313+
309314 config. define ( "ROCKSDB_IOURING_PRESENT" , Some ( "1" ) ) ;
310315
311- let mode = if cfg ! ( feature = "static" ) {
316+ let mode = if cfg ! ( feature = "io-uring- static" ) {
312317 "=static"
313318 } else {
314319 ""
315320 } ;
316- if cfg ! ( feature = "static" ) {
321+
322+ if cfg ! ( feature = "io-uring-static" ) {
317323 // centos uses its /usr/lib64 search path but liburing.a is installed
318324 // by dnf oddly in /usr/lib unlike other installed archives.
319325 println ! ( "cargo:rustc-link-search=native=/usr/lib" ) ;
You can’t perform that action at this time.
0 commit comments