@@ -752,24 +752,28 @@ mod vendor {
752752 #[ cfg( feature = "io-uring" ) ]
753753 {
754754 if _target. os == "linux" {
755- pkg_config:: probe_library ( "liburing" ) . unwrap_or_else ( |e| {
756- panic ! (
757- "the `io-uring` feature was requested but pkg-config probe for \
758- `liburing` failed: {e}\n \
759- Hints:\n \
760- - Debian/Ubuntu: apt-get install liburing-dev\n \
761- - Fedora/RHEL: dnf install liburing-devel\n \
762- - Arch: pacman -S liburing\n \
763- - Alpine: apk add liburing-dev\n \
764- - or set PKG_CONFIG_PATH to a directory containing liburing.pc\n \
765- - when cross-compiling, also set PKG_CONFIG_ALLOW_CROSS=1\n \
766- and point PKG_CONFIG_PATH at the target sysroot's pkgconfig dir."
767- )
768- } ) ;
755+ // probe_library() only looks for shared objects, so it's
756+ // misleading when statically linking liburing.
757+ if cfg ! ( not( feature = "io-uring-static" ) ) {
758+ pkg_config:: probe_library ( "liburing" ) . unwrap_or_else ( |e| {
759+ panic ! (
760+ "the `io-uring` feature was requested but pkg-config probe for \
761+ `liburing` failed: {e}\n \
762+ Hints:\n \
763+ - Debian/Ubuntu: apt-get install liburing-dev\n \
764+ - Fedora/RHEL: dnf install liburing-devel\n \
765+ - Arch: pacman -S liburing\n \
766+ - Alpine: apk add liburing-dev\n \
767+ - or set PKG_CONFIG_PATH to a directory containing liburing.pc\n \
768+ - when cross-compiling, also set PKG_CONFIG_ALLOW_CROSS=1\n \
769+ and point PKG_CONFIG_PATH at the target sysroot's pkgconfig dir."
770+ )
771+ } ) ;
772+ }
769773 _cfg. define ( "ROCKSDB_IOURING_PRESENT" , Some ( "1" ) ) ;
770774
771- let mode = if cfg ! ( feature = "static" ) { "=static" } else { "" } ;
772- if cfg ! ( feature = "static" ) {
775+ let mode = if cfg ! ( feature = "io-uring- static" ) { "=static" } else { "" } ;
776+ if cfg ! ( feature = "io-uring- static" ) {
773777 // centos uses its /usr/lib64 search path but liburing.a is installed
774778 // by dnf oddly in /usr/lib unlike other installed archives.
775779 println ! ( "cargo:rustc-link-search=native=/usr/lib" ) ;
0 commit comments